/*
 Copyright 2009-2012 Kris Kowal under the terms of the MIT
 license found at http://github.com/kriskowal/q/raw/master/LICENSE

 With parts by Tyler Close
 Copyright 2007-2009 Tyler Close under the terms of the MIT X license found
 at http://www.opensource.org/licenses/mit-license.html
 Forked at ref_send.js version: 2009-05-11

 With parts by Mark Miller
 Copyright (C) 2011 Google Inc.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

 js-cookie v3.0.1 | MIT */
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};$jscomp.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(a,b){var c=$jscomp.propertyToPolyfillSymbol[b];if(null==c)return a[b];c=a[c];return void 0!==c?c:a[b]};
$jscomp.polyfill=function(a,b,c,d){b&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(a,b,c,d):$jscomp.polyfillUnisolated(a,b,c,d))};$jscomp.polyfillUnisolated=function(a,b,c,d){c=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var f=a[d];if(!(f in c))return;c=c[f]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})};
$jscomp.polyfillIsolated=function(a,b,c,d){var f=a.split(".");a=1===f.length;d=f[0];d=!a&&d in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var k=0;k<f.length-1;k++){var h=f[k];if(!(h in d))return;d=d[h]}f=f[f.length-1];c=$jscomp.IS_SYMBOL_NATIVE&&"es6"===c?d[f]:null;b=b(c);null!=b&&(a?$jscomp.defineProperty($jscomp.polyfills,f,{configurable:!0,writable:!0,value:b}):b!==c&&(void 0===$jscomp.propertyToPolyfillSymbol[f]&&($jscomp.propertyToPolyfillSymbol[f]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(f):
$jscomp.POLYFILL_PREFIX+f),f=$jscomp.propertyToPolyfillSymbol[f],$jscomp.defineProperty(d,f,{configurable:!0,writable:!0,value:b})))};$jscomp.initSymbol=function(){};
$jscomp.polyfill("Symbol",function(a){if(a)return a;var b=function(f,k){this.$jscomp$symbol$id_=f;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:k})};b.prototype.toString=function(){return this.$jscomp$symbol$id_};var c=0,d=function(f){if(this instanceof d)throw new TypeError("Symbol is not a constructor");return new b("jscomp_symbol_"+(f||"")+"_"+c++,f)};return d},"es6","es3");
$jscomp.polyfill("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;c<b.length;c++){var d=$jscomp.global[b[c]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&$jscomp.defineProperty(d.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}})}return a},"es6",
"es3");$jscomp.iteratorPrototype=function(a){a={next:a};a[Symbol.iterator]=function(){return this};return a};$jscomp.createTemplateTagFirstArg=function(a){return a.raw=a};$jscomp.createTemplateTagFirstArgWithRaw=function(a,b){a.raw=b;return a};$jscomp.makeIterator=function(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):$jscomp.arrayIterator(a)};$jscomp.arrayFromIterator=function(a){for(var b,c=[];!(b=a.next()).done;)c.push(b.value);return c};
$jscomp.arrayFromIterable=function(a){return a instanceof Array?a:$jscomp.arrayFromIterator($jscomp.makeIterator(a))};$jscomp.underscoreProtoCanBeSet=function(){var a={a:!0},b={};try{return b.__proto__=a,b.a}catch(c){}return!1};$jscomp.setPrototypeOf=$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null;
$jscomp.generator={};$jscomp.generator.ensureIteratorResultIsObject_=function(a){if(!(a instanceof Object))throw new TypeError("Iterator result "+a+" is not an object");};$jscomp.generator.Context=function(){this.isRunning_=!1;this.yieldAllIterator_=null;this.yieldResult=void 0;this.nextAddress=1;this.finallyAddress_=this.catchAddress_=0;this.finallyContexts_=this.abruptCompletion_=null};
$jscomp.generator.Context.prototype.start_=function(){if(this.isRunning_)throw new TypeError("Generator is already running");this.isRunning_=!0};$jscomp.generator.Context.prototype.stop_=function(){this.isRunning_=!1};$jscomp.generator.Context.prototype.jumpToErrorHandler_=function(){this.nextAddress=this.catchAddress_||this.finallyAddress_};$jscomp.generator.Context.prototype.next_=function(a){this.yieldResult=a};
$jscomp.generator.Context.prototype.throw_=function(a){this.abruptCompletion_={exception:a,isException:!0};this.jumpToErrorHandler_()};$jscomp.generator.Context.prototype.return=function(a){this.abruptCompletion_={return:a};this.nextAddress=this.finallyAddress_};$jscomp.generator.Context.prototype.jumpThroughFinallyBlocks=function(a){this.abruptCompletion_={jumpTo:a};this.nextAddress=this.finallyAddress_};$jscomp.generator.Context.prototype.yield=function(a,b){this.nextAddress=b;return{value:a}};
$jscomp.generator.Context.prototype.yieldAll=function(a,b){a=$jscomp.makeIterator(a);var c=a.next();$jscomp.generator.ensureIteratorResultIsObject_(c);if(c.done)this.yieldResult=c.value,this.nextAddress=b;else return this.yieldAllIterator_=a,this.yield(c.value,b)};$jscomp.generator.Context.prototype.jumpTo=function(a){this.nextAddress=a};$jscomp.generator.Context.prototype.jumpToEnd=function(){this.nextAddress=0};
$jscomp.generator.Context.prototype.setCatchFinallyBlocks=function(a,b){this.catchAddress_=a;void 0!=b&&(this.finallyAddress_=b)};$jscomp.generator.Context.prototype.setFinallyBlock=function(a){this.catchAddress_=0;this.finallyAddress_=a||0};$jscomp.generator.Context.prototype.leaveTryBlock=function(a,b){this.nextAddress=a;this.catchAddress_=b||0};
$jscomp.generator.Context.prototype.enterCatchBlock=function(a){this.catchAddress_=a||0;a=this.abruptCompletion_.exception;this.abruptCompletion_=null;return a};$jscomp.generator.Context.prototype.enterFinallyBlock=function(a,b,c){c?this.finallyContexts_[c]=this.abruptCompletion_:this.finallyContexts_=[this.abruptCompletion_];this.catchAddress_=a||0;this.finallyAddress_=b||0};
$jscomp.generator.Context.prototype.leaveFinallyBlock=function(a,b){b=this.finallyContexts_.splice(b||0)[0];if(b=this.abruptCompletion_=this.abruptCompletion_||b){if(b.isException)return this.jumpToErrorHandler_();void 0!=b.jumpTo&&this.finallyAddress_<b.jumpTo?(this.nextAddress=b.jumpTo,this.abruptCompletion_=null):this.nextAddress=this.finallyAddress_}else this.nextAddress=a};$jscomp.generator.Context.prototype.forIn=function(a){return new $jscomp.generator.Context.PropertyIterator(a)};
$jscomp.generator.Context.PropertyIterator=function(a){this.object_=a;this.properties_=[];for(var b in a)this.properties_.push(b);this.properties_.reverse()};$jscomp.generator.Context.PropertyIterator.prototype.getNext=function(){for(;0<this.properties_.length;){var a=this.properties_.pop();if(a in this.object_)return a}return null};$jscomp.generator.Engine_=function(a){this.context_=new $jscomp.generator.Context;this.program_=a};
$jscomp.generator.Engine_.prototype.next_=function(a){this.context_.start_();if(this.context_.yieldAllIterator_)return this.yieldAllStep_(this.context_.yieldAllIterator_.next,a,this.context_.next_);this.context_.next_(a);return this.nextStep_()};
$jscomp.generator.Engine_.prototype.return_=function(a){this.context_.start_();var b=this.context_.yieldAllIterator_;if(b)return this.yieldAllStep_("return"in b?b["return"]:function(c){return{value:c,done:!0}},a,this.context_.return);this.context_.return(a);return this.nextStep_()};
$jscomp.generator.Engine_.prototype.throw_=function(a){this.context_.start_();if(this.context_.yieldAllIterator_)return this.yieldAllStep_(this.context_.yieldAllIterator_["throw"],a,this.context_.next_);this.context_.throw_(a);return this.nextStep_()};
$jscomp.generator.Engine_.prototype.yieldAllStep_=function(a,b,c){try{var d=a.call(this.context_.yieldAllIterator_,b);$jscomp.generator.ensureIteratorResultIsObject_(d);if(!d.done)return this.context_.stop_(),d;var f=d.value}catch(k){return this.context_.yieldAllIterator_=null,this.context_.throw_(k),this.nextStep_()}this.context_.yieldAllIterator_=null;c.call(this.context_,f);return this.nextStep_()};
$jscomp.generator.Engine_.prototype.nextStep_=function(){for(;this.context_.nextAddress;)try{var a=this.program_(this.context_);if(a)return this.context_.stop_(),{value:a.value,done:!1}}catch(b){this.context_.yieldResult=void 0,this.context_.throw_(b)}this.context_.stop_();if(this.context_.abruptCompletion_){a=this.context_.abruptCompletion_;this.context_.abruptCompletion_=null;if(a.isException)throw a.exception;return{value:a.return,done:!0}}return{value:void 0,done:!0}};
$jscomp.generator.Generator_=function(a){this.next=function(b){return a.next_(b)};this.throw=function(b){return a.throw_(b)};this.return=function(b){return a.return_(b)};this[Symbol.iterator]=function(){return this}};$jscomp.generator.createGenerator=function(a,b){b=new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(b));$jscomp.setPrototypeOf&&a.prototype&&$jscomp.setPrototypeOf(b,a.prototype);return b};
$jscomp.asyncExecutePromiseGenerator=function(a){function b(d){return a.next(d)}function c(d){return a.throw(d)}return new Promise(function(d,f){function k(h){h.done?d(h.value):Promise.resolve(h.value).then(b,c).then(k,f)}k(a.next())})};$jscomp.asyncExecutePromiseGeneratorFunction=function(a){return $jscomp.asyncExecutePromiseGenerator(a())};$jscomp.asyncExecutePromiseGeneratorProgram=function(a){return $jscomp.asyncExecutePromiseGenerator(new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(a)))};
(function(a){if("function"===typeof bootstrap)bootstrap("promise",a);else if("object"===typeof exports&&"object"===typeof module)module.exports=a();else if("function"===typeof define&&define.amd)define(a);else if("undefined"!==typeof ses)ses.ok()&&(ses.makeQ=a);else if("undefined"!==typeof window||"undefined"!==typeof self){var b="undefined"!==typeof window?window:self,c=b.Q;b.Q=a();b.Q.noConflict=function(){b.Q=c;return this}}else throw Error("This environment was not anticipated by Q. Please file a bug.");
})(function(){function a(v){return function(){return hb.apply(v,arguments)}}function b(v,z){if(R&&z.stack&&"object"===typeof v&&null!==v&&v.stack&&-1===v.stack.indexOf("From previous event:")){for(var D=[];z;z=z.source)z.stack&&D.unshift(z.stack);D.unshift(v.stack);D=D.join("\nFrom previous event:\n").split("\n");z=[];for(var J=0;J<D.length;++J){var U=D[J],N;if(N=c(U)){var P=N[1];N=N[0]===ib&&P>=Ya&&P<=rb}else N=!1;N||(N=U,N=-1!==N.indexOf("(module.js:")||-1!==N.indexOf("(node.js:"));N||!U||z.push(U)}D=
z.join("\n");v.stack=D}}function c(v){var z=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(v);if(z||(z=/at ([^ ]+):(\d+):(?:\d+)$/.exec(v)))return[z[1],Number(z[2])];if(v=/.*@(.+):(\d+)$/.exec(v))return[v[1],Number(v[2])]}function d(){if(R)try{throw Error();}catch(z){var v=z.stack.split("\n");v=0<v[0].indexOf("@")?v[1]:v[2];if(v=c(v))return ib=v[0],v[1]}}function f(v){return v instanceof p?v:C(v)?O(v):A(v)}function k(){function v(P){J=P;N.source=P;na(z,function(ea,aa){f.nextTick(function(){P.promiseDispatch.apply(P,
aa)})},void 0);D=z=void 0}var z=[],D=[],J,U=Ma(k.prototype),N=Ma(p.prototype);N.promiseDispatch=function(P,ea,aa){var oa=da(arguments);z?(z.push(oa),"when"===ea&&aa[1]&&D.push(aa[1])):f.nextTick(function(){J.promiseDispatch.apply(J,oa)})};N.valueOf=function(){if(z)return N;var P=t(J);u(P)&&(J=P);return P};N.inspect=function(){return J?J.inspect():{state:"pending"}};if(f.longStackSupport&&R)try{throw Error();}catch(P){N.stack=P.stack.substring(P.stack.indexOf("\n")+1)}U.promise=N;U.resolve=function(P){J||
v(f(P))};U.fulfill=function(P){J||v(A(P))};U.reject=function(P){J||v(G(P))};U.notify=function(P){J||na(D,function(ea,aa){f.nextTick(function(){aa(P)})},void 0)};return U}function h(v){if("function"!==typeof v)throw new TypeError("resolver must be a function.");var z=k();try{v(z.resolve,z.reject,z.notify)}catch(D){z.reject(D)}return z.promise}function l(v){return h(function(z,D){for(var J=0,U=v.length;J<U;J++)f(v[J]).then(z,D)})}function p(v,z,D){void 0===z&&(z=function(N){return G(Error("Promise does not support operation: "+
N))});void 0===D&&(D=function(){return{state:"unknown"}});var J=Ma(p.prototype);J.promiseDispatch=function(N,P,ea){try{var aa=v[P]?v[P].apply(J,ea):z.call(J,P,ea)}catch(oa){aa=G(oa)}N&&N(aa)};if(J.inspect=D){var U=D();"rejected"===U.state&&(J.exception=U.reason);J.valueOf=function(){var N=D();return"pending"===N.state||"rejected"===N.state?J:N.value}}return J}function q(v,z,D,J){return f(v).then(z,D,J)}function t(v){if(u(v)){var z=v.inspect();if("fulfilled"===z.state)return z.value}return v}function u(v){return v instanceof
p}function C(v){return v===Object(v)&&"function"===typeof v.then}function E(){ba.length=0;ya.length=0;Na||(Na=!0)}function F(v,z){Na&&("object"===typeof process&&"function"===typeof process.emit&&f.nextTick.runAfter(function(){-1!==X(ya,v)&&(process.emit("unhandledRejection",z,v),Oa.push(v))}),ya.push(v),z&&"undefined"!==typeof z.stack?ba.push(z.stack):ba.push("(no stack) "+z))}function K(v){if(Na){var z=X(ya,v);-1!==z&&("object"===typeof process&&"function"===typeof process.emit&&f.nextTick.runAfter(function(){var D=
X(Oa,v);-1!==D&&(process.emit("rejectionHandled",ba[z],v),Oa.splice(D,1))}),ya.splice(z,1),ba.splice(z,1))}}function G(v){var z=p({when:function(D){D&&K(this);return D?D(v):this}},function(){return this},function(){return{state:"rejected",reason:v}});F(z,v);return z}function A(v){return p({when:function(){return v},get:function(z){return v[z]},set:function(z,D){v[z]=D},"delete":function(z){delete v[z]},post:function(z,D){return null===z||void 0===z?v.apply(void 0,D):v[z].apply(v,D)},apply:function(z,
D){return v.apply(z,D)},keys:function(){return L(v)}},void 0,function(){return{state:"fulfilled",value:v}})}function O(v){var z=k();f.nextTick(function(){try{v.then(z.resolve,z.reject,z.notify)}catch(D){z.reject(D)}});return z.promise}function W(v,z,D){return f(v).spread(z,D)}function Z(v,z,D){return f(v).dispatch(z,D)}function fa(v){return q(v,function(z){var D=0,J=k();na(z,function(U,N,P){var ea;u(N)&&"fulfilled"===(ea=N.inspect()).state?z[P]=ea.value:(++D,q(N,function(aa){z[P]=aa;0===--D&&J.resolve(z)},
J.reject,function(aa){J.notify({index:P,value:aa})}))},void 0);0===D&&J.resolve(z);return J.promise})}function Ca(v){if(0===v.length)return f.resolve();var z=f.defer(),D=0;na(v,function(J,U,N){J=v[N];D++;q(J,function(P){z.resolve(P)},function(){D--;0===D&&z.reject(Error("Can't get fulfillment value from any promise, all promises were rejected."))},function(P){z.notify({index:N,value:P})})},void 0);return z.promise}function ta(v){return q(v,function(z){z=Da(z,f);return q(fa(Da(z,function(D){return q(D,
ka,ka)})),function(){return z})})}var R=!1;try{throw Error();}catch(v){R=!!v.stack}var Ya=d(),ib,ka=function(){},pa=function(){function v(){for(var va,wa;D.next;){D=D.next;va=D.task;D.task=void 0;if(wa=D.domain)D.domain=void 0,wa.enter();z(va,wa)}for(;ea.length;)va=ea.pop(),z(va);U=!1}function z(va,wa){try{va()}catch(jb){if(P)throw wa&&wa.exit(),setTimeout(v,0),wa&&wa.enter(),jb;setTimeout(function(){throw jb;},0)}wa&&wa.exit()}var D={task:void 0,next:null},J=D,U=!1,N=void 0,P=!1,ea=[];pa=function(va){J=
J.next={task:va,domain:P&&process.domain,next:null};U||(U=!0,N())};if("object"===typeof process&&"[object process]"===process.toString()&&process.nextTick)P=!0,N=function(){process.nextTick(v)};else if("function"===typeof setImmediate)N="undefined"!==typeof window?setImmediate.bind(window,v):function(){setImmediate(v)};else if("undefined"!==typeof MessageChannel){var aa=new MessageChannel;aa.port1.onmessage=function(){N=oa;aa.port1.onmessage=v;v()};var oa=function(){aa.port2.postMessage(0)};N=function(){setTimeout(v,
0);oa()}}else N=function(){setTimeout(v,0)};pa.runAfter=function(va){ea.push(va);U||(U=!0,N())};return pa}(),hb=Function.call,da=a(Array.prototype.slice),na=a(Array.prototype.reduce||function(v,z){var D=0,J=this.length;if(1===arguments.length){do{if(D in this){z=this[D++];break}if(++D>=J)throw new TypeError;}while(1)}for(;D<J;D++)D in this&&(z=v(z,this[D],D));return z}),X=a(Array.prototype.indexOf||function(v){for(var z=0;z<this.length;z++)if(this[z]===v)return z;return-1}),Da=a(Array.prototype.map||
function(v,z){var D=this,J=[];na(D,function(U,N,P){J.push(v.call(z,N,P,D))},void 0);return J}),Ma=Object.create||function(v){function z(){}z.prototype=v;return new z},sb=a(Object.prototype.hasOwnProperty),L=Object.keys||function(v){var z=[],D;for(D in v)sb(v,D)&&z.push(D);return z},Hb=a(Object.prototype.toString);var ra="undefined"!==typeof ReturnValue?ReturnValue:function(v){this.value=v};f.resolve=f;f.nextTick=pa;f.longStackSupport=!1;"object"===typeof process&&process&&process.env&&process.env.Q_DEBUG&&
(f.longStackSupport=!0);f.defer=k;k.prototype.makeNodeResolver=function(){var v=this;return function(z,D){z?v.reject(z):2<arguments.length?v.resolve(da(arguments,1)):v.resolve(D)}};f.Promise=h;f.promise=h;h.race=l;h.all=fa;h.reject=G;h.resolve=f;f.passByCopy=function(v){return v};p.prototype.passByCopy=function(){return this};f.join=function(v,z){return f(v).join(z)};p.prototype.join=function(v){return f([this,v]).spread(function(z,D){if(z===D)return z;throw Error("Can't join: not the same: "+z+" "+
D);})};f.race=l;p.prototype.race=function(){return this.then(f.race)};f.makePromise=p;p.prototype.toString=function(){return"[object Promise]"};p.prototype.then=function(v,z,D){var J=this,U=k(),N=!1;f.nextTick(function(){J.promiseDispatch(function(P){if(!N){N=!0;var ea=U.resolve;try{var aa="function"===typeof v?v(P):P}catch(oa){aa=G(oa)}ea.call(U,aa)}},"when",[function(P){if(!N){N=!0;var ea=U.resolve;a:{if("function"===typeof z){b(P,J);try{var aa=z(P);break a}catch(oa){aa=G(oa);break a}}aa=G(P)}ea.call(U,
aa)}}])});J.promiseDispatch(void 0,"when",[void 0,function(P){var ea=!1;try{var aa="function"===typeof D?D(P):P}catch(oa){if(ea=!0,f.onerror)f.onerror(oa);else throw oa;}ea||U.notify(aa)}]);return U.promise};f.tap=function(v,z){return f(v).tap(z)};p.prototype.tap=function(v){v=f(v);return this.then(function(z){return v.fcall(z).thenResolve(z)})};f.when=q;p.prototype.thenResolve=function(v){return this.then(function(){return v})};f.thenResolve=function(v,z){return f(v).thenResolve(z)};p.prototype.thenReject=
function(v){return this.then(function(){throw v;})};f.thenReject=function(v,z){return f(v).thenReject(z)};f.nearer=t;f.isPromise=u;f.isPromiseAlike=C;f.isPending=function(v){return u(v)&&"pending"===v.inspect().state};p.prototype.isPending=function(){return"pending"===this.inspect().state};f.isFulfilled=function(v){return!u(v)||"fulfilled"===v.inspect().state};p.prototype.isFulfilled=function(){return"fulfilled"===this.inspect().state};f.isRejected=function(v){return u(v)&&"rejected"===v.inspect().state};
p.prototype.isRejected=function(){return"rejected"===this.inspect().state};var ba=[],ya=[],Oa=[],Na=!0;f.resetUnhandledRejections=E;f.getUnhandledReasons=function(){return ba.slice()};f.stopUnhandledRejectionTracking=function(){E();Na=!1};E();f.reject=G;f.fulfill=A;f.master=function(v){return p({isDef:function(){}},function(z,D){return Z(v,z,D)},function(){return f(v).inspect()})};f.spread=W;p.prototype.spread=function(v,z){return this.all().then(function(D){return v.apply(void 0,D)},z)};f.async=
function(v){return function(){function z(N,P){if("undefined"===typeof StopIteration){try{var ea=D[N](P)}catch(aa){return G(aa)}return ea.done?f(ea.value):q(ea.value,J,U)}try{ea=D[N](P)}catch(aa){return N=aa,"[object StopIteration]"===Hb(N)||N instanceof ra?f(aa.value):G(aa)}return q(ea,J,U)}var D=v.apply(this,arguments),J=z.bind(z,"next"),U=z.bind(z,"throw");return J()}};f.spawn=function(v){f.done(f.async(v)())};f["return"]=function(v){throw new ra(v);};f.promised=function(v){return function(){return W([this,
fa(arguments)],function(z,D){return v.apply(z,D)})}};f.dispatch=Z;p.prototype.dispatch=function(v,z){var D=this,J=k();f.nextTick(function(){D.promiseDispatch(J.resolve,v,z)});return J.promise};f.get=function(v,z){return f(v).dispatch("get",[z])};p.prototype.get=function(v){return this.dispatch("get",[v])};f.set=function(v,z,D){return f(v).dispatch("set",[z,D])};p.prototype.set=function(v,z){return this.dispatch("set",[v,z])};f.del=f["delete"]=function(v,z){return f(v).dispatch("delete",[z])};p.prototype.del=
p.prototype["delete"]=function(v){return this.dispatch("delete",[v])};f.mapply=f.post=function(v,z,D){return f(v).dispatch("post",[z,D])};p.prototype.mapply=p.prototype.post=function(v,z){return this.dispatch("post",[v,z])};f.send=f.mcall=f.invoke=function(v,z){return f(v).dispatch("post",[z,da(arguments,2)])};p.prototype.send=p.prototype.mcall=p.prototype.invoke=function(v){return this.dispatch("post",[v,da(arguments,1)])};f.fapply=function(v,z){return f(v).dispatch("apply",[void 0,z])};p.prototype.fapply=
function(v){return this.dispatch("apply",[void 0,v])};f["try"]=f.fcall=function(v){return f(v).dispatch("apply",[void 0,da(arguments,1)])};p.prototype.fcall=function(){return this.dispatch("apply",[void 0,da(arguments)])};f.fbind=function(v){var z=f(v),D=da(arguments,1);return function(){return z.dispatch("apply",[this,D.concat(da(arguments))])}};p.prototype.fbind=function(){var v=this,z=da(arguments);return function(){return v.dispatch("apply",[this,z.concat(da(arguments))])}};f.keys=function(v){return f(v).dispatch("keys",
[])};p.prototype.keys=function(){return this.dispatch("keys",[])};f.all=fa;p.prototype.all=function(){return fa(this)};f.any=Ca;p.prototype.any=function(){return Ca(this)};f.allResolved=function(v,z,D){return function(){"undefined"!==typeof console&&"function"===typeof console.warn&&console.warn(z+" is deprecated, use "+D+" instead.",Error("").stack);return v.apply(v,arguments)}}(ta,"allResolved","allSettled");p.prototype.allResolved=function(){return ta(this)};f.allSettled=function(v){return f(v).allSettled()};
p.prototype.allSettled=function(){return this.then(function(v){return fa(Da(v,function(z){function D(){return z.inspect()}z=f(z);return z.then(D,D)}))})};f.fail=f["catch"]=function(v,z){return f(v).then(void 0,z)};p.prototype.fail=p.prototype["catch"]=function(v){return this.then(void 0,v)};f.progress=function(v,z){return f(v).then(void 0,void 0,z)};p.prototype.progress=function(v){return this.then(void 0,void 0,v)};f.fin=f["finally"]=function(v,z){return f(v)["finally"](z)};p.prototype.fin=p.prototype["finally"]=
function(v){v=f(v);return this.then(function(z){return v.fcall().then(function(){return z})},function(z){return v.fcall().then(function(){throw z;})})};f.done=function(v,z,D,J){return f(v).done(z,D,J)};p.prototype.done=function(v,z,D){var J=function(N){f.nextTick(function(){b(N,U);if(f.onerror)f.onerror(N);else throw N;})},U=v||z||D?this.then(v,z,D):this;"object"===typeof process&&process&&process.domain&&(J=process.domain.bind(J));U.then(void 0,J)};f.timeout=function(v,z,D){return f(v).timeout(z,
D)};p.prototype.timeout=function(v,z){var D=k(),J=setTimeout(function(){z&&"string"!==typeof z||(z=Error(z||"Timed out after "+v+" ms"),z.code="ETIMEDOUT");D.reject(z)},v);this.then(function(U){clearTimeout(J);D.resolve(U)},function(U){clearTimeout(J);D.reject(U)},D.notify);return D.promise};f.delay=function(v,z){void 0===z&&(z=v,v=void 0);return f(v).delay(z)};p.prototype.delay=function(v){return this.then(function(z){var D=k();setTimeout(function(){D.resolve(z)},v);return D.promise})};f.nfapply=
function(v,z){return f(v).nfapply(z)};p.prototype.nfapply=function(v){var z=k();v=da(v);v.push(z.makeNodeResolver());this.fapply(v).fail(z.reject);return z.promise};f.nfcall=function(v){var z=da(arguments,1);return f(v).nfapply(z)};p.prototype.nfcall=function(){var v=da(arguments),z=k();v.push(z.makeNodeResolver());this.fapply(v).fail(z.reject);return z.promise};f.nfbind=f.denodeify=function(v){var z=da(arguments,1);return function(){var D=z.concat(da(arguments)),J=k();D.push(J.makeNodeResolver());
f(v).fapply(D).fail(J.reject);return J.promise}};p.prototype.nfbind=p.prototype.denodeify=function(){var v=da(arguments);v.unshift(this);return f.denodeify.apply(void 0,v)};f.nbind=function(v,z){var D=da(arguments,2);return function(){var J=D.concat(da(arguments)),U=k();J.push(U.makeNodeResolver());f(function(){return v.apply(z,arguments)}).fapply(J).fail(U.reject);return U.promise}};p.prototype.nbind=function(){var v=da(arguments,0);v.unshift(this);return f.nbind.apply(void 0,v)};f.nmapply=f.npost=
function(v,z,D){return f(v).npost(z,D)};p.prototype.nmapply=p.prototype.npost=function(v,z){z=da(z||[]);var D=k();z.push(D.makeNodeResolver());this.dispatch("post",[v,z]).fail(D.reject);return D.promise};f.nsend=f.nmcall=f.ninvoke=function(v,z){var D=da(arguments,2),J=k();D.push(J.makeNodeResolver());f(v).dispatch("post",[z,D]).fail(J.reject);return J.promise};p.prototype.nsend=p.prototype.nmcall=p.prototype.ninvoke=function(v){var z=da(arguments,1),D=k();z.push(D.makeNodeResolver());this.dispatch("post",
[v,z]).fail(D.reject);return D.promise};f.nodeify=function(v,z){return f(v).nodeify(z)};p.prototype.nodeify=function(v){if(v)this.then(function(z){f.nextTick(function(){v(null,z)})},function(z){f.nextTick(function(){v(z)})});else return this};f.noConflict=function(){throw Error("Q.noConflict only works when Q is used as a global");};var rb=d();return f});
!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){function a(){return Zb.apply(null,arguments)}function b(g){return g instanceof Array||"[object Array]"===Object.prototype.toString.call(g)}function c(g){return null!=g&&"[object Object]"===Object.prototype.toString.call(g)}function d(g,m){return Object.prototype.hasOwnProperty.call(g,m)}function f(g){if(Object.getOwnPropertyNames)return 0===
Object.getOwnPropertyNames(g).length;for(var m in g)if(d(g,m))return;return 1}function k(g){return void 0===g}function h(g){return"number"==typeof g||"[object Number]"===Object.prototype.toString.call(g)}function l(g){return g instanceof Date||"[object Date]"===Object.prototype.toString.call(g)}function p(g,m){for(var n=[],r=g.length,w=0;w<r;++w)n.push(m(g[w],w));return n}function q(g,m){for(var n in m)d(m,n)&&(g[n]=m[n]);return d(m,"toString")&&(g.toString=m.toString),d(m,"valueOf")&&(g.valueOf=
m.valueOf),g}function t(g,m,n,r){return $b(g,m,n,r,!0).utc()}function u(g){return null==g._pf&&(g._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),g._pf}function C(g){if(null==g._isValid){var m=u(g),n=yc.call(m.parsedDateParts,function(r){return null!=r});n=!isNaN(g._d.getTime())&&0>m.overflow&&!m.empty&&!m.invalidEra&&
!m.invalidMonth&&!m.invalidWeekday&&!m.weekdayMismatch&&!m.nullInput&&!m.invalidFormat&&!m.userInvalidated&&(!m.meridiem||m.meridiem&&n);if(g._strict&&(n=n&&0===m.charsLeftOver&&0===m.unusedTokens.length&&void 0===m.bigHour),null!=Object.isFrozen&&Object.isFrozen(g))return n;g._isValid=n}return g._isValid}function E(g){var m=t(NaN);return null!=g?q(u(m),g):u(m).userInvalidated=!0,m}function F(g,m){var n,r,w,B=ac.length;if(k(m._isAMomentObject)||(g._isAMomentObject=m._isAMomentObject),k(m._i)||(g._i=
m._i),k(m._f)||(g._f=m._f),k(m._l)||(g._l=m._l),k(m._strict)||(g._strict=m._strict),k(m._tzm)||(g._tzm=m._tzm),k(m._isUTC)||(g._isUTC=m._isUTC),k(m._offset)||(g._offset=m._offset),k(m._pf)||(g._pf=u(m)),k(m._locale)||(g._locale=m._locale),0<B)for(n=0;n<B;n++)k(w=m[r=ac[n]])||(g[r]=w);return g}function K(g){F(this,g);this._d=new Date(null!=g._d?g._d.getTime():NaN);this.isValid()||(this._d=new Date(NaN));!1===Ib&&(Ib=!0,a.updateOffset(this),Ib=!1)}function G(g){return g instanceof K||null!=g&&null!=
g._isAMomentObject}function A(g){!1===a.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+g)}function O(g,m){var n=!0;return q(function(){if(null!=a.deprecationHandler&&a.deprecationHandler(null,g),n){for(var r,w,B=[],H=arguments.length,M=0;M<H;M++){if(r="","object"==typeof arguments[M]){for(w in r+="\n["+M+"] ",arguments[0])d(arguments[0],w)&&(r+=w+": "+arguments[0][w]+", ");r=r.slice(0,-2)}else r=arguments[M];B.push(r)}A(g+"\nArguments: "+
Array.prototype.slice.call(B).join("")+"\n"+Error().stack);n=!1}return m.apply(this,arguments)},m)}function W(g,m){null!=a.deprecationHandler&&a.deprecationHandler(g,m);bc[g]||(A(m),bc[g]=!0)}function Z(g){return"undefined"!=typeof Function&&g instanceof Function||"[object Function]"===Object.prototype.toString.call(g)}function fa(g,m){var n,r=q({},g);for(n in m)d(m,n)&&(c(g[n])&&c(m[n])?(r[n]={},q(r[n],g[n]),q(r[n],m[n])):null!=m[n]?r[n]=m[n]:delete r[n]);for(n in g)d(g,n)&&!d(m,n)&&c(g[n])&&(r[n]=
q({},r[n]));return r}function Ca(g){null!=g&&this.set(g)}function ta(g,m,n){var r=""+Math.abs(g);return(0<=g?n?"+":"":"-")+Math.pow(10,Math.max(0,m-r.length)).toString().substr(1)+r}function R(g,m,n,r){var w="string"==typeof r?function(){return this[r]()}:r;g&&(Za[g]=w);m&&(Za[m[0]]=function(){return ta(w.apply(this,arguments),m[1],m[2])});n&&(Za[n]=function(){return this.localeData().ordinal(w.apply(this,arguments),g)})}function Ya(g,m){return g.isValid()?(m=ib(m,g.localeData()),Jb[m]=Jb[m]||function(n){for(var r,
w=n.match(Kb),B=0,H=w.length;B<H;B++)Za[w[B]]?w[B]=Za[w[B]]:w[B]=(r=w[B]).match(/\[[\s\S]/)?r.replace(/^\[|\]$/g,""):r.replace(/\\/g,"");return function(M){for(var Y="",T=0;T<H;T++)Y+=Z(w[T])?w[T].call(M,n):w[T];return Y}}(m),Jb[m](g)):g.localeData().invalidDate()}function ib(g,m){function n(w){return m.longDateFormat(w)||w}var r=5;for(tb.lastIndex=0;0<=r&&tb.test(g);)g=g.replace(tb,n),tb.lastIndex=0,--r;return g}function ka(g,m){var n=g.toLowerCase();kb[n]=kb[n+"s"]=kb[m]=g}function pa(g){return"string"==
typeof g?kb[g]||kb[g.toLowerCase()]:void 0}function hb(g){var m,n,r={};for(n in g)d(g,n)&&(m=pa(n))&&(r[m]=g[n]);return r}function da(g){return 0==g%4&&0!=g%100||0==g%400}function na(g){return 0>g?Math.ceil(g)||0:Math.floor(g)}function X(g){g=+g;return 0!=g&&isFinite(g)?na(g):0}function Da(g,m){return function(n){return null!=n?(sb(this,g,n),a.updateOffset(this,m),this):Ma(this,g)}}function Ma(g,m){return g.isValid()?g._d["get"+(g._isUTC?"UTC":"")+m]():NaN}function sb(g,m,n){g.isValid()&&!isNaN(n)&&
("FullYear"===m&&da(g.year())&&1===g.month()&&29===g.date()?(n=X(n),g._d["set"+(g._isUTC?"UTC":"")+m](n,g.month(),Oa(n,g.month()))):g._d["set"+(g._isUTC?"UTC":"")+m](n))}function L(g,m,n){Lb[g]=Z(m)?m:function(r,w){return r&&n?n:m}}function Hb(g,m){return d(Lb,g)?Lb[g](m._strict,m._locale):new RegExp(ra(g.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(n,r,w,B,H){return r||w||B||H})))}function ra(g){return g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$\x26")}function ba(g,m){var n,
r=m;"string"==typeof g&&(g=[g]);h(m)&&(r=function(B,H){H[m]=X(B)});var w=g.length;for(n=0;n<w;n++)Mb[g[n]]=r}function ya(g,m){ba(g,function(n,r,w,B){w._w=w._w||{};m(n,w._w,w,B)})}function Oa(g,m){if(isNaN(g)||isNaN(m))return NaN;var n=(m%(n=12)+n)%n;return g+=(m-n)/12,1==n?da(g)?29:28:31-n%7%2}function Na(g,m){if(g.isValid()){if("string"==typeof m)if(/^\d+$/.test(m))m=X(m);else if(!h(m=g.localeData().monthsParse(m)))return;var n=Math.min(g.date(),Oa(g.year(),m));g._d["set"+(g._isUTC?"UTC":"")+"Month"](m,
n)}}function rb(g){return null!=g?(Na(this,g),a.updateOffset(this,!0),this):Ma(this,"Month")}function v(){function g(H,M){return M.length-H.length}for(var m,n=[],r=[],w=[],B=0;12>B;B++)m=t([2E3,B]),n.push(this.monthsShort(m,"")),r.push(this.months(m,"")),w.push(this.months(m,"")),w.push(this.monthsShort(m,""));n.sort(g);r.sort(g);w.sort(g);for(B=0;12>B;B++)n[B]=ra(n[B]),r[B]=ra(r[B]);for(B=0;24>B;B++)w[B]=ra(w[B]);this._monthsShortRegex=this._monthsRegex=new RegExp("^("+w.join("|")+")","i");this._monthsStrictRegex=
new RegExp("^("+r.join("|")+")","i");this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function z(g,m,n,r,w,B,H){var M;return 100>g&&0<=g?(M=new Date(g+400,m,n,r,w,B,H),isFinite(M.getFullYear())&&M.setFullYear(g)):M=new Date(g,m,n,r,w,B,H),M}function D(g){var m;return 100>g&&0<=g?((m=Array.prototype.slice.call(arguments))[0]=g+400,m=new Date(Date.UTC.apply(null,m)),isFinite(m.getUTCFullYear())&&m.setUTCFullYear(g)):m=new Date(Date.UTC.apply(null,arguments)),m}function J(g,m,n){n=7+
m-n;return n-(7+D(g,0,n).getUTCDay()-m)%7-1}function U(g,m,n,r,w){var B;m=1+7*(m-1)+(7+n-r)%7+J(g,r,w);0>=m?(g=B=g-1,m=(da(g)?366:365)+m):m=m>(da(g)?366:365)?(B=g+1,m-(da(g)?366:365)):(B=g,m);return{year:B,dayOfYear:m}}function N(g,m,n){var r,w,B=J(g.year(),m,n);B=Math.floor((g.dayOfYear()-B-1)/7)+1;return 1>B?r=B+P(w=g.year()-1,m,n):B>P(g.year(),m,n)?(r=B-P(g.year(),m,n),w=g.year()+1):(w=g.year(),r=B),{week:r,year:w}}function P(g,m,n){var r=J(g,m,n);m=J(g+1,m,n);return((da(g)?366:365)-r+m)/7}function ea(g,
m){return g.slice(m,7).concat(g.slice(0,m))}function aa(){function g(T,S){return S.length-T.length}for(var m,n,r,w=[],B=[],H=[],M=[],Y=0;7>Y;Y++)r=t([2E3,1]).day(Y),m=ra(this.weekdaysMin(r,"")),n=ra(this.weekdaysShort(r,"")),r=ra(this.weekdays(r,"")),w.push(m),B.push(n),H.push(r),M.push(m),M.push(n),M.push(r);w.sort(g);B.sort(g);H.sort(g);M.sort(g);this._weekdaysMinRegex=this._weekdaysShortRegex=this._weekdaysRegex=new RegExp("^("+M.join("|")+")","i");this._weekdaysStrictRegex=new RegExp("^("+H.join("|")+
")","i");this._weekdaysShortStrictRegex=new RegExp("^("+B.join("|")+")","i");this._weekdaysMinStrictRegex=new RegExp("^("+w.join("|")+")","i")}function oa(){return this.hours()%12||12}function va(g,m){R(g,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),m)})}function wa(g,m){return m._meridiemParse}function jb(g){return g&&g.toLowerCase().replace("_","-")}function ub(g){if(void 0===ja[g]&&"undefined"!=typeof module&&module&&module.exports&&null!=g.match("^[^/\\\\]*$"))try{var m=
lb._abbr;require("./locale/"+g);Pa(m)}catch(n){ja[g]=null}return ja[g]}function Pa(g,m){return g&&((m=k(m)?Fa(g):Nb(g,m))?lb=m:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+g+" not found. Did you forget to load it?")),lb._abbr}function Nb(g,m){if(null===m)return delete ja[g],null;var n=cc;if(m.abbr=g,null!=ja[g])W("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),
n=ja[g]._config;else if(null!=m.parentLocale)if(null!=ja[m.parentLocale])n=ja[m.parentLocale]._config;else{if(null==(n=ub(m.parentLocale)))return mb[m.parentLocale]||(mb[m.parentLocale]=[]),mb[m.parentLocale].push({name:g,config:m}),null;n=n._config}return ja[g]=new Ca(fa(n,m)),mb[g]&&mb[g].forEach(function(r){Nb(r.name,r.config)}),Pa(g),ja[g]}function Fa(g){var m;if(!(g=g&&g._locale&&g._locale._abbr?g._locale._abbr:g))return lb;if(!b(g)){if(m=ub(g))return m;g=[g]}var n;a:{for(var r,w,B=0;B<g.length;){m=
(w=jb(g[B]).split("-")).length;for(n=(n=jb(g[B+1]))?n.split("-"):null;0<m;){if(r=ub(w.slice(0,m).join("-"))){n=r;break a}if(r=n&&n.length>=m){b:{r=Math.min(w.length,n.length);for(var H=0;H<r;H+=1)if(w[H]!==n[H]){r=H;break b}}r=r>=m-1}if(r)break;m--}B++}n=lb}return n}function Ob(g){var m=g._a;return m&&-2===u(g).overflow&&(m=0>m[Ga]||11<m[Ga]?Ga:1>m[Ea]||m[Ea]>Oa(m[sa],m[Ga])?Ea:0>m[la]||24<m[la]||24===m[la]&&(0!==m[za]||0!==m[Ha]||0!==m[Ua])?la:0>m[za]||59<m[za]?za:0>m[Ha]||59<m[Ha]?Ha:0>m[Ua]||999<
m[Ua]?Ua:-1,u(g)._overflowDayOfYear&&(m<sa||Ea<m)&&(m=Ea),u(g)._overflowWeeks&&-1===m&&(m=zc),u(g)._overflowWeekday&&-1===m&&(m=Ac),u(g).overflow=m),g}function dc(g){var m;var n=g._i;var r=Bc.exec(n)||Cc.exec(n);n=vb.length;var w=Pb.length;if(r){u(g).iso=!0;for(m=0;m<n;m++)if(vb[m][1].exec(r[1])){var B=vb[m][0];var H=!1!==vb[m][2];break}if(null==B)g._isValid=!1;else{if(r[3]){m=0;for(n=w;m<n;m++)if(Pb[m][1].exec(r[3])){var M=(r[2]||" ")+Pb[m][0];break}if(null==M)return void(g._isValid=!1)}if(H||null==
M){if(r[4]){if(!Dc.exec(r[4]))return void(g._isValid=!1);var Y="Z"}g._f=B+(M||"")+(Y||"");Qb(g)}else g._isValid=!1}}else g._isValid=!1}function ec(g){var m=Ec.exec(g._i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(m){var n=m[4];var r=m[3];var w=m[2];var B=m[5];var H=m[6];var M=m[7];n=parseInt(n,10);n=[49>=n?2E3+n:999>=n?1900+n:n,fc.indexOf(r),parseInt(w,10),parseInt(B,10),parseInt(H,10)];H=(M&&n.push(parseInt(M,10)),n);r=m[1];w=H;B=g;r&&gc.indexOf(r)!==
(new Date(w[0],w[1],w[2])).getDay()?(u(B).weekdayMismatch=!0,B._isValid=!1):(g._a=H,g._tzm=(r=m[8],w=m[9],B=m[10],r?Fc[r]:w?0:60*(((r=parseInt(B,10))-(w=r%100))/100)+w),g._d=D.apply(null,g._a),g._d.setUTCMinutes(g._d.getUTCMinutes()-g._tzm),u(g).rfc2822=!0)}else g._isValid=!1}function $a(g,m,n){return null!=g?g:null!=m?m:n}function Rb(g){var m,n,r,w,B,H,M,Y=[];if(!g._d){var T=g;var S=new Date(a.now());var ua=T._useUTC?[S.getUTCFullYear(),S.getUTCMonth(),S.getUTCDate()]:[S.getFullYear(),S.getMonth(),
S.getDate()];g._w&&null==g._a[Ea]&&null==g._a[Ga]&&(null!=(S=(T=g)._w).GG||null!=S.W||null!=S.E?(w=1,B=4,m=$a(S.GG,T._a[sa],N(ha(),1,4).year),n=$a(S.W,1),(1>(r=$a(S.E,1))||7<r)&&(H=!0)):(w=T._locale._week.dow,B=T._locale._week.doy,M=N(ha(),w,B),m=$a(S.gg,T._a[sa],M.year),n=$a(S.w,M.week),null!=S.d?(0>(r=S.d)||6<r)&&(H=!0):null!=S.e?(r=S.e+w,(0>S.e||6<S.e)&&(H=!0)):r=w),1>n||n>P(m,w,B)?u(T)._overflowWeeks=!0:null!=H?u(T)._overflowWeekday=!0:(M=U(m,n,r,w,B),T._a[sa]=M.year,T._dayOfYear=M.dayOfYear));
null!=g._dayOfYear&&(S=$a(g._a[sa],ua[sa]),(g._dayOfYear>(da(S)?366:365)||0===g._dayOfYear)&&(u(g)._overflowDayOfYear=!0),H=D(S,0,g._dayOfYear),g._a[Ga]=H.getUTCMonth(),g._a[Ea]=H.getUTCDate());for(T=0;3>T&&null==g._a[T];++T)g._a[T]=Y[T]=ua[T];for(;7>T;T++)g._a[T]=Y[T]=null==g._a[T]?2===T?1:0:g._a[T];24===g._a[la]&&0===g._a[za]&&0===g._a[Ha]&&0===g._a[Ua]&&(g._nextDay=!0,g._a[la]=0);g._d=(g._useUTC?D:z).apply(null,Y);m=g._useUTC?g._d.getUTCDay():g._d.getDay();null!=g._tzm&&g._d.setUTCMinutes(g._d.getUTCMinutes()-
g._tzm);g._nextDay&&(g._a[la]=24);g._w&&void 0!==g._w.d&&g._w.d!==m&&(u(g).weekdayMismatch=!0)}}function Qb(g){if(g._f===a.ISO_8601)dc(g);else if(g._f===a.RFC_2822)ec(g);else{g._a=[];u(g).empty=!0;for(var m,n,r,w,B,H=""+g._i,M=H.length,Y=0,T=ib(g._f,g._locale).match(Kb)||[],S=T.length,ua=0;ua<S;ua++)n=T[ua],(m=(H.match(Hb(n,g))||[])[0])&&(0<(r=H.substr(0,H.indexOf(m))).length&&u(g).unusedInput.push(r),H=H.slice(H.indexOf(m)+m.length),Y+=m.length),Za[n]?(m?u(g).empty=!1:u(g).unusedTokens.push(n),r=
n,B=g,null!=(w=m)&&d(Mb,r)&&Mb[r](w,B._a,B,r)):g._strict&&!m&&u(g).unusedTokens.push(n);u(g).charsLeftOver=M-Y;0<H.length&&u(g).unusedInput.push(H);12>=g._a[la]&&!0===u(g).bigHour&&0<g._a[la]&&(u(g).bigHour=void 0);u(g).parsedDateParts=g._a.slice(0);u(g).meridiem=g._meridiem;m=g._a;n=la;r=g._locale;w=g._a[la];B=g._meridiem;B=null==B?w:null!=r.meridiemHour?r.meridiemHour(w,B):null!=r.isPM?((r=r.isPM(B))&&12>w&&(w+=12),r||12!==w?w:0):w;m[n]=B;null!==(M=u(g).era)&&(g._a[sa]=g._locale.erasConvertYear(M,
g._a[sa]));Rb(g);Ob(g)}}function hc(g){var m,n,r,w=g._i,B=g._f;if(g._locale=g._locale||Fa(g._l),null===w||void 0===B&&""===w)return E({nullInput:!0});if("string"==typeof w&&(g._i=w=g._locale.preparse(w)),G(w))return new K(Ob(w));l(w)?g._d=w:b(B)?!function(H){var M,Y,T,S=!1,ua=H._f.length;if(0===ua)return u(H).invalidFormat=!0,H._d=new Date(NaN);for(T=0;T<ua;T++){var Aa=0;var nb=!1;var xa=F({},H);null!=H._useUTC&&(xa._useUTC=H._useUTC);xa._f=H._f[T];Qb(xa);C(xa)&&(nb=!0);Aa=(Aa+=u(xa).charsLeftOver)+
10*u(xa).unusedTokens.length;u(xa).score=Aa;S?Aa<Y&&(Y=Aa,M=xa):(null==Y||Aa<Y||nb)&&(Y=Aa,M=xa,nb&&(S=!0))}q(H,M||xa)}(g):B?Qb(g):k(B=(w=g)._i)?w._d=new Date(a.now()):l(B)?w._d=new Date(B.valueOf()):"string"==typeof B?(n=w,null!==(m=Gc.exec(n._i))?n._d=new Date(+m[1]):(dc(n),!1===n._isValid&&(delete n._isValid,ec(n),!1===n._isValid&&(delete n._isValid,n._strict?n._isValid=!1:a.createFromInputFallback(n))))):b(B)?(w._a=p(B.slice(0),function(H){return parseInt(H,10)}),Rb(w)):c(B)?(m=w)._d||(r=void 0===
(n=hb(m._i)).day?n.date:n.day,m._a=p([n.year,n.month,r,n.hour,n.minute,n.second,n.millisecond],function(H){return H&&parseInt(H,10)}),Rb(m)):h(B)?w._d=new Date(B):a.createFromInputFallback(w);return C(g)||(g._d=null),g}function $b(g,m,n,r,w){var B={};return!0!==m&&!1!==m||(r=m,m=void 0),!0!==n&&!1!==n||(r=n,n=void 0),(c(g)&&f(g)||b(g)&&0===g.length)&&(g=void 0),B._isAMomentObject=!0,B._useUTC=B._isUTC=w,B._l=n,B._i=g,B._f=m,B._strict=r,(w=new K(Ob(hc(w=B))))._nextDay&&(w.add(1,"d"),w._nextDay=void 0),
w}function ha(g,m,n,r){return $b(g,m,n,r,!1)}function ic(g,m){var n;if(!(m=1===m.length&&b(m[0])?m[0]:m).length)return ha();var r=m[0];for(n=1;n<m.length;++n)m[n].isValid()&&!m[n][g](r)||(r=m[n]);return r}function wb(g){g=hb(g);var m=g.year||0,n=g.quarter||0,r=g.month||0,w=g.week||g.isoWeek||0,B=g.day||0,H=g.hour||0,M=g.minute||0,Y=g.second||0,T=g.millisecond||0;a:{var S,ua=!1,Aa=ob.length;for(S in g)if(d(g,S)&&(-1===ma.call(ob,S)||null!=g[S]&&isNaN(g[S]))){g=!1;break a}for(S=0;S<Aa;++S)if(g[ob[S]]){if(ua){g=
!1;break a}parseFloat(g[ob[S]])!==X(g[ob[S]])&&(ua=!0)}g=!0}this._isValid=g;this._milliseconds=+T+1E3*Y+6E4*M+36E5*H;this._days=+B+7*w;this._months=+r+3*n+12*m;this._data={};this._locale=Fa();this._bubble()}function xb(g){return g instanceof wb}function Sb(g){return 0>g?-1*Math.round(-1*g):Math.round(g)}function jc(g,m){R(g,0,0,function(){var n=this.utcOffset(),r="+";return 0>n&&(n=-n,r="-"),r+ta(~~(n/60),2)+m+ta(~~n%60,2)})}function Tb(g,m){m=(m||"").match(g);return null===m?null:0===(m=60*(g=((m[m.length-
1]||[])+"").match(Hc)||["-",0,0])[1]+X(g[2]))?0:"+"===g[0]?m:-m}function Ub(g,m){var n;return m._isUTC?(m=m.clone(),n=(G(g)||l(g)?g:ha(g)).valueOf()-m.valueOf(),m._d.setTime(m._d.valueOf()+n),a.updateOffset(m,!1),m):ha(g).local()}function kc(){return!!this.isValid()&&this._isUTC&&0===this._offset}function Ba(g,m){var n=g,r=null;if(xb(g))n={ms:g._milliseconds,d:g._days,M:g._months};else if(h(g)||!isNaN(+g))n={},m?n[m]=+g:n.milliseconds=+g;else if(r=Ic.exec(g)){var w="-"===r[1]?-1:1;n={y:0,d:X(r[Ea])*
w,h:X(r[la])*w,m:X(r[za])*w,s:X(r[Ha])*w,ms:X(Sb(1E3*r[Ua]))*w}}else if(r=Jc.exec(g))w="-"===r[1]?-1:1,n={y:Va(r[2],w),M:Va(r[3],w),w:Va(r[4],w),d:Va(r[5],w),h:Va(r[6],w),m:Va(r[7],w),s:Va(r[8],w)};else if(null==n)n={};else if("object"==typeof n&&("from"in n||"to"in n)){var B;w=ha(n.from);var H=ha(n.to);w.isValid()&&H.isValid()?(H=Ub(H,w),w.isBefore(H)?B=lc(w,H):((B=lc(H,w)).milliseconds=-B.milliseconds,B.months=-B.months)):B={milliseconds:0,months:0};m=B;(n={}).ms=m.milliseconds;n.M=m.months}return r=
new wb(n),xb(g)&&d(g,"_locale")&&(r._locale=g._locale),xb(g)&&d(g,"_isValid")&&(r._isValid=g._isValid),r}function Va(g,m){g=g&&parseFloat(g.replace(",","."));return(isNaN(g)?0:g)*m}function lc(g,m){var n={};return n.months=m.month()-g.month()+12*(m.year()-g.year()),g.clone().add(n.months,"M").isAfter(m)&&--n.months,n.milliseconds=+m-+g.clone().add(n.months,"M"),n}function mc(g,m){return function(n,r){var w;return null===r||isNaN(+r)||(W(m,"moment()."+m+"(period, number) is deprecated. Please use moment()."+
m+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),w=n,n=r,r=w),nc(this,Ba(n,r),g),this}}function nc(g,m,n,r){var w=m._milliseconds,B=Sb(m._days);m=Sb(m._months);g.isValid()&&(r=null==r||r,m&&Na(g,Ma(g,"Month")+m*n),B&&sb(g,"Date",Ma(g,"Date")+B*n),w&&g._d.setTime(g._d.valueOf()+w*n),r&&a.updateOffset(g,B||m))}function Kc(g){return G(g)||l(g)||"string"==typeof g||g instanceof String||h(g)||function(m){var n=b(m),r=!1;n&&(r=0===m.filter(function(w){return!h(w)&&
("string"==typeof m||m instanceof String)}).length);return n&&r}(g)||function(m){var n,r=c(m)&&!f(m),w=!1,B="years year y months month M days day d dates date D hours hour h minutes minute m seconds second s milliseconds millisecond ms".split(" "),H=B.length;for(n=0;n<H;n+=1){var M=B[n];w=w||d(m,M)}return r&&w}(g)||null==g}function yb(g,m){if(g.date()<m.date())return-yb(m,g);var n=12*(m.year()-g.year())+(m.month()-g.month()),r=g.clone().add(n,"months");m=0>m-r?(m-r)/(r-g.clone().add(n-1,"months")):
(m-r)/(g.clone().add(1+n,"months")-r);return-(n+m)||0}function oc(g){return void 0===g?this._locale._abbr:(null!=(g=Fa(g))&&(this._locale=g),this)}function pc(){return this._locale}function ab(g,m){return(g%m+m)%m}function qc(g,m,n){return 100>g&&0<=g?new Date(g+400,m,n)-126227808E5:(new Date(g,m,n)).valueOf()}function rc(g,m,n){return 100>g&&0<=g?Date.UTC(g+400,m,n)-126227808E5:Date.UTC(g,m,n)}function Vb(g,m){return m.erasAbbrRegex(g)}function Wb(){for(var g=[],m=[],n=[],r=[],w=this.eras(),B=0,
H=w.length;B<H;++B)m.push(ra(w[B].name)),g.push(ra(w[B].abbr)),n.push(ra(w[B].narrow)),r.push(ra(w[B].name)),r.push(ra(w[B].abbr)),r.push(ra(w[B].narrow));this._erasRegex=new RegExp("^("+r.join("|")+")","i");this._erasNameRegex=new RegExp("^("+m.join("|")+")","i");this._erasAbbrRegex=new RegExp("^("+g.join("|")+")","i");this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}function zb(g,m){R(0,[g,g.length],0,m)}function sc(g,m,n,r,w){if(null==g)g=N(this,r,w).year;else{var B=P(g,r,w);g=U(g,B<
m?B:m,n,r,w);g=D(g.year,0,g.dayOfYear);g=(this.year(g.getUTCFullYear()),this.month(g.getUTCMonth()),this.date(g.getUTCDate()),this)}return g}function Lc(g,m){m[Ua]=X(1E3*("0."+g))}function tc(g){return g}function Ab(g,m,n,r){var w=Fa();r=t().set(r,m);return w[n](r,g)}function uc(g,m,n){if(h(g)&&(m=g,g=void 0),g=g||"",null!=m)return Ab(g,m,n,"month");m=[];for(var r=0;12>r;r++)m[r]=Ab(g,r,n,"month");return m}function Xb(g,m,n,r){m=("boolean"==typeof g?h(m)&&(n=m,m=void 0):(m=g,g=!1,h(n=m)&&(n=m,m=void 0)),
m||"");var w=Fa();g=g?w._week.dow:0;w=[];if(null!=n)return Ab(m,(n+g)%7,r,"day");for(n=0;7>n;n++)w[n]=Ab(m,(n+g)%7,r,"day");return w}function vc(g,m,n,r){m=Ba(m,n);return g._milliseconds+=r*m._milliseconds,g._days+=r*m._days,g._months+=r*m._months,g._bubble()}function wc(g){return 0>g?Math.floor(g):Math.ceil(g)}function Ia(g){return function(){return this.as(g)}}function Wa(g){return function(){return this.isValid()?this._data[g]:NaN}}function Mc(g,m,n,r){var w=Ba(g).abs(),B=Ja(w.as("s")),H=Ja(w.as("m")),
M=Ja(w.as("h")),Y=Ja(w.as("d")),T=Ja(w.as("M")),S=Ja(w.as("w"));w=Ja(w.as("y"));B=(B<=n.ss?["s",B]:B<n.s&&["ss",B])||1>=H&&["m"]||H<n.m&&["mm",H]||1>=M&&["h"]||M<n.h&&["hh",M]||1>=Y&&["d"]||Y<n.d&&["dd",Y];return(B=(B=null!=n.w?B||1>=S&&["w"]||S<n.w&&["ww",S]:B)||1>=T&&["M"]||T<n.M&&["MM",T]||1>=w&&["y"]||["yy",w])[2]=m,B[3]=0<+g,B[4]=r,function(ua,Aa,nb,xa,Nc){return Nc.relativeTime(Aa||1,!!nb,ua,xa)}.apply(null,B)}function bb(g){return(0<g)-(0>g)||+g}function Bb(){if(!this.isValid())return this.localeData().invalidDate();
var g,m,n,r,w,B,H,M=Yb(this._milliseconds)/1E3,Y=Yb(this._days),T=Yb(this._months),S=this.asSeconds();return S?(g=na(M/60),m=na(g/60),M%=60,g%=60,n=na(T/12),T%=12,r=M?M.toFixed(3).replace(/\.?0+$/,""):"",w=bb(this._months)!==bb(S)?"-":"",B=bb(this._days)!==bb(S)?"-":"",H=bb(this._milliseconds)!==bb(S)?"-":"",(0>S?"-":"")+"P"+(n?w+n+"Y":"")+(T?w+T+"M":"")+(Y?B+Y+"D":"")+(m||g||M?"T":"")+(m?H+m+"H":"")+(g?H+g+"M":"")+(M?H+r+"S":"")):"P0D"}var Zb,yc=Array.prototype.some||function(g){for(var m=Object(this),
n=m.length>>>0,r=0;r<n;r++)if(r in m&&g.call(this,m[r],r,m))return!0;return!1},ac=a.momentProperties=[],Ib=!1,bc={};a.suppressDeprecationWarnings=!1;a.deprecationHandler=null;var Oc=Object.keys||function(g){var m,n=[];for(m in g)d(g,m)&&n.push(m);return n},Kb=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,tb=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
Jb={},Za={},kb={},qa={},I=/\d/,V=/\d\d/,Cb=/\d{3}/,Xa=/\d{4}/,Qa=/[+-]?\d{6}/,ia=/\d\d?/,cb=/\d\d\d\d?/,db=/\d\d\d\d\d\d?/,eb=/\d{1,3}/,Ra=/\d{1,4}/,Sa=/[+-]?\d{1,6}/,fb=/\d+/,Db=/[+-]?\d+/,Pc=/Z|[+-]\d\d:?\d\d/gi,Eb=/Z|[+-]\d\d(?::?\d\d)?/gi,Ka=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Lb={},Mb={},sa=0,Ga=1,Ea=2,la=3,za=4,Ha=5,Ua=6,zc=7,Ac=8;var ma=Array.prototype.indexOf||function(g){for(var m=
0;m<this.length;++m)if(this[m]===g)return m;return-1};R("M",["MM",2],"Mo",function(){return this.month()+1});R("MMM",0,0,function(g){return this.localeData().monthsShort(this,g)});R("MMMM",0,0,function(g){return this.localeData().months(this,g)});ka("month","M");qa.month=8;L("M",ia);L("MM",ia,V);L("MMM",function(g,m){return m.monthsShortRegex(g)});L("MMMM",function(g,m){return m.monthsRegex(g)});ba(["M","MM"],function(g,m){m[Ga]=X(g)-1});ba(["MMM","MMMM"],function(g,m,n,r){r=n._locale.monthsParse(g,
r,n._strict);null!=r?m[Ga]=r:u(n).invalidMonth=g});var pb="January February March April May June July August September October November December".split(" "),fc="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),xc=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Qc=Ka,Rc=Ka;R("Y",0,0,function(){var g=this.year();return 9999>=g?ta(g,4):"+"+g});R(0,["YY",2],0,function(){return this.year()%100});R(0,["YYYY",4],0,"year");R(0,["YYYYY",5],0,"year");R(0,["YYYYYY",6,!0],0,"year");ka("year","y");qa.year=1;L("Y",
Db);L("YY",ia,V);L("YYYY",Ra,Xa);L("YYYYY",Sa,Qa);L("YYYYYY",Sa,Qa);ba(["YYYYY","YYYYYY"],sa);ba("YYYY",function(g,m){m[sa]=2===g.length?a.parseTwoDigitYear(g):X(g)});ba("YY",function(g,m){m[sa]=a.parseTwoDigitYear(g)});ba("Y",function(g,m){m[sa]=parseInt(g,10)});a.parseTwoDigitYear=function(g){return X(g)+(68<X(g)?1900:2E3)};var Fb=Da("FullYear",!0);R("w",["ww",2],"wo","week");R("W",["WW",2],"Wo","isoWeek");ka("week","w");ka("isoWeek","W");qa.week=5;qa.isoWeek=5;L("w",ia);L("ww",ia,V);L("W",ia);
L("WW",ia,V);ya(["w","ww","W","WW"],function(g,m,n,r){m[r.substr(0,1)]=X(g)});R("d",0,"do","day");R("dd",0,0,function(g){return this.localeData().weekdaysMin(this,g)});R("ddd",0,0,function(g){return this.localeData().weekdaysShort(this,g)});R("dddd",0,0,function(g){return this.localeData().weekdays(this,g)});R("e",0,0,"weekday");R("E",0,0,"isoWeekday");ka("day","d");ka("weekday","e");ka("isoWeekday","E");qa.day=11;qa.weekday=11;qa.isoWeekday=11;L("d",ia);L("e",ia);L("E",ia);L("dd",function(g,m){return m.weekdaysMinRegex(g)});
L("ddd",function(g,m){return m.weekdaysShortRegex(g)});L("dddd",function(g,m){return m.weekdaysRegex(g)});ya(["dd","ddd","dddd"],function(g,m,n,r){r=n._locale.weekdaysParse(g,r,n._strict);null!=r?m.d=r:u(n).invalidWeekday=g});ya(["d","e","E"],function(g,m,n,r){m[r]=X(g)});var qb="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),gc="Sun Mon Tue Wed Thu Fri Sat".split(" "),Gb="Su Mo Tu We Th Fr Sa".split(" "),Sc=Ka,Tc=Ka,Uc=Ka;R("H",["HH",2],0,"hour");R("h",["hh",2],0,oa);R("k",
["kk",2],0,function(){return this.hours()||24});R("hmm",0,0,function(){return""+oa.apply(this)+ta(this.minutes(),2)});R("hmmss",0,0,function(){return""+oa.apply(this)+ta(this.minutes(),2)+ta(this.seconds(),2)});R("Hmm",0,0,function(){return""+this.hours()+ta(this.minutes(),2)});R("Hmmss",0,0,function(){return""+this.hours()+ta(this.minutes(),2)+ta(this.seconds(),2)});va("a",!0);va("A",!1);ka("hour","h");qa.hour=13;L("a",wa);L("A",wa);L("H",ia);L("h",ia);L("k",ia);L("HH",ia,V);L("hh",ia,V);L("kk",
ia,V);L("hmm",cb);L("hmmss",db);L("Hmm",cb);L("Hmmss",db);ba(["H","HH"],la);ba(["k","kk"],function(g,m,n){g=X(g);m[la]=24===g?0:g});ba(["a","A"],function(g,m,n){n._isPm=n._locale.isPM(g);n._meridiem=g});ba(["h","hh"],function(g,m,n){m[la]=X(g);u(n).bigHour=!0});ba("hmm",function(g,m,n){var r=g.length-2;m[la]=X(g.substr(0,r));m[za]=X(g.substr(r));u(n).bigHour=!0});ba("hmmss",function(g,m,n){var r=g.length-4,w=g.length-2;m[la]=X(g.substr(0,r));m[za]=X(g.substr(r,2));m[Ha]=X(g.substr(w));u(n).bigHour=
!0});ba("Hmm",function(g,m,n){n=g.length-2;m[la]=X(g.substr(0,n));m[za]=X(g.substr(n))});ba("Hmmss",function(g,m,n){n=g.length-4;var r=g.length-2;m[la]=X(g.substr(0,n));m[za]=X(g.substr(n,2));m[Ha]=X(g.substr(r))});Ka=Da("Hours",!0);var lb,cc={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",
LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:pb,monthsShort:fc,week:{dow:0,doy:6},weekdays:qb,weekdaysMin:Gb,weekdaysShort:gc,meridiemParse:/[ap]\.?m?\.?/i},ja={},mb={},Bc=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
Cc=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Dc=/Z|[+-]\d\d(?::?\d\d)?/,vb=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",
/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Pb=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Gc=/^\/?Date\((-?\d+)/i,Ec=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,
Fc={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};a.createFromInputFallback=O("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(g){g._d=new Date(g._i+(g._useUTC?" UTC":""))});a.ISO_8601=function(){};a.RFC_2822=function(){};
cb=O("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var g=ha.apply(null,arguments);return this.isValid()&&g.isValid()?g<this?this:g:E()});db=O("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var g=ha.apply(null,arguments);return this.isValid()&&g.isValid()?this<g?this:g:E()});var ob="year quarter month week day hour minute second millisecond".split(" ");jc("Z",":");jc("ZZ",
"");L("Z",Eb);L("ZZ",Eb);ba(["Z","ZZ"],function(g,m,n){n._useUTC=!0;n._tzm=Tb(Eb,g)});var Hc=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var Ic=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Jc=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;Ba.fn=wb.prototype;Ba.invalid=function(){return Ba(NaN)};pb=mc(1,"add");qb=mc(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";
a.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";Gb=O("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(g){return void 0===g?this.localeData():this.locale(g)});R("N",0,0,"eraAbbr");R("NN",0,0,"eraAbbr");R("NNN",0,0,"eraAbbr");R("NNNN",0,0,"eraName");R("NNNNN",0,0,"eraNarrow");R("y",["y",1],"yo","eraYear");R("y",["yy",2],0,"eraYear");R("y",["yyy",3],0,"eraYear");R("y",["yyyy",4],0,"eraYear");L("N",Vb);
L("NN",Vb);L("NNN",Vb);L("NNNN",function(g,m){return m.erasNameRegex(g)});L("NNNNN",function(g,m){return m.erasNarrowRegex(g)});ba(["N","NN","NNN","NNNN","NNNNN"],function(g,m,n,r){(r=n._locale.erasParse(g,r,n._strict))?u(n).era=r:u(n).invalidEra=g});L("y",fb);L("yy",fb);L("yyy",fb);L("yyyy",fb);L("yo",function(g,m){return m._eraYearOrdinalRegex||fb});ba(["y","yy","yyy","yyyy"],sa);ba(["yo"],function(g,m,n,r){var w;n._locale._eraYearOrdinalRegex&&(w=g.match(n._locale._eraYearOrdinalRegex));n._locale.eraYearOrdinalParse?
m[sa]=n._locale.eraYearOrdinalParse(g,w):m[sa]=parseInt(g,10)});R(0,["gg",2],0,function(){return this.weekYear()%100});R(0,["GG",2],0,function(){return this.isoWeekYear()%100});zb("gggg","weekYear");zb("ggggg","weekYear");zb("GGGG","isoWeekYear");zb("GGGGG","isoWeekYear");ka("weekYear","gg");ka("isoWeekYear","GG");qa.weekYear=1;qa.isoWeekYear=1;L("G",Db);L("g",Db);L("GG",ia,V);L("gg",ia,V);L("GGGG",Ra,Xa);L("gggg",Ra,Xa);L("GGGGG",Sa,Qa);L("ggggg",Sa,Qa);ya(["gggg","ggggg","GGGG","GGGGG"],function(g,
m,n,r){m[r.substr(0,2)]=X(g)});ya(["gg","GG"],function(g,m,n,r){m[r]=a.parseTwoDigitYear(g)});R("Q",0,"Qo","quarter");ka("quarter","Q");qa.quarter=7;L("Q",I);ba("Q",function(g,m){m[Ga]=3*(X(g)-1)});R("D",["DD",2],"Do","date");ka("date","D");qa.date=9;L("D",ia);L("DD",ia,V);L("Do",function(g,m){return g?m._dayOfMonthOrdinalParse||m._ordinalParse:m._dayOfMonthOrdinalParseLenient});ba(["D","DD"],Ea);ba("Do",function(g,m){m[Ea]=X(g.match(ia)[0])});Ra=Da("Date",!0);R("DDD",["DDDD",3],"DDDo","dayOfYear");
ka("dayOfYear","DDD");qa.dayOfYear=4;L("DDD",eb);L("DDDD",Cb);ba(["DDD","DDDD"],function(g,m,n){n._dayOfYear=X(g)});R("m",["mm",2],0,"minute");ka("minute","m");qa.minute=14;L("m",ia);L("mm",ia,V);ba(["m","mm"],za);var Ta;Xa=Da("Minutes",!1);R("s",["ss",2],0,"second");ka("second","s");qa.second=15;Sa=(L("s",ia),L("ss",ia,V),ba(["s","ss"],Ha),Da("Seconds",!1));R("S",0,0,function(){return~~(this.millisecond()/100)});R(0,["SS",2],0,function(){return~~(this.millisecond()/10)});R(0,["SSS",3],0,"millisecond");
R(0,["SSSS",4],0,function(){return 10*this.millisecond()});R(0,["SSSSS",5],0,function(){return 100*this.millisecond()});R(0,["SSSSSS",6],0,function(){return 1E3*this.millisecond()});R(0,["SSSSSSS",7],0,function(){return 1E4*this.millisecond()});R(0,["SSSSSSSS",8],0,function(){return 1E5*this.millisecond()});R(0,["SSSSSSSSS",9],0,function(){return 1E6*this.millisecond()});ka("millisecond","ms");qa.millisecond=16;L("S",eb,I);L("SS",eb,V);L("SSS",eb,Cb);for(Ta="SSSS";9>=Ta.length;Ta+="S")L(Ta,fb);for(Ta=
"S";9>=Ta.length;Ta+="S")ba(Ta,Lc);Qa=Da("Milliseconds",!1);R("z",0,0,"zoneAbbr");R("zz",0,0,"zoneName");I=K.prototype;I.add=pb;I.calendar=function(g,m){if(1===arguments.length)if(arguments[0])if(Kc(arguments[0]))g=arguments[0],m=void 0;else{for(var n=arguments[0],r=c(n)&&!f(n),w=!1,B="sameDay nextDay lastDay nextWeek lastWeek sameElse".split(" "),H=0;H<B.length;H+=1)w=w||d(n,B[H]);r&&w&&(m=arguments[0],g=void 0)}else m=g=void 0;g=g||ha();n=Ub(g,this).startOf("day");n=a.calendarFormat(this,n)||"sameElse";
m=m&&(Z(m[n])?m[n].call(this,g):m[n]);return this.format(m||this.localeData().calendar(n,this,ha(g)))};I.clone=function(){return new K(this)};I.diff=function(g,m,n){var r;if(!this.isValid()||!(r=Ub(g,this)).isValid())return NaN;switch(g=6E4*(r.utcOffset()-this.utcOffset()),pa(m)){case "year":m=yb(this,r)/12;break;case "month":m=yb(this,r);break;case "quarter":m=yb(this,r)/3;break;case "second":m=(this-r)/1E3;break;case "minute":m=(this-r)/6E4;break;case "hour":m=(this-r)/36E5;break;case "day":m=(this-
r-g)/864E5;break;case "week":m=(this-r-g)/6048E5;break;default:m=this-r}return n?m:na(m)};I.endOf=function(g){var m;if(void 0===(g=pa(g))||"millisecond"===g||!this.isValid())return this;switch(m=this._isUTC?rc:qc,g){case "year":var n=m(this.year()+1,0,1)-1;break;case "quarter":n=m(this.year(),this.month()-this.month()%3+3,1)-1;break;case "month":n=m(this.year(),this.month()+1,1)-1;break;case "week":n=m(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case "isoWeek":n=m(this.year(),this.month(),
this.date()-(this.isoWeekday()-1)+7)-1;break;case "day":case "date":n=m(this.year(),this.month(),this.date()+1)-1;break;case "hour":n=this._d.valueOf();n+=36E5-ab(n+(this._isUTC?0:6E4*this.utcOffset()),36E5)-1;break;case "minute":n=this._d.valueOf();n+=6E4-ab(n,6E4)-1;break;case "second":n=this._d.valueOf(),n+=1E3-ab(n,1E3)-1}return this._d.setTime(n),a.updateOffset(this,!0),this};I.format=function(g){return g=g||(this.isUtc()?a.defaultFormatUtc:a.defaultFormat),g=Ya(this,g),this.localeData().postformat(g)};
I.from=function(g,m){return this.isValid()&&(G(g)&&g.isValid()||ha(g).isValid())?Ba({to:this,from:g}).locale(this.locale()).humanize(!m):this.localeData().invalidDate()};I.fromNow=function(g){return this.from(ha(),g)};I.to=function(g,m){return this.isValid()&&(G(g)&&g.isValid()||ha(g).isValid())?Ba({from:this,to:g}).locale(this.locale()).humanize(!m):this.localeData().invalidDate()};I.toNow=function(g){return this.to(ha(),g)};I.get=function(g){return Z(this[g=pa(g)])?this[g]():this};I.invalidAt=function(){return u(this).overflow};
I.isAfter=function(g,m){return g=G(g)?g:ha(g),!(!this.isValid()||!g.isValid())&&("millisecond"===(m=pa(m)||"millisecond")?this.valueOf()>g.valueOf():g.valueOf()<this.clone().startOf(m).valueOf())};I.isBefore=function(g,m){return g=G(g)?g:ha(g),!(!this.isValid()||!g.isValid())&&("millisecond"===(m=pa(m)||"millisecond")?this.valueOf()<g.valueOf():this.clone().endOf(m).valueOf()<g.valueOf())};I.isBetween=function(g,m,n,r){return g=G(g)?g:ha(g),m=G(m)?m:ha(m),!!(this.isValid()&&g.isValid()&&m.isValid())&&
("("===(r=r||"()")[0]?this.isAfter(g,n):!this.isBefore(g,n))&&(")"===r[1]?this.isBefore(m,n):!this.isAfter(m,n))};I.isSame=function(g,m){g=G(g)?g:ha(g);return!(!this.isValid()||!g.isValid())&&("millisecond"===(m=pa(m)||"millisecond")?this.valueOf()===g.valueOf():(g=g.valueOf(),this.clone().startOf(m).valueOf()<=g&&g<=this.clone().endOf(m).valueOf()))};I.isSameOrAfter=function(g,m){return this.isSame(g,m)||this.isAfter(g,m)};I.isSameOrBefore=function(g,m){return this.isSame(g,m)||this.isBefore(g,m)};
I.isValid=function(){return C(this)};I.lang=Gb;I.locale=oc;I.localeData=pc;I.max=db;I.min=cb;I.parsingFlags=function(){return q({},u(this))};I.set=function(g,m){if("object"==typeof g){m=function(w){var B,H=[];for(B in w)d(w,B)&&H.push({unit:B,priority:qa[B]});return H.sort(function(M,Y){return M.priority-Y.priority}),H}(g=hb(g));for(var n=m.length,r=0;r<n;r++)this[m[r].unit](g[m[r].unit])}else if(Z(this[g=pa(g)]))return this[g](m);return this};I.startOf=function(g){var m;if(void 0===(g=pa(g))||"millisecond"===
g||!this.isValid())return this;switch(m=this._isUTC?rc:qc,g){case "year":var n=m(this.year(),0,1);break;case "quarter":n=m(this.year(),this.month()-this.month()%3,1);break;case "month":n=m(this.year(),this.month(),1);break;case "week":n=m(this.year(),this.month(),this.date()-this.weekday());break;case "isoWeek":n=m(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case "day":case "date":n=m(this.year(),this.month(),this.date());break;case "hour":n=this._d.valueOf();n-=ab(n+(this._isUTC?
0:6E4*this.utcOffset()),36E5);break;case "minute":n=this._d.valueOf();n-=ab(n,6E4);break;case "second":n=this._d.valueOf(),n-=ab(n,1E3)}return this._d.setTime(n),a.updateOffset(this,!0),this};I.subtract=qb;I.toArray=function(){return[this.year(),this.month(),this.date(),this.hour(),this.minute(),this.second(),this.millisecond()]};I.toObject=function(){return{years:this.year(),months:this.month(),date:this.date(),hours:this.hours(),minutes:this.minutes(),seconds:this.seconds(),milliseconds:this.milliseconds()}};
I.toDate=function(){return new Date(this.valueOf())};I.toISOString=function(g){if(!this.isValid())return null;var m=(g=!0!==g)?this.clone().utc():this;return 0>m.year()||9999<m.year()?Ya(m,g?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Z(Date.prototype.toISOString)?g?this.toDate().toISOString():(new Date(this.valueOf()+6E4*this.utcOffset())).toISOString().replace("Z",Ya(m,"Z")):Ya(m,g?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")};I.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+
this._i+" */)";var g,m="moment",n="";return this.isLocal()||(m=0===this.utcOffset()?"moment.utc":"moment.parseZone",n="Z"),m="["+m+'("]',g=0<=this.year()&&9999>=this.year()?"YYYY":"YYYYYY",this.format(m+g+"-MM-DD[T]HH:mm:ss.SSS"+(n+'[")]'))};"undefined"!=typeof Symbol&&null!=Symbol.for&&(I[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment\x3c"+this.format()+"\x3e"});I.toJSON=function(){return this.isValid()?this.toISOString():null};I.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")};
I.unix=function(){return Math.floor(this.valueOf()/1E3)};I.valueOf=function(){return this._d.valueOf()-6E4*(this._offset||0)};I.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}};I.eraName=function(){for(var g,m=this.localeData().eras(),n=0,r=m.length;n<r;++n)if((g=this.clone().startOf("day").valueOf(),m[n].since<=g&&g<=m[n].until)||m[n].until<=g&&g<=m[n].since)return m[n].name;return""};I.eraNarrow=function(){for(var g,m=this.localeData().eras(),
n=0,r=m.length;n<r;++n)if((g=this.clone().startOf("day").valueOf(),m[n].since<=g&&g<=m[n].until)||m[n].until<=g&&g<=m[n].since)return m[n].narrow;return""};I.eraAbbr=function(){for(var g,m=this.localeData().eras(),n=0,r=m.length;n<r;++n)if((g=this.clone().startOf("day").valueOf(),m[n].since<=g&&g<=m[n].until)||m[n].until<=g&&g<=m[n].since)return m[n].abbr;return""};I.eraYear=function(){for(var g,m,n=this.localeData().eras(),r=0,w=n.length;r<w;++r)if(g=n[r].since<=n[r].until?1:-1,m=this.clone().startOf("day").valueOf(),
n[r].since<=m&&m<=n[r].until||n[r].until<=m&&m<=n[r].since)return(this.year()-a(n[r].since).year())*g+n[r].offset;return this.year()};I.year=Fb;I.isLeapYear=function(){return da(this.year())};I.weekYear=function(g){return sc.call(this,g,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)};I.isoWeekYear=function(g){return sc.call(this,g,this.isoWeek(),this.isoWeekday(),1,4)};I.quarter=I.quarters=function(g){return null==g?Math.ceil((this.month()+1)/3):this.month(3*(g-
1)+this.month()%3)};I.month=rb;I.daysInMonth=function(){return Oa(this.year(),this.month())};I.week=I.weeks=function(g){var m=this.localeData().week(this);return null==g?m:this.add(7*(g-m),"d")};I.isoWeek=I.isoWeeks=function(g){var m=N(this,1,4).week;return null==g?m:this.add(7*(g-m),"d")};I.weeksInYear=function(){var g=this.localeData()._week;return P(this.year(),g.dow,g.doy)};I.weeksInWeekYear=function(){var g=this.localeData()._week;return P(this.weekYear(),g.dow,g.doy)};I.isoWeeksInYear=function(){return P(this.year(),
1,4)};I.isoWeeksInISOWeekYear=function(){return P(this.isoWeekYear(),1,4)};I.date=Ra;I.day=I.days=function(g){if(!this.isValid())return null!=g?this:NaN;var m,n,r=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=g?(m=g,n=this.localeData(),g="string"!=typeof m?m:isNaN(m)?"number"==typeof(m=n.weekdaysParse(m))?m:null:parseInt(m,10),this.add(g-r,"d")):r};I.weekday=function(g){if(!this.isValid())return null!=g?this:NaN;var m=(this.day()+7-this.localeData()._week.dow)%7;return null==g?m:this.add(g-
m,"d")};I.isoWeekday=function(g){return this.isValid()?null!=g?(m=g,n=this.localeData(),n="string"==typeof m?n.weekdaysParse(m)%7||7:isNaN(m)?null:m,this.day(this.day()%7?n:n-7)):this.day()||7:null!=g?this:NaN;var m,n};I.dayOfYear=function(g){var m=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864E5)+1;return null==g?m:this.add(g-m,"d")};I.hour=I.hours=Ka;I.minute=I.minutes=Xa;I.second=I.seconds=Sa;I.millisecond=I.milliseconds=Qa;I.utcOffset=function(g,m,n){var r,w=this._offset||
0;if(!this.isValid())return null!=g?this:NaN;if(null==g)return this._isUTC?w:-Math.round(this._d.getTimezoneOffset());if("string"==typeof g){if(null===(g=Tb(Eb,g)))return this}else 16>Math.abs(g)&&!n&&(g*=60);return!this._isUTC&&m&&(r=-Math.round(this._d.getTimezoneOffset())),this._offset=g,this._isUTC=!0,null!=r&&this.add(r,"m"),w!==g&&(!m||this._changeInProgress?nc(this,Ba(g-w,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this};
I.utc=function(g){return this.utcOffset(0,g)};I.local=function(g){return this._isUTC&&(this.utcOffset(0,g),this._isUTC=!1,g&&this.subtract(-Math.round(this._d.getTimezoneOffset()),"m")),this};I.parseZone=function(){var g;return null!=this._tzm?this.utcOffset(this._tzm,!1,!0):"string"==typeof this._i&&(null!=(g=Tb(Pc,this._i))?this.utcOffset(g):this.utcOffset(0,!0)),this};I.hasAlignedHourOffset=function(g){return!!this.isValid()&&(g=g?ha(g).utcOffset():0,0==(this.utcOffset()-g)%60)};I.isDST=function(){return this.utcOffset()>
this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()};I.isLocal=function(){return!!this.isValid()&&!this._isUTC};I.isUtcOffset=function(){return!!this.isValid()&&this._isUTC};I.isUtc=kc;I.isUTC=kc;I.zoneAbbr=function(){return this._isUTC?"UTC":""};I.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""};I.dates=O("dates accessor is deprecated. Use date instead.",Ra);I.months=O("months accessor is deprecated. Use month instead",rb);I.years=O("years accessor is deprecated. Use year instead",
Fb);I.zone=O("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(g,m){return null!=g?(this.utcOffset("string"!=typeof g?-g:g,m),this):-this.utcOffset()});I.isDSTShifted=O("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!k(this._isDSTShifted))return this._isDSTShifted;var g={};F(g,this);if((g=hc(g))._a){var m=(g._isUTC?t:ha)(g._a);var n;if(n=this.isValid()){g=g._a;
m=m.toArray();n=Math.min(g.length,m.length);for(var r=Math.abs(g.length-m.length),w=0,B=0;B<n;B++)X(g[B])!==X(m[B])&&w++;n=0<w+r}this._isDSTShifted=n}else this._isDSTShifted=!1;return this._isDSTShifted});V=Ca.prototype;V.calendar=function(g,m,n){return Z(g=this._calendar[g]||this._calendar.sameElse)?g.call(m,n):g};V.longDateFormat=function(g){var m=this._longDateFormat[g],n=this._longDateFormat[g.toUpperCase()];return m||!n?m:(this._longDateFormat[g]=n.match(Kb).map(function(r){return"MMMM"===r||
"MM"===r||"DD"===r||"dddd"===r?r.slice(1):r}).join(""),this._longDateFormat[g])};V.invalidDate=function(){return this._invalidDate};V.ordinal=function(g){return this._ordinal.replace("%d",g)};V.preparse=tc;V.postformat=tc;V.relativeTime=function(g,m,n,r){var w=this._relativeTime[n];return Z(w)?w(g,m,n,r):w.replace(/%d/i,g)};V.pastFuture=function(g,m){return Z(g=this._relativeTime[0<g?"future":"past"])?g(m):g.replace(/%s/i,m)};V.set=function(g){var m,n;for(n in g)d(g,n)&&(Z(m=g[n])?this[n]=m:this["_"+
n]=m);this._config=g;this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)};V.eras=function(g,m){m=this._eras||Fa("en")._eras;for(var n=0,r=m.length;n<r;++n){switch(typeof m[n].since){case "string":g=a(m[n].since).startOf("day"),m[n].since=g.valueOf()}switch(typeof m[n].until){case "undefined":m[n].until=1/0;break;case "string":g=a(m[n].until).startOf("day").valueOf(),m[n].until=g.valueOf()}}return m};V.erasParse=function(g,
m,n){var r,w,B,H,M=this.eras();g=g.toUpperCase();var Y=0;for(r=M.length;Y<r;++Y)if(w=M[Y].name.toUpperCase(),B=M[Y].abbr.toUpperCase(),H=M[Y].narrow.toUpperCase(),n)switch(m){case "N":case "NN":case "NNN":if(B===g)return M[Y];break;case "NNNN":if(w===g)return M[Y];break;case "NNNNN":if(H===g)return M[Y]}else if(0<=[w,B,H].indexOf(g))return M[Y]};V.erasConvertYear=function(g,m){var n=g.since<=g.until?1:-1;return void 0===m?a(g.since).year():a(g.since).year()+(m-g.offset)*n};V.erasAbbrRegex=function(g){return d(this,
"_erasAbbrRegex")||Wb.call(this),g?this._erasAbbrRegex:this._erasRegex};V.erasNameRegex=function(g){return d(this,"_erasNameRegex")||Wb.call(this),g?this._erasNameRegex:this._erasRegex};V.erasNarrowRegex=function(g){return d(this,"_erasNarrowRegex")||Wb.call(this),g?this._erasNarrowRegex:this._erasRegex};V.months=function(g,m){return g?(b(this._months)?this._months:this._months[(this._months.isFormat||xc).test(m)?"format":"standalone"])[g.month()]:b(this._months)?this._months:this._months.standalone};
V.monthsShort=function(g,m){return g?(b(this._monthsShort)?this._monthsShort:this._monthsShort[xc.test(m)?"format":"standalone"])[g.month()]:b(this._monthsShort)?this._monthsShort:this._monthsShort.standalone};V.monthsParse=function(g,m,n){var r,w;if(this._monthsParseExact){g=g.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],w=0;12>w;++w){var B=t([2E3,w]);this._shortMonthsParse[w]=this.monthsShort(B,"").toLocaleLowerCase();this._longMonthsParse[w]=
this.months(B,"").toLocaleLowerCase()}return n?"MMM"===m?-1!==(r=ma.call(this._shortMonthsParse,g))?r:null:-1!==(r=ma.call(this._longMonthsParse,g))?r:null:"MMM"===m?-1!==(r=ma.call(this._shortMonthsParse,g))||-1!==(r=ma.call(this._longMonthsParse,g))?r:null:-1!==(r=ma.call(this._longMonthsParse,g))||-1!==(r=ma.call(this._shortMonthsParse,g))?r:null}this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]);for(r=0;12>r;r++)if((w=t([2E3,r]),n&&!this._longMonthsParse[r]&&
(this._longMonthsParse[r]=new RegExp("^"+this.months(w,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(w,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(w="^"+this.months(w,"")+"|^"+this.monthsShort(w,""),this._monthsParse[r]=new RegExp(w.replace(".",""),"i")),n&&"MMMM"===m&&this._longMonthsParse[r].test(g))||n&&"MMM"===m&&this._shortMonthsParse[r].test(g)||!n&&this._monthsParse[r].test(g))return r};V.monthsRegex=function(g){return this._monthsParseExact?
(d(this,"_monthsRegex")||v.call(this),g?this._monthsStrictRegex:this._monthsRegex):(d(this,"_monthsRegex")||(this._monthsRegex=Rc),this._monthsStrictRegex&&g?this._monthsStrictRegex:this._monthsRegex)};V.monthsShortRegex=function(g){return this._monthsParseExact?(d(this,"_monthsRegex")||v.call(this),g?this._monthsShortStrictRegex:this._monthsShortRegex):(d(this,"_monthsShortRegex")||(this._monthsShortRegex=Qc),this._monthsShortStrictRegex&&g?this._monthsShortStrictRegex:this._monthsShortRegex)};V.week=
function(g){return N(g,this._week.dow,this._week.doy).week};V.firstDayOfYear=function(){return this._week.doy};V.firstDayOfWeek=function(){return this._week.dow};V.weekdays=function(g,m){return m=b(this._weekdays)?this._weekdays:this._weekdays[g&&!0!==g&&this._weekdays.isFormat.test(m)?"format":"standalone"],!0===g?ea(m,this._week.dow):g?m[g.day()]:m};V.weekdaysMin=function(g){return!0===g?ea(this._weekdaysMin,this._week.dow):g?this._weekdaysMin[g.day()]:this._weekdaysMin};V.weekdaysShort=function(g){return!0===
g?ea(this._weekdaysShort,this._week.dow):g?this._weekdaysShort[g.day()]:this._weekdaysShort};V.weekdaysParse=function(g,m,n){var r,w;if(this._weekdaysParseExact){g=g.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],w=0;7>w;++w){var B=t([2E3,1]).day(w);this._minWeekdaysParse[w]=this.weekdaysMin(B,"").toLocaleLowerCase();this._shortWeekdaysParse[w]=this.weekdaysShort(B,"").toLocaleLowerCase();this._weekdaysParse[w]=this.weekdays(B,
"").toLocaleLowerCase()}return n?"dddd"===m?-1!==(r=ma.call(this._weekdaysParse,g))?r:null:"ddd"===m?-1!==(r=ma.call(this._shortWeekdaysParse,g))?r:null:-1!==(r=ma.call(this._minWeekdaysParse,g))?r:null:"dddd"===m?-1!==(r=ma.call(this._weekdaysParse,g))||-1!==(r=ma.call(this._shortWeekdaysParse,g))||-1!==(r=ma.call(this._minWeekdaysParse,g))?r:null:"ddd"===m?-1!==(r=ma.call(this._shortWeekdaysParse,g))||-1!==(r=ma.call(this._weekdaysParse,g))||-1!==(r=ma.call(this._minWeekdaysParse,g))?r:null:-1!==
(r=ma.call(this._minWeekdaysParse,g))||-1!==(r=ma.call(this._weekdaysParse,g))||-1!==(r=ma.call(this._shortWeekdaysParse,g))?r:null}this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]);for(r=0;7>r;r++)if((w=t([2E3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(w,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(w,"").replace(".",
"\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(w,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(w="^"+this.weekdays(w,"")+"|^"+this.weekdaysShort(w,"")+"|^"+this.weekdaysMin(w,""),this._weekdaysParse[r]=new RegExp(w.replace(".",""),"i")),n&&"dddd"===m&&this._fullWeekdaysParse[r].test(g))||n&&"ddd"===m&&this._shortWeekdaysParse[r].test(g)||n&&"dd"===m&&this._minWeekdaysParse[r].test(g)||!n&&this._weekdaysParse[r].test(g))return r};V.weekdaysRegex=function(g){return this._weekdaysParseExact?
(d(this,"_weekdaysRegex")||aa.call(this),g?this._weekdaysStrictRegex:this._weekdaysRegex):(d(this,"_weekdaysRegex")||(this._weekdaysRegex=Sc),this._weekdaysStrictRegex&&g?this._weekdaysStrictRegex:this._weekdaysRegex)};V.weekdaysShortRegex=function(g){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||aa.call(this),g?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(d(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Tc),this._weekdaysShortStrictRegex&&g?this._weekdaysShortStrictRegex:
this._weekdaysShortRegex)};V.weekdaysMinRegex=function(g){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||aa.call(this),g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(d(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Uc),this._weekdaysMinStrictRegex&&g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)};V.isPM=function(g){return"p"===(g+"").toLowerCase().charAt(0)};V.meridiem=function(g,m,n){return 11<g?n?"pm":"PM":n?"am":"AM"};Pa("en",{eras:[{since:"0001-01-01",until:1/0,
offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(g){var m=g%10;return g+(1===X(g%100/10)?"th":1==m?"st":2==m?"nd":3==m?"rd":"th")}});a.lang=O("moment.lang is deprecated. Use moment.locale instead.",Pa);a.langData=O("moment.langData is deprecated. Use moment.localeData instead.",Fa);var La=Math.abs;eb=Ia("ms");Cb=Ia("s");pb=Ia("m");db=Ia("h");cb=Ia("d");
qb=Ia("w");Ka=Ia("M");Xa=Ia("Q");Sa=Ia("y");Qa=Wa("milliseconds");Ra=Wa("seconds");Fb=Wa("minutes");V=Wa("hours");var Vc=Wa("days"),Wc=Wa("months"),Xc=Wa("years"),Ja=Math.round,gb={ss:44,s:45,m:45,h:22,d:26,w:null,M:11},Yb=Math.abs,ca=wb.prototype;return ca.isValid=function(){return this._isValid},ca.abs=function(){var g=this._data;return this._milliseconds=La(this._milliseconds),this._days=La(this._days),this._months=La(this._months),g.milliseconds=La(g.milliseconds),g.seconds=La(g.seconds),g.minutes=
La(g.minutes),g.hours=La(g.hours),g.months=La(g.months),g.years=La(g.years),this},ca.add=function(g,m){return vc(this,g,m,1)},ca.subtract=function(g,m){return vc(this,g,m,-1)},ca.as=function(g){if(!this.isValid())return NaN;var m;var n=this._milliseconds;if("month"===(g=pa(g))||"quarter"===g||"year"===g)switch(m=this._days+n/864E5,n=this._months+4800*m/146097,g){case "month":return n;case "quarter":return n/3;case "year":return n/12}else switch(m=this._days+Math.round(146097*this._months/4800),g){case "week":return m/
7+n/6048E5;case "day":return m+n/864E5;case "hour":return 24*m+n/36E5;case "minute":return 1440*m+n/6E4;case "second":return 86400*m+n/1E3;case "millisecond":return Math.floor(864E5*m)+n;default:throw Error("Unknown unit "+g);}},ca.asMilliseconds=eb,ca.asSeconds=Cb,ca.asMinutes=pb,ca.asHours=db,ca.asDays=cb,ca.asWeeks=qb,ca.asMonths=Ka,ca.asQuarters=Xa,ca.asYears=Sa,ca.valueOf=function(){return this.isValid()?this._milliseconds+864E5*this._days+this._months%12*2592E6+31536E6*X(this._months/12):NaN},
ca._bubble=function(){var g=this._milliseconds,m=this._days,n=this._months,r=this._data;return 0<=g&&0<=m&&0<=n||0>=g&&0>=m&&0>=n||(g+=864E5*wc(146097*n/4800+m),n=m=0),r.milliseconds=g%1E3,g=na(g/1E3),r.seconds=g%60,g=na(g/60),r.minutes=g%60,g=na(g/60),r.hours=g%24,m+=na(g/24),n+=g=na(4800*m/146097),m-=wc(146097*g/4800),g=na(n/12),n%=12,r.days=m,r.months=n,r.years=g,this},ca.clone=function(){return Ba(this)},ca.get=function(g){return g=pa(g),this.isValid()?this[g+"s"]():NaN},ca.milliseconds=Qa,ca.seconds=
Ra,ca.minutes=Fb,ca.hours=V,ca.days=Vc,ca.weeks=function(){return na(this.days()/7)},ca.months=Wc,ca.years=Xc,ca.humanize=function(g,m){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=gb;return"object"==typeof g&&(m=g,g=!1),"boolean"==typeof g&&(n=g),"object"==typeof m&&(r=Object.assign({},gb,m),null!=m.s&&null==m.ss&&(r.ss=m.s-1)),g=this.localeData(),m=Mc(this,!n,r,g),n&&(m=g.pastFuture(+this,m)),g.postformat(m)},ca.toISOString=Bb,ca.toString=Bb,ca.toJSON=Bb,ca.locale=oc,ca.localeData=
pc,ca.toIsoString=O("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Bb),ca.lang=Gb,R("X",0,0,"unix"),R("x",0,0,"valueOf"),L("x",Db),L("X",/[+-]?\d+(\.\d{1,3})?/),ba("X",function(g,m,n){n._d=new Date(1E3*parseFloat(g))}),ba("x",function(g,m,n){n._d=new Date(X(g))}),a.version="2.29.4",Zb=ha,a.fn=I,a.min=function(){return ic("isBefore",[].slice.call(arguments,0))},a.max=function(){return ic("isAfter",[].slice.call(arguments,0))},a.now=function(){return Date.now?
Date.now():+new Date},a.utc=t,a.unix=function(g){return ha(1E3*g)},a.months=function(g,m){return uc(g,m,"months")},a.isDate=l,a.locale=Pa,a.invalid=E,a.duration=Ba,a.isMoment=G,a.weekdays=function(g,m,n){return Xb(g,m,n,"weekdays")},a.parseZone=function(){return ha.apply(null,arguments).parseZone()},a.localeData=Fa,a.isDuration=xb,a.monthsShort=function(g,m){return uc(g,m,"monthsShort")},a.weekdaysMin=function(g,m,n){return Xb(g,m,n,"weekdaysMin")},a.defineLocale=Nb,a.updateLocale=function(g,m){var n,
r;return null!=m?(r=cc,null!=ja[g]&&null!=ja[g].parentLocale?ja[g].set(fa(ja[g]._config,m)):(m=fa(null!=(n=ub(g))?n._config:r,m),null==n&&(m.abbr=g),(r=new Ca(m)).parentLocale=ja[g],ja[g]=r),Pa(g)):null!=ja[g]&&(null!=ja[g].parentLocale?(ja[g]=ja[g].parentLocale,g===Pa()&&Pa(g)):null!=ja[g]&&delete ja[g]),ja[g]},a.locales=function(){return Oc(ja)},a.weekdaysShort=function(g,m,n){return Xb(g,m,n,"weekdaysShort")},a.normalizeUnits=pa,a.relativeTimeRounding=function(g){return void 0===g?Ja:"function"==
typeof g&&(Ja=g,!0)},a.relativeTimeThreshold=function(g,m){return void 0!==gb[g]&&(void 0===m?gb[g]:(gb[g]=m,"s"===g&&(gb.ss=m-1),!0))},a.calendarFormat=function(g,m){return-6>(g=g.diff(m,"days",!0))?"sameElse":-1>g?"lastWeek":0>g?"lastDay":1>g?"sameDay":2>g?"nextDay":7>g?"nextWeek":"sameElse"},a.prototype=I,a.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",
TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},a});
(function(a){a.config.ignoredElements=["cq"];var b=function(){var c={};this.set=function(d,f){if(c.hasOwnProperty(d))throw Error("Cannot register name"+d+". It is already registered.");c[d]=f};this.get=function(d){return c[d]}};a.use({install:function(c){c.instanceRegistry=new b;c.newInstance=function(d,f){c.instanceRegistry.set(d,f);d=document.querySelectorAll('[aem-comp\x3d"'+d+'"]');vueInstances=[];for(var k=0;k<d.length;k++){var h=Object.assign({},f,{el:d[k]});vueInstances.push(new c(h))}return vueInstances};
c.reloadInstance=function(d){if(!d.matches("[aem-comp]")){var f=d.querySelector("[aem-comp]");if(f)d=f;else{console.warn("tried to find an element with attribute: aem-comp but none was found in ",d);return}}f=d.getAttribute("aem-comp");f=c.instanceRegistry.get(f);return new c(Object.assign({},f,{el:d}))}}});a.mixin({methods:{getCurrentPagePath:function(){return document.querySelector("#commonUtilLoad").getAttribute("data-currentPagePath")},getSiteName:function(){return document.querySelector("#commonUtilLoad").getAttribute("data-sitename")},
getLocaleRootPath:function(){return document.querySelector("#commonUtilLoad").getAttribute("data-rootPath")},getCountry:function(){return document.querySelector("#commonUtilLoad").getAttribute("data-country")},getLanguage:function(){return document.querySelector("#commonUtilLoad").getAttribute("data-language")},getLocale:function(){return this.isNotBlank(this.getDataLocale())?this.getDataLocale():this.getLanguage()+"-"+this.getCountry()},getDataLocale:function(){return document.querySelector("#commonUtilLoad").getAttribute("data-locale")},
getCookie:function(c){c+="\x3d";for(var d=document.cookie.split(";"),f=0;f<d.length;f++){for(var k=d[f];" "==k.charAt(0);)k=k.substring(1,k.length);if(0==k.indexOf(c))return k.substring(c.length,k.length)}return null},isNotBlank:function(c){return c&&0<c.length?!0:!1},getImgUrlWithPNG:function(c){return c&&""!=c?c+".wdthumb.319.319.png":""},getImgUrlWithWEBP:function(c){return c&&""!=c?c+".wdthumb.319.319.webp":""},getImgUrlWithJPG:function(c){return c&&""!=c?c+".wdthumb.319.319.jpg":""},excludeProductReferenceFromSession:function(){return"true"==
document.querySelector("#commonUtilLoad").getAttribute("data-excludeProductReferenceFromSession")?!0:!1},rewritePageURL:function(c){var d=document.querySelector("#commonUtilLoad").getAttribute("data-rootPathToReplaceInURL");return c&&-1<c.indexOf(d)?isPublishInstance()?c.replace(d,"").replace(".html",""):0>c.indexOf(".html")?c+".html":c:c},rewritePageURLWithHTML:function(c){c=this.rewritePageURL(c);return 0>c.indexOf(".html")?c+".html":c},isWcmModeDisabled:function(){return"true"==document.querySelector("#commonUtilLoad").getAttribute("data-isWcmModeDisabled")?
!0:!1},isPublishInstance:function(){return"true"==document.querySelector("#commonUtilLoad").getAttribute("data-isPublishInstance")?!0:!1},addClass:function(c,d){null==c||hasClass(c,d)||c.classList.add(d)},removeClass:function(c,d){null!=c&&hasClass(c,d)&&c.classList.remove(d)},hasClass:function(c,d){return c.classList.contains(d)},scrollToTop:function(c){scrollToTop(c)},isPathProtected:function(c){var d=!1;document.querySelector("#commonUtilLoad").getAttribute("data-isPathProtected").split(",").forEach(function(f){null!=
f&&""!==f&&""!=c&&-1<c.indexOf(f)&&(d=!0)});return d},getCurrenDateInWDFormat:function(){var c=new Date,d=c.getFullYear(),f=c.getMonth()+1;c=c.getDate();10>c&&(c="0"+c);10>f&&(f="0"+f);return d+"-"+f+"-"+c},serialize:function(c){var d={};c=$jscomp.makeIterator(c);for(var f=c.next();!f.done;f=c.next()){var k=$jscomp.makeIterator(f.value);f=k.next().value;k=k.next().value;void 0!==d[f]?(Array.isArray(d[f])||(d[f]=[d[f]]),d[f].push(k)):d[f]=k}return d},getTimeZoneInfo:function(){return document.querySelector("#commonUtilLoad").getAttribute("data-timeZone")},
isBadgeStatusActive:function(c,d){c&&(c=c.slice(0,-6));d&&(d=d.slice(0,-6));var f=new Date(c),k=new Date(d),h=!1;this.getTimeZoneInfo();var l=new Intl.DateTimeFormat("en-US",{timeZone:"America/Los_Angeles",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric"});l=new Date(l.format(new Date));c||d?c&&d&&l>=f&&l<=k?h=!0:c&&!d&&l>=f?h=!0:!c&&d&&l<=k&&(h=!0):h=!0;return h},isOfferActive:function(c,d){return this.isBadgeStatusActive(c,d)},getUnEscapedHTMLContent:function(c){return(new DOMParser).parseFromString(c,
"text/html").documentElement.textContent},mergeStringArray:function(c,d){return c&&Array.isArray(c)?c.join(d?d:""):c},getFormattedDate:function(c,d){var f=d;if(null==d||""==d)f="MMM D, yyyy";return moment(c).format(f)},getConvertedDate:function(c){var d=void 0!=document.getElementById("userLoad")?document.getElementById("userLoad").getAttribute("data-site-timeOffsetDiff"):null;c=new Date(c);return d&&parseFloat(d)?new Date(c.getTime()+6E4*c.getTimezoneOffset()+36E5*d):new Date(c.getTime()+6E4*c.getTimezoneOffset()+
0)},getOracleServiceCloudHost:function(){return document.querySelector("#commonUtilLoad").getAttribute("data-oracleServiceCloudHost")},openURL:function(c,d){var f=window.location.origin+c;d?window.location.href=f:window.open(c,"_blank")},getURLParam:function(c){return(new URLSearchParams(window.location.search)).get(c)}}})})(Vue);Vue.directive("init",{bind:function(a,b,c){c.context[b.expression]()}});
var deferredPromisesGetUser=[],getUserCallInProgress=!1,deferredPromisesGetCart=[],getCartCallInProgress=!1,getProductPriceCallInProgress=!1,deferredPromisesGetProductReferences=[],getProductReferencesCallInProgress=!1,deferredPromisesGetPromotionReferences=[],getPromotionReferencesCallInProgress=!1,productPriceMap=new Map,getBundlePromoCallInProgress=!1,bundlePromoMap=new Map,getPotentialPromotionsCallInProgress=!1,potentialPromotionsMap=new Map,prodRef="",commerceService={data:{COMMERCE_CONSTANTS:{CART_DETAILS:"cartDetails",
INVALIDATION_TIMEOUT:"invalidationTimeout",COMMERCE_PREFIX:"cmrc_",REL_PROD:"relatedProducts_",USER_DETAILS:"userDetails",PRODUCT_REFERENCES:"productReferences",CATEGORY_LISTING:"categoryListing_",EMPTY_USER_JSON:"{'uid':''}",EMPTY_CART_JSON:"{'cartId':''}",POTENTIAL_PROMOTIONS:"potentialPromotions",BLOCK_SIZE:"16",SYNDICATION_FEED:"syndicationFeed",AFFIRM_ALLOWED:"affirmAllowed",B2C:"B2C",B2B:"B2B",B2B_PATH:"business/",EMPTY:"",CHANNEL_COOKIE:"Channel",LOGIN_POPUP_COOKIE:"loginPopup",BUSINESS_SIGNUP_COOKIE:"businessSignup",
LOYALTY_DETAILS:"loyaltyDetails",CUSTOM_PROMOTIONS:"customPromotions"},isLoyaltyProgramEnabled:!1},mounted:function(){var a=this;this.removeRedundantSessionVariables();this.isLoyaltyProgramEnabled="true"==document.querySelector("#commerceLoad").getAttribute("data-loyalty-program-check");window.setTimeout(function(){a.isLoyaltyProgramEnabled&&(a.cs_commonLogger("invoke displayLoyaltyInfoOnBar"),a.displayLoyaltyInfoOnBar())},2E3);var b=this.getCookie("refresh-user-session");this.cs_commonLogger("refreshSessionCookie: "+
b);b&&(this.cs_commonLogger("refresh-user-session cookie exists so explicitly clear session."),this.removeAllSessionVariable(),Cookies.remove("refresh-user-session"),this.cs_commonLogger("refresh-user-session cookie deleted: "+this.getCookie("refresh-user-session")));-1<this.getHeartbeatTimeoutPeriod()&&window.setInterval(function(){a.heartbeat()},6E4*this.getHeartbeatTimeoutPeriod())},methods:{getPurchasableCatalog:function(){return"true"==document.getElementById("commerceLoad").getAttribute("data-purchasable-catalog")?
!0:!1},getServiceCommerceURL:function(){return document.getElementById("commerceLoad").getAttribute("data-commerce-service")},getPlatformCommerceURL:function(){return document.getElementById("commerceLoad").getAttribute("data-commerce-platform")},getPlatformCommerceCreditURL:function(){return document.getElementById("commerceLoad").getAttribute("data-trevipay-platform")},getCommerceServiceSite:function(){var a=document.getElementById("commerceLoad").getAttribute("data-commerce-b2c-service-site");
this.getCustomerChannel()==this.$data.COMMERCE_CONSTANTS.B2B&&(a=document.getElementById("commerceLoad").getAttribute("data-commerce-b2b-service-site"));return a},getCommerceLang:function(){var a=document.getElementById("commerceLoad").getAttribute("data-commerce-lang");return null!=a?"\x26lang\x3d"+a:""},getCommercePrefix:function(){return"cmrc_"+this.getLocale().toLowerCase()+"_"},generatePlatformURL:function(a,b){return this.gotoCommerceURL(a)+("?fields\x3dFULL"+(b&&""!=b?"\x26"+b:""))},gotoCommerceURL:function(a){var b=
this.getPlatformCommerceURL()+"/";"us"!=this.getCountry().toLowerCase()&&"in"!=this.getCountry().toLowerCase()&&(b+=this.getLanguage().toLowerCase()+"-"+this.getCountry().toLowerCase()+"/");return b+="store/"+this.getPathFromCustomerChannel(this.getCustomerChannel())+a},gotoBusinessCommerceURL:function(a){var b=this.getPlatformCommerceURL()+"/";"us"!=this.getCountry().toLowerCase()&&(b+=this.getLanguage().toLowerCase()+"-"+this.getCountry().toLowerCase()+"/");return b+="store/"+this.getPathFromCustomerChannel("B2B")+
a},generateServiceURL:function(a,b,c){return this.getServiceCommerceURL()+"/"+this.getCommerceServiceSite()+a+"?fields\x3d"+(c&&""!=c?c:"FULL")+(b&&""!=b?"\x26"+b:"")+this.getCommerceLang()},getPathFromCustomerChannel:function(a){var b="";a===this.COMMERCE_CONSTANTS.B2B&&(b=this.COMMERCE_CONSTANTS.B2B_PATH);this.cs_commonLogger("path from customer channel: "+b);return b},getCustomerChannelFromPath:function(a){var b="B2C";a&&-1<a.indexOf(this.$data.COMMERCE_CONSTANTS.B2B_PATH)&&(b="B2B");return b},
getCustomerChannel:function(){var a=this.getCookie("Channel");return a?a:"B2C"},getAffirmScriptURL:function(){return document.getElementById("commerceLoad").getAttribute("data-commerce-affirm-script-url")},getAffirmPublicApiKey:function(){return document.getElementById("commerceLoad").getAttribute("data-commerce-affirm-api-key")},getWTBPagePath:function(){var a=document.getElementById("commerceLoad").getAttribute("data-wtb-page-path");a=null!=a?a:"";this.cs_commonLogger("wtbPagePath: "+a);return a},
getHeartbeatTimeoutPeriod:function(){var a=document.getElementById("commerceLoad").getAttribute("data-heartbeat-check");return a?parseInt(a):-1},getProductPrice:function(a){var b=this;this.cs_commonLogger("in getProductPrice...");this.cs_commonLogger("inputProductIds: "+a);var c=Q.defer();if(productPriceMap.get(a)){getProductPriceCallInProgress=!0;this.cs_commonLogger("is already there in map, then add to promise");var d=productPriceMap.get(a);d.push(c)}else d=[],d.push(c),productPriceMap.set(a,d),
getProductPriceCallInProgress=!1,this.cs_commonLogger("is not there in map, then add it.");this.cs_commonLoggerObj("objects in product price map",productPriceMap);getProductPriceCallInProgress?this.cs_commonLogger("get product price call in progress"):this.getProductPriceWS(a).then(function(f){getProductPriceCallInProgress=!1;f=productPriceMap.get(a);b.cs_commonLogger("getProductPrice :: resolve all deferred promises: "+f.length);for(var k=0;k<f.length;k++)f[k].resolve();productPriceMap.set(a,null)}).catch(function(f){getProductPriceCallInProgress=
!1;f=productPriceMap.get(a);b.cs_commonLogger("getProductPrice :: reject all deferred promises: "+f.length);for(var k=0;k<f.length;k++)f[k].reject();productPriceMap.set(a,null)});return c.promise},getProductPriceWS:function(a){var b=this;this.cs_commonLogger("in getProductPriceWS...");this.cs_commonLogger("inputProductIds: "+a);var c=Q.defer(),d=!1,f=this.$data.COMMERCE_CONSTANTS.EMPTY;if(a&&0<a.length){if(-1<a.indexOf(",")){a=a.split(",");for(var k=0;k<a.length;k++)d=this.getSessionVariable(a[k])?
this.getSessionVariable(a[k]).prices:null,this.cs_commonLogger(a[k]+" isPriceInSession: "+(null!=d)),d||(f+=a[k]+",",this.cs_commonLogger("productIds: "+f));0<f.length&&(d=!1,-1<f.indexOf(",")&&(f=f.substring(0,f.length-1)))}else this.cs_commonLogger("only 1 product id present: "+a),d=this.getSessionVariable(a)?this.getSessionVariable(a).prices:null,f=a;this.cs_commonLogger("isPriceInSession: "+d);d?c.resolve():(this.cs_commonLogger("productIds: "+f),this.getPurchasableCatalog()?(this.cs_commonLogger("catalog is purchasable, so going to get pricing."),
this.initialize("from getProductPrice").then(function(h){b.cs_commonLogger("initialized: get product price and inventory from API");b.getPriceURL().then(function(l){b.cs_commonLogger("URL to call price service: "+l);l=b.generatePlatformURL(l,"productsQuery\x3d"+f);b.cs_commonLogger("priceURL : "+l);fetch(l,{credentials:"include"}).then(function(p){b.cs_commonLogger("returned from finding product pricing");b.cs_commonLoggerObj("response from product price call",p);b.cs_commonLoggerObj("is response json",
b.isResponseTypeJson(p));if(b.isResponseTypeJson(p))return p.json();b.createErrorObject(c,"Product price response object is not of type JSON",null)}).then(function(p){for(var q in p){var t=p[q];b.cs_commonLoggerObj("sku["+q+"]",t);b.cs_commonLogger("create json object for storing sku: "+t.code+" in sessionStorage");var u={isSubscriptionProduct:!1};u.stockStatus=t.stock.stockLevelStatus.code;u.stockAvailabilityMessage=t.stock.availabilityMessageName;u.purchasable=t.purchasable;u.productLifeCycle=t.lifeCycle?
t.lifeCycle.name:null;u.affirmAllowed=t.affirmAllowed;u.stockLevel=t.stock.stockLevel;if(t.priceData&&null!=t.priceData){t.affirmAllowed&&b.setSessionVariable(b.$data.COMMERCE_CONSTANTS.AFFIRM_ALLOWED,!0);var C={},E={type:"list"};E.amount=t.priceData.value;E.currency=t.priceData.currencyIso;E.amountFormatted=t.priceData.formattedValue;C.list=E;if(t.discountPriceData){b.cs_commonLogger("discountPriceData found for this sku: "+t.code);var F={type:"sale"};F.amount=t.discountPriceData.value;F.currency=
t.discountPriceData.currencyIso;F.amountFormatted=t.discountPriceData.formattedValue;C.sale=F;t.percentageOff&&(u.percentageOff=Math.round(100*t.percentageOff)/100)}else b.cs_commonLogger("sale price is same as list price for this sku: "+t.code),C.sale=E;F=[];if(b.getCustomerChannel()==b.$data.COMMERCE_CONSTANTS.B2B&&t.volumePrice&&0<t.volumePrice.length){for(var K=E=0;K<t.volumePrice.length;K++){var G={type:"list"};G.amount=t.volumePrice[K].value;G.currency=t.volumePrice[K].currencyIso;G.amountFormatted=
t.volumePrice[K].formattedValue;G.minQuantity=t.volumePrice[K].minQuantity;G.maxQuantity=t.volumePrice[K].maxQuantity;null!=t.volumePrice[K].maxQuantity&&(E=t.volumePrice[K].maxQuantity);F.push(G)}1<t.volumePrice.length&&(C.maxQuantity=100*Math.ceil(Math.round(1.5*E)/100));C.volumePrice=F}else b.getCustomerChannel()!=b.$data.COMMERCE_CONSTANTS.B2B||t.volumePrice&&0!=t.volumePrice.length||(G=E,G.minQuantity=1,G.maxQuantity=null,F.push(G),C.volumePrice=F);F={};t.isSubscriptionProduct&&(u.isSubscriptionProduct=
!0,t.recurringPriceData&&(F.type="recurring",F.amount=t.recurringPriceData.value,F.currency=t.recurringPriceData.currencyIso,F.amountFormatted=t.recurringPriceData.formattedValue,F.billingPlanName=t.recurringPriceData.billingPlanName,C.sale=F));t.superDiscountPriceData&&(t.upsellingDiscountPriceData=t.superDiscountPriceData.upselling_super_promo,t.upsellingDiscountPriceData&&(F={type:"upsell"},F.amount=t.upsellingDiscountPriceData.value,F.currency=t.upsellingDiscountPriceData.currencyIso,F.amountFormatted=
t.upsellingDiscountPriceData.formattedValue,C.upsell=F),t.crossellingDiscountPriceData=t.superDiscountPriceData.crosselling_super_promo,t.crossellingDiscountPriceData&&(F={type:"crossell"},F.amount=t.crossellingDiscountPriceData.value,F.currency=t.crossellingDiscountPriceData.currencyIso,F.amountFormatted=t.crossellingDiscountPriceData.formattedValue,C.crossell=F));t.lowestPriceData&&(F={type:"lowest"},F.amount=t.lowestPriceData.value,F.currency=t.lowestPriceData.currencyIso,F.amountFormatted=t.lowestPriceData.formattedValue,
C.lowest=F);b.getCustomerChannel()==b.$data.COMMERCE_CONSTANTS.B2B&&(u.minOrderQuantity="undefined"!=typeof t.minOrderQuantity&&0!=t.minOrderQuantity?parseInt(t.minOrderQuantity):1,u.isDropShipProduct="undefined"!=typeof t.isDropShipProduct?t.isDropShipProduct:!1,u.casePackQuantity="undefined"!=typeof t.casePackQty&&0!=t.casePackQty?parseInt(t.casePackQty):1,u.isNonReturnable=null!=t.isNonReturnable?t.isNonReturnable:!1,u.limitedTimeToCancel=null!=t.limitedTimeToCancel&&-1!=t.limitedTimeToCancel?
parseInt(t.limitedTimeToCancel):-1);u.prices=C;b.cs_commonLoggerObj("price json data",u);u.bundlePromoId=[];p.forEach(function(A){A.pdpPromotions&&A.pdpPromotions.forEach(function(O){-1==u.bundlePromoId.indexOf(O)&&u.bundlePromoId.push(O)})});if(C=b.getSessionVariable(t.code))b.cs_commonLogger("sku found in session."),u=C;b.cs_commonLogger("storing sku: "+t.code+" in sessionStorage");b.setSessionVariable(t.code,u)}else"outOfStock"==u.stockStatus&&1==u.purchasable&&"Active"==u.productLifeCycle?(b.cs_commonLogger("storing sku: "+
t.code+" in sessionStorage"),b.setSessionVariable(t.code,{notifyMeStockValid:!0})):b.setSessionVariable(t.code,{notifyMeStockValid:!1})}c.resolve()}).catch(function(p){b.createErrorObject(c,"Error occured while getting product price: "+p.message,null)})})}).catch(function(h){b.createErrorObject(c,"failed to initialize so cannot get product price",null)})):this.createErrorObject(c,"catalog is not purchasable, so not going to get pricing.",null))}else this.createErrorObject(c,"inputProductIds value is empty so cannot get product price",
null);return c.promise},getBundlePromo:function(a){var b=this;this.cs_commonLogger("in getBundlePromo...");this.cs_commonLogger("inputBundlePromoIds: "+a);var c=Q.defer();if(bundlePromoMap.get(a)){getBundlePromoCallInProgress=!0;this.cs_commonLogger("is already there in map, then add to promise");var d=bundlePromoMap.get(a);d.push(c)}else d=[],d.push(c),bundlePromoMap.set(a,d),getBundlePromoCallInProgress=!1,this.cs_commonLogger("is not there in map, then add it.");this.cs_commonLoggerObj("objects in product price map",
productPriceMap);getBundlePromoCallInProgress?this.cs_commonLogger("get Bundle Promo call in progress"):this.getBundlePromoWS(a).then(function(f){getBundlePromoCallInProgress=!1;f=bundlePromoMap.get(a);b.cs_commonLogger("getBundlePromo :: resolve all deferred promises: "+f.length);for(var k=0;k<f.length;k++)f[k].resolve();bundlePromoMap.set(a,null)}).catch(function(f){getBundlePromoCallInProgress=!1;f=bundlePromoMap.get(a);b.cs_commonLogger("getBundlePromo :: reject all deferred promises: "+f.length);
for(var k=0;k<f.length;k++)f[k].reject();bundlePromoMap.set(a,null)});return c.promise},getBundlePromoWS:function(a){var b=this;this.cs_commonLogger("in getBundlePromoWS...");this.cs_commonLogger("inputBundlePromoIds: "+a);var c=Q.defer(),d=!1,f=this.$data.COMMERCE_CONSTANTS.EMPTY;if(a&&0<a.length){if(-1<a.indexOf(","))if(1<a.split(",")[0].split("|").length)d=this.getSessionVariable(a)?this.getSessionVariable(a):null;else{for(var k=a.split(","),h=0;h<k.length;h++)d=this.getSessionVariable(k[h])?this.getSessionVariable(k[h]):
null,this.cs_commonLogger(k[h]+" isBundlePromoInSession: "+(null!=d)),d||(f+=k[h].split("|")[0]+",",this.cs_commonLogger("bundlePromoIds: "+f));0<f.length&&(d=!1,-1<f.indexOf(",")&&(f=f.substring(0,f.length-1)))}else this.cs_commonLogger("only 1 bundle id present: "+a),d=this.getSessionVariable(a)?this.getSessionVariable(a):null,f=a.split("|")[0];this.cs_commonLogger("isBundlePromoInSession: "+d);d?c.resolve():this.initialize("from getBundlePromo").then(function(l){b.cs_commonLogger("initialized: get bundle promo details from API");
var p={pdpPromotions:[]};1<a.split(",")[0].split("|").length?(l=a.split(",")[0].split("|")[0],p.pdpPromotions.push({promoCode:l,qualifiedSkus:[]}),p.pdpPromotions.forEach(function(q){a.split(",").forEach(function(t){q.qualifiedSkus.push({container:t.split("|")[1],sku:t.split("|")[2]})})})):f.split(",").forEach(function(q){p.pdpPromotions.push({promoCode:q.trim()})});l={method:"POST",headers:{"Content-Type":"application/json;  charset\x3dutf-8",DataType:"json"},body:JSON.stringify(p)};fetch(b.generatePlatformURL("cart/pdp/promotions"),
l).then(function(q){b.cs_commonLogger("returned from finding Bundle Promo");b.cs_commonLoggerObj("response from Bundle Promo call",q);b.cs_commonLoggerObj("is response json",b.isResponseTypeJson(q));if(b.isResponseTypeJson(q))return q.json();b.createErrorObject(c,"Product price response object is not of type JSON",null)}).then(function(q){for(var t in q){var u=q[t];if(u.qualifyingProducts&&null!=u.qualifyingProducts){var C={};C.code=u.code;C.description=u.description;C.promotionDetails=u.promotionDetails;
C.qualifyingProducts=u.qualifyingProducts;C.bundleDiscountPriceData=u.bundleDiscountPriceData;C.bundlePriceData=u.bundlePriceData;C.purchasable=u.qualifyingProducts.every(function(F){return F.products.every(function(K){return K.purchasable})});if(1<a.split(",")[0].split("|").length)b.setSessionVariable(a,C);else{var E=[];C.qualifyingProducts.forEach(function(F){E.push(u.code+"|"+F.container+"|"+F.products[0].code)});b.setSessionVariable(E.join(","),C);b.setSessionVariable(u.code,C)}}}c.resolve()}).catch(function(q){console.log(q)})}).catch(function(l){b.createErrorObject(c,
"failed to initialize so cannot get Bundle Promotion details",null)})}else this.createErrorObject(c,"inputBundlePromoIds value is empty so cannot get product price",null);return c.promise},getPriceURL:function(){var a=this;this.cs_commonLogger("in getPriceURL...");var b=Q.defer(),c="cart/guest/products/priceAndInventory",d=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.USER_DETAILS);null!=d&&"undefined"!=typeof d.uid?(c="cart/products/priceAndInventory",b.resolve(c)):this.getUser().then(function(f){a.cs_commonLogger("get user returned from get priceurl method...");
f=a.getSessionVariable(a.$data.COMMERCE_CONSTANTS.USER_DETAILS);null!=f&&"undefined"!=typeof f.uid&&(c="cart/products/priceAndInventory");b.resolve(c)}).catch(function(f){b.resolve(c)});return b.promise},addProductToCart:function(a,b){var c=this;this.cs_commonLogger("in addProductToCart...");var d=Q.defer();"undefined"==typeof b&&(b=1);a&&0<a.length?this.initialize("from addProductToCart").then(function(f){c.cs_commonLogger("calling add product service");var k={qty:b,productCodePost:a};f=Object.keys(k).map(function(h){return encodeURIComponent(h)+
"\x3d"+encodeURIComponent(k[h])}).join("\x26");fetch(c.generatePlatformURL("cart/add"),{credentials:"include",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:f}).then(function(h){c.cs_commonLoggerObj("product added to cart response",h);if(c.isResponseTypeJson(h))return h.json();c.createErrorObject(d,"Add product to cart response object is not of type JSON",h)}).then(function(h){c.createCartObject(h).then(function(l){d.resolve()}).catch(function(l){c.createErrorObject(d,
"failed to create cart object",null)})}).catch(function(h){c.createErrorObject(d,"failed to add product to cart :: "+h.message,null)})}).catch(function(f){c.createErrorObject(d,"failed to initialize so cannot add product to cart",null)}):this.createErrorObject(d,"sku value is empty so cannot add product to cart",null);return d.promise},addMultipleProductToCart:function(a){var b=this;this.cs_commonLogger("in addMultipleProductToCart...");var c=Q.defer();a&&a.cartEntries&&0<a.cartEntries.length?this.initialize("from addMultipleProductToCart").then(function(d){b.cs_commonLogger("calling add multiple product service");
fetch(b.generatePlatformURL("cart/addProducts"),{credentials:"include",method:"POST",headers:{"Content-Type":"application/json; charset\x3dutf-8"},body:JSON.stringify(a)}).then(function(f){b.cs_commonLoggerObj("product added to cart response",f);if(b.isResponseTypeJson(f))return f.json();b.createErrorObject(c,"Add multiple product to cart response object is not of type JSON",f)}).then(function(f){b.createCartObject(f).then(function(k){c.resolve()}).catch(function(k){b.createErrorObject(c,"addMultipleProductToCart : failed to create cart object",
null)})}).catch(function(f){b.createErrorObject(c,"addMultipleProductToCart : failed to add product to cart :: "+f.message,null)})}).catch(function(d){b.createErrorObject(c,"addMultipleProductToCart : failed to initialize so cannot add product to cart",null)}):this.createErrorObject(c,"request json data is empty so cannot add multiple product to cart",null);return c.promise},skipBogoOffer:function(a,b){var c=this;this.cs_commonLogger("in skipBogoOffer...");var d=Q.defer();"undefined"!=typeof a&&"undefined"!=
typeof b?this.initialize("from skipBogoOffer").then(function(f){c.cs_commonLogger("calling product to update for skipping bogo offer service");var k={pageType:"CART",entryNumber:b,productCodePost:a};f=Object.keys(k).map(function(h){return encodeURIComponent(h)+"\x3d"+encodeURIComponent(k[h])}).join("\x26");fetch(c.generatePlatformURL("cart/entry/noThanks/update"),{credentials:"include",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:f}).then(function(h){c.cs_commonLoggerObj("product updated to skip bogo offer service",
h);if(c.isResponseTypeJson(h))return h.json();c.createErrorObject(d,"skipBogoOffer :: Skip bogo offer service response object is not of type JSON",h)}).then(function(h){c.createCartObject(h).then(function(l){d.resolve()}).catch(function(l){c.createErrorObject(d,"skipBogoOffer : failed to create cart object",null)})}).catch(function(h){c.createErrorObject(d,"failed to update product for skipping bogo offer :: "+h.message,null)})}).catch(function(f){c.createErrorObject(d,"failed to initialize so cannot update product for skipping bogo offer",
null)}):this.createErrorObject(d,"sku and/or entryNumber value is empty so cannot update product for skipping bogo offer",null);return d.promise},accept3PPromotion:function(a,b,c){var d=this;this.cs_commonLogger("in accept3PPromotion...");var f=Q.defer();"undefined"!=typeof b&&"undefined"!=typeof a?this.initialize("from accept3PPromotion").then(function(k){d.cs_commonLogger("calling hybris to update for accept 3PPromotion");var h={promotionID:a,isPromotionAccepted:b};c&&(h.selectedProductCode=c);
k=Object.keys(h).map(function(l){return encodeURIComponent(l)+"\x3d"+encodeURIComponent(h[l])}).join("\x26");fetch(d.generatePlatformURL("cart/entry/promotionAcceptance/update"),{credentials:"include",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:k}).then(function(l){d.cs_commonLoggerObj("accept 3PPromotion Acceptance service response",l);if(d.isResponseTypeJson(l))return l.json();d.createErrorObject(f,"3PPromotion Acceptance service response object is not of type JSON",
l)}).then(function(l){d.createCartObject(l).then(function(p){f.resolve()}).catch(function(p){d.createErrorObject(f,"3PPromotion Acceptance service : failed to create cart object",null)})}).catch(function(l){d.createErrorObject(f,"failed to call 3PPromotion Acceptance service :: "+l.message,null)})}).catch(function(k){d.createErrorObject(f,"failed to initialize so cannot call 3PPromotion Acceptance service :: "+k.message,null)}):this.createErrorObject(f,"promotion key value is empty so cannot call 3PPromotion Acceptance service",
null);return f.promise},getCartSummary:function(){var a=this;this.cs_commonLogger("in getCartSummary...");var b=Q.defer();deferredPromisesGetCart.push(b);getCartCallInProgress?this.cs_commonLogger("get cart call in progress"):(getCartCallInProgress=!0,this.getCartSummaryWS().then(function(){getCartCallInProgress=!1;a.cs_commonLogger("resolve all deferred promises: "+deferredPromisesGetCart.length);for(var c=0;c<deferredPromisesGetCart.length;c++)deferredPromisesGetCart[c].resolve();deferredPromisesGetCart=
[]}).catch(function(c){getCartCallInProgress=!1;a.cs_commonLogger("reject all deferred promises: "+deferredPromisesGetCart.length);for(c=0;c<deferredPromisesGetCart.length;c++)deferredPromisesGetCart[c].reject(response);deferredPromisesGetCart=[]}));return b.promise},getCartSummaryWS:function(){var a=this;this.cs_commonLogger("in getCartSummaryWS...");var b=Q.defer();this.initialize("from getCartSummaryWS").then(function(){a.cs_commonLogger("calling get cart service");null==a.getSessionVariable(a.$data.COMMERCE_CONSTANTS.CART_DETAILS)?
(a.cs_commonLogger("cart summary not found in session"),fetch(a.generatePlatformURL("cart/getCart"),{credentials:"include"}).then(function(c){a.cs_commonLoggerObj("cart response received",c);if(a.isResponseTypeJson(c))return c.json();a.createErrorObject(b,"Get cart response object is not of type JSON",null)}).then(function(c){a.createCartObject(c).then(function(d){b.resolve()}).catch(function(d){a.createErrorObject(b,"failed to create cart object",d)})}).catch(function(c){a.createErrorObject(b,"failed to get cart summary from service",
c)})):(a.cs_commonLogger("cart summary found in session"),b.resolve())}).catch(function(c){a.createErrorObject(b,"failed to initialize so cannot get cart",null)});return b.promise},getCartInfo:function(){var a=this;this.cs_commonLogger("in getCartInfo...");var b=Q.defer();this.initialize("from getCartInfo").then(function(c){a.cs_commonLogger("calling get cart info service");(c=a.getSessionVariable(a.$data.COMMERCE_CONSTANTS.CART_DETAILS))&&c.cartEntries&&0<c.cartEntries.length?(a.cs_commonLogger("cart info found in session"),
b.resolve()):(a.cs_commonLogger("cart info not found in session"),fetch(a.generatePlatformURL("cart/getCartInfo"),{credentials:"include"}).then(function(d){a.cs_commonLoggerObj("cart info response received",d);if(a.isResponseTypeJson(d))return d.json();a.createErrorObject(b,"Get cart info response object is not of type JSON",null)}).then(function(d){a.createCartObject(d).then(function(f){b.resolve()}).catch(function(f){a.createErrorObject(b,"failed to create cart object \x3e\x3e "+f.message,null)})}).catch(function(d){a.createErrorObject(b,
"failed to get cart info from service \x3e\x3e "+d.message,null)}))}).catch(function(c){a.createErrorObject(b,"failed to initialize so cannot get cart info",null)});return b.promise},createCartObject:function(a){var b=this;this.cs_commonLogger("in createCartObject...");var c=Q.defer();a&&a.code?(this.cs_commonLogger("cart has entries."),a.entries?null==this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.PRODUCT_REFERENCES)?this.getProductReferences().then(function(d){b.creatingCartObject(c,a);c.resolve()}).catch(function(d){b.creatingCartObject(c,
a);b.createErrorObject(c,"createCartObject: failed to get product reference",d)}):(this.creatingCartObject(c,a),c.resolve()):(this.creatingCartObject(c,a),c.resolve())):(this.cs_commonLogger("no item in cart"),this.setSessionVariable(this.$data.COMMERCE_CONSTANTS.CART_DETAILS,this.$data.COMMERCE_CONSTANTS.EMPTY_CART_JSON),c.resolve());return c.promise},creatingCartObject:function(a,b){this.cs_commonLogger("in creatingCartObject...");try{var c={};c.cartId=b.code;c.totalUnitCount=b.totalUnitCount;c.totalItems=
b.totalItems;c.responseMessage=b.responseMessage;c.freeShippingMessage=b.freeShippingMessage;if(b.totalPrice){var d={};d.amount=b.totalPrice.value;d.currency=b.totalPrice.currencyIso;d.amountFormatted=b.totalPrice.formattedValue;c.subtotal=d}d=[];for(var f in b.entries){var k=b.entries[f],h={};h.index=f;h.name=k.productName;h.sku=k.productId;h.quantity=k.quantity;h.isSubscriptionProduct=!1;h.productType=k.productType?k.productType.code:"";h.displayMessage=[];var l={},p={type:"sale"};p.amount=k.totalPrice.value;
p.currency=k.totalPrice.currencyIso;p.amountFormatted=k.totalPrice.formattedValue;l.sale=p;p={type:"list"};p.amount=k.lineTotalPrice.value;p.currency=k.lineTotalPrice.currencyIso;p.amountFormatted=k.lineTotalPrice.formattedValue;l.list=p;p={};k.isSubscriptionProduct&&(h.isSubscriptionProduct=!0,k.subscriptionLineTotalPrice&&(p.type="recurring",p.amount=k.subscriptionLineTotalPrice.value,p.currency=k.subscriptionLineTotalPrice.currencyIso,p.amountFormatted=k.subscriptionLineTotalPrice.formattedValue,
p.billingPlanName=k.subscriptionLineTotalPrice.billingPlanName,l.sale=p));h.prices=l;var q=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);q&&q[h.sku]?(this.cs_commonLogger("mapping product page found for sku: "+h.sku),h.pageTitle=q[h.sku].pageTitle,h.pagePath=q[h.sku].pagePath,h.pageImage=q[h.sku].urlFileReference):this.cs_errorLogger("mapping product page NOT found for sku: "+h.sku);if(b.promotions)for(var t in b.promotions){var u=b.promotions[t],C=u.msgText.split("|")[0];
if(null!=C&&"displayMessage"==C)for(l=0;l<u.consumedEntries.length;l++){var E=u.consumedEntries[l].code;if(null!=E&&""!=E&&E==h.sku){h.displayMessage.push(u.msgText.split("|")[1]);break}}}d.push(h)}c.cartEntries=d;b.promotions&&(c.promotions=b.promotions);b.acceptedPromotions&&(c.acceptedPromotions=b.acceptedPromotions);b.isSubscriptionCart&&(c.isSubscriptionCart=b.isSubscriptionCart,c.subscriptionTotalPrice=b.subscriptionTotalPrice);this.cs_commonLoggerObj("cart json object",c);this.setSessionVariable(this.$data.COMMERCE_CONSTANTS.CART_DETAILS,
c);a.resolve()}catch(F){this.createErrorObject(a,"Error while creating cart object: "+F.message,null)}},getProductReferences:function(){var a=this;this.cs_commonLogger("in getProductReferences...");var b=Q.defer();deferredPromisesGetProductReferences.push(b);getProductReferencesCallInProgress?this.cs_commonLogger("get product references in progress"):(getProductReferencesCallInProgress=!0,this.getProductReferencesWS().then(function(c){getProductReferencesCallInProgress=!1;a.cs_commonLogger("getProductReferences :: resolve all deferred promises: "+
deferredPromisesGetProductReferences.length);for(c=0;c<deferredPromisesGetProductReferences.length;c++)deferredPromisesGetProductReferences[c].resolve();deferredPromisesGetProductReferences=[]}).catch(function(c){getProductReferencesCallInProgress=!1;a.cs_commonLogger("getProductReferences :: reject all deferred promises: "+deferredPromisesGetProductReferences.length);for(c=0;c<deferredPromisesGetProductReferences.length;c++)deferredPromisesGetProductReferences[c].reject();deferredPromisesGetProductReferences=
[]}));return b.promise},getProductReferencesWS:function(){var a=this;this.cs_commonLogger("in getProductReferencesWS...");var b=Q.defer();null==this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.PRODUCT_REFERENCES)?this.initialize("from getProductReferences").then(function(c){a.cs_commonLogger("calling get product references");c="/bin/sd/cache/commerce/productreference."+(a.getCustomerChannel()==a.$data.COMMERCE_CONSTANTS.B2B?a.getCustomerChannel().toLowerCase()+".":"")+a.getLocale().toLowerCase()+
".json";fetch(c,{credentials:"include"}).then(function(d){return d.json()}).then(function(d){navigator.vendor&&-1<navigator.vendor.indexOf("Apple")&&navigator.userAgent&&-1==navigator.userAgent.indexOf("FxiOS")||navigator.vendor&&-1<navigator.vendor.indexOf("Apple")&&navigator.userAgent&&-1<navigator.userAgent.indexOf("FxiOS")||a.excludeProductReferenceFromSession()||!a.isPublishInstance()?prodRef=d:a.setSessionVariable(a.$data.COMMERCE_CONSTANTS.PRODUCT_REFERENCES,d);a.cs_commonLogger("product references added to session");
b.resolve()}).catch(function(d){a.createErrorObject(b,"failed to get product references from service :: "+d.message,null)})}).catch(function(c){a.createErrorObject(b,"failed to initialize so cannot get product references",null)}):(this.cs_commonLogger("product references found in session"),b.resolve());return b.promise},getPromotionsJson:function(){var a=this;this.cs_commonLogger("in getPromotionsJson...");var b=Q.defer();deferredPromisesGetPromotionReferences.push(b);getPromotionReferencesCallInProgress?
this.cs_commonLogger("get promotion references in progress"):(getPromotionReferencesCallInProgress=!0,this.getPromotionsJsonWS().then(function(c){getPromotionReferencesCallInProgress=!1;a.cs_commonLogger("getPromotionsJson :: resolve all deferred promises: "+deferredPromisesGetPromotionReferences.length);for(c=0;c<deferredPromisesGetPromotionReferences.length;c++)deferredPromisesGetPromotionReferences[c].resolve();deferredPromisesGetPromotionReferences=[]}).catch(function(c){getPromotionReferencesCallInProgress=
!1;a.cs_commonLogger("getPromotionsJson :: reject all deferred promises: "+deferredPromisesGetPromotionReferences.length);for(c=0;c<deferredPromisesGetPromotionReferences.length;c++)deferredPromisesGetPromotionReferences[c].reject();deferredPromisesGetPromotionReferences=[]}));return b.promise},getPromotionsJsonWS:function(){var a=this;this.cs_commonLogger("in getPromotionsJsonWS...");var b=Q.defer();null==this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.CUSTOM_PROMOTIONS)?this.initialize("from getPromotionsJson").then(function(c){a.cs_commonLogger("calling getPromotionsJson");
c="/bin/sd/cache/commerce/custompromotions."+a.getLocale().toLowerCase()+".json";fetch(c).then(function(d){return d.json()}).then(function(d){a.setSessionVariable(a.$data.COMMERCE_CONSTANTS.CUSTOM_PROMOTIONS,d);a.cs_commonLogger("promotions json added to session");b.resolve()}).catch(function(d){a.createErrorObject(b,"failed to get promotions json from service :: "+d.message,null)})}).catch(function(c){a.createErrorObject(b,"failed to initialize so cannot get promotions json",null)}):(this.cs_commonLogger("promotions json found in session"),
b.resolve());return b.promise},getUser:function(){var a=this;this.cs_commonLogger("in getUser...");if(this.getPurchasableCatalog()){this.cs_commonLogger("catalog is purchasable, so going to get user details.");var b=Q.defer();deferredPromisesGetUser.push(b);getUserCallInProgress?this.cs_commonLogger("get user call in progress"):(getUserCallInProgress=!0,this.getUserWS().then(function(c){getUserCallInProgress=!1;a.cs_commonLogger("getuser :: resolve all deferred promises: "+deferredPromisesGetUser.length);
for(c=0;c<deferredPromisesGetUser.length;c++)deferredPromisesGetUser[c].resolve();deferredPromisesGetUser=[]}).catch(function(c){getUserCallInProgress=!1;a.cs_commonLogger("getuser :: reject all deferred promises: "+deferredPromisesGetUser.length);for(c=0;c<deferredPromisesGetUser.length;c++)deferredPromisesGetUser[c].reject();deferredPromisesGetUser=[]}));return b.promise}this.cs_commonLogger("catalog is not purchasable, so not going to get user details.");return null},getCategoryListing:function(a){var b=
this;this.cs_commonLogger("in getCategoryListing...");var c=Q.defer();this.initialize("from getCategoryListing").then(function(d){b.cs_commonLogger("calling get category listing service");d=b.generateServiceURL("/products/search",a);var f=document.querySelector("#commonUtilLoad").getAttribute("data-loadclpfromsolr"),k=document.querySelector("#commonUtilLoad").getAttribute("data-clpsolrservleturl");"true"==f&&(d=k+"?"+a+"\x26locale\x3d"+b.getLocale().toLowerCase());-1<b.getCommerceLang().indexOf("en_IN")&&
(d=d.replace(/&customerId=(.*)?&/gm,"\x26"));fetch(d,{credentials:"include"}).then(function(h){b.cs_commonLoggerObj("category listing response received",h);if(b.isResponseTypeJson(h))return h.json();b.createErrorObject(c,"Get category listing response object is not of type JSON",h)}).then(function(h){var l=[],p=[],q;for(q in h.products)h.products[q].pagePath&&h.products[q].listOfSkuId?(l.push(h.products[q].code),p.push(h.products[q])):b.cs_errorLogger("For product ["+h.products[q].code+"] no product reference info found, so removing it from the product list.");
h.products=p;b.cs_commonLogger("count of all base products: "+l.length);l=l.filter(function(t){return null==b.getSessionVariable(t)});b.getPurchasableCatalog()&&l&&0<l.length?b.getProductPrice(l.toString()).then(function(){b.cs_commonLogger("base product pricing received.");c.resolve(h)}).catch(function(t){b.createErrorObject(null,"failed to get base product's variants price",null);b.cs_commonLogger("base product pricing was NOT received, even then storing category listing response in session as failure in price should not impact category listing.");
c.resolve(h)}):c.resolve(h)}).catch(function(h){b.createErrorObject(c,"failed to get category listing from service :: "+h.message,null)})}).catch(function(d){b.createErrorObject(c,"failed to initialize so cannot get category listing",null)});return c.promise},getCategoryListingWithoutFiltering:function(a){var b=this;this.cs_commonLogger("in getCategoryListing...");var c=Q.defer();this.initialize("from getCategoryListing").then(function(d){b.cs_commonLogger("calling get category listing service");
d=b.generateServiceURL("/products/search",a);var f=document.querySelector("#commonUtilLoad").getAttribute("data-loadclpfromsolr"),k=document.querySelector("#commonUtilLoad").getAttribute("data-clpsolrservleturl");"true"==f&&(d=k+"?"+a+"\x26locale\x3d"+b.getLocale().toLowerCase());-1<b.getCommerceLang().indexOf("en_IN")&&(d=d.replace(/&customerId=(.*)?&/gm,"\x26"));fetch(d,{credentials:"include"}).then(function(h){b.cs_commonLoggerObj("category listing response received",h);if(b.isResponseTypeJson(h))return h.json();
b.createErrorObject(c,"Get category listing response object is not of type JSON",h)}).then(function(h){var l=[],p;for(p in h.products)l.push(h.products[p].code);b.cs_commonLogger("count of all base products: "+l.length);b.getPurchasableCatalog()&&l&&0<l.length?b.getProductPrice(l.toString()).then(function(){b.cs_commonLogger("base product pricing received.");c.resolve(h)}).catch(function(q){b.createErrorObject(null,"failed to get base product's variants price",null);b.cs_commonLogger("base product pricing was NOT received, even then storing category listing response in session as failure in price should not impact category listing.");
c.resolve(h)}):c.resolve(h)}).catch(function(h){b.createErrorObject(c,"failed to get category listing from service :: "+h.message,null)})}).catch(function(d){b.createErrorObject(c,"failed to initialize so cannot get category listing",null)});return c.promise},getUserWS:function(){var a=this;this.cs_commonLogger("in getUserWS...");var b=Q.defer();this.initialize("from getUserWS",!0).then(function(c){a.cs_commonLogger("calling get user service");var d=a.getSessionVariable(a.$data.COMMERCE_CONSTANTS.USER_DETAILS);
null==d?(a.cs_commonLogger("userDetails not found in session"),c=a.generatePlatformURL("favorites/getUser"),fetch(c,{credentials:"include"}).then(function(f){a.cs_commonLoggerObj("user response received",f);if(a.isResponseTypeJson(f))return f.json();a.createErrorObject(b,"Get user response object is not of type JSON",f)}).then(function(f){if(d=f)a.cs_commonLogger("userDetails returned from service, storing in session."),a.setSessionVariable(a.$data.COMMERCE_CONSTANTS.USER_DETAILS,f);a.isLoyaltyProgramEnabled&&
(a.cs_commonLogger("invoke displayLoyaltyInfoOnBar from userDetails"),a.displayLoyaltyInfoOnBar());b.resolve()}).catch(function(f){a.cs_commonLogger("userDetails not returned from service, means that user is anonymous.");a.setSessionVariable(a.$data.COMMERCE_CONSTANTS.USER_DETAILS,a.$data.COMMERCE_CONSTANTS.EMPTY_USER_JSON);a.createErrorObject(b,"failed to get user details from service",null)})):(a.cs_commonLogger("userDetails found in session"),b.resolve())});this.cs_commonLogger("returning userDetailsws promise");
return b.promise},addConsentForUser:function(a,b,c){var d=this;this.cs_commonLogger("in addConsentForUser...");var f=Q.defer();a&&b&&c?this.initialize("from addConsentForUser").then(function(k){var h=this;this.cs_commonLogger("calling add consent service");var l={email:a,popupType:b,consent:c};k=Object.keys(l).map(function(p){return encodeURIComponent(p)+"\x3d"+encodeURIComponent(l[p])}).join("\x26");fetch(this.generatePlatformURL("user/consent-update"),{credentials:"include",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},
body:k}).then(function(p){h.cs_commonLoggerObj("consent service returned response : ",p);h.isResponseTypeJson(p)?f.resolve():h.createErrorObject(f,"Add consent for user response object is not of type JSON",p)}).catch(function(p){h.createErrorObject(f,"failed to add consent for user :: "+p.message,null)})}).catch(function(k){d.createErrorObject(f,"failed to initialize so cannot add add consent for user",null)}):this.createErrorObject(f,"email or popupType or consent value is empty so cannot add consent for user",
null);return f.promise},getBaseProductInfoForCLP:function(a,b,c){var d=this;this.cs_commonLogger("in getBaseProductInfoForCLP...");this.cs_commonLogger("baseProductId: "+a);this.cs_commonLogger("allVariantsOfBaseProduct: "+b);var f=Q.defer();this.initialize("from getBaseProductInfoForCLP").then(function(k){if(null==d.getSessionVariable(a))if(d.cs_commonLogger("base product ["+a+"] info not found in session"),b&&0<b.length){var h={};h.code=a;h.variants=b;d.getProductPrice(b.toString()).then(function(){d.cs_commonLogger("base product variants pricing received");
var l=0,p="",q=!0,t;for(t in b){var u=b[t];try{var C=d.getSessionVariable(u),E=C.prices.sale.amount?C.prices.sale.amount:0;if(q||E<l)l=E,p=u,q=!1;d.cs_commonLogger("for ["+h.code+"] "+u+" price \x3d "+E+", minPrice \x3d "+l+", minPricedSKU \x3d "+p)}catch(F){d.createErrorObject(null,"Error while getting base product variant's price information for sku ["+u+"]: "+F.message,null)}}h.minPricedSKU=p;d.cs_commonLoggerObj("baseProductObject after adding min priced variant",h);d.updateBaseProductObjectForCLP(f,
h,c)}).catch(function(l){d.createErrorObject(null,"failed to get base product's variants ["+b.toString()+"] price",null);d.updateBaseProductObjectForCLP(f,h,c)})}else d.createErrorObject(f,"failed to get variants pricing information of base product ["+a+"] because variants information is not provided.",null);else d.cs_commonLogger("base product ["+a+"] info found in session"),f.resolve()}).catch(function(k){d.createErrorObject(f,"failed to initialize so cannot get base product ["+a+"] information",
null)});return f.promise},updateBaseProductObjectForCLP:function(a,b,c){var d=this;b.pageTitle=c.pageTitle;b.pagePath=c.pagePath;b.pageImage=c.urlFileReference&&""!=c.urlFileReference?c.urlFileReference:"/content/dam/sandisk/en-us/portal-assets/icons/default_product.png";b.categories=JSON.parse(c.refCategories);b.hideProductReviews=c.hideProductReviews;b.isNotService=!0;c.categories&&c.categories.forEach(function(f){"cat_services"==f.code&&(b.isNotService=!1,d.cs_commonLoggerObj(b.code,"is service"))});
this.cs_commonLoggerObj("final base product ["+b.code+"] adding to session storage",b);this.setSessionVariable(b.code,b);a.resolve()},getDomain:function(){var a=window.location.href;a=a.includes("preview.sandisk.com")?"https://preview.sandisk.com/":a.includes("localhost")||a.includes("www-dev.sandisk.com")||a.includes("author-p156201-e1657307.adobeaemcloud.com")?"https://www-dev.sandisk.com/":a.includes("www-uat.sandisk.com")||a.includes("author-p156201-e1699748.adobeaemcloud.com")?"https://www-uat.sandisk.com/":
a.includes("www.sandisk.com")||a.includes("author-p156201-e1699816.adobeaemcloud.com")?"https://www.sandisk.com/":"https://www-uat.sandisk.com/";var b="en-us"==this.getLocale().toLowerCase()?"":this.getLocale().toLowerCase()+"/";return a+b},getUtmQueryParams:function(){var a=window.location.search,b=new URLSearchParams;if(""!=a){a=a.substring(1);a=a.split("\x26");for(var c=0;c<a.length;c++)if(a[c].startsWith("utm_")){var d=a[c].split("\x3d");b.set(d[0],d[1])}}b=""!=b.toString()?decodeURIComponent(b.toString()):
"";this.cs_commonLogger("utmQueryParameterString: "+b);return b},setSolrSessionVariable:function(a,b){a=this.getCommercePrefix()+"solr_"+a.trim();sessionStorage.setItem(a,JSON.stringify(b));this.cs_commonLogger("created session item: "+a)},createSolrSessionObj:function(a,b){var c={};c.primaryImage=a.primaryImage;c.pagePath=a.pagePath_s;c.pageTitle=a.title[0];c.code=a.baseProductId_s;c.variants=a.skuId;var d={};b.forEach(function(f){f.baseProductId_s==a.baseProductId_s&&"Variant"==f.documentType[0]&&
(d[f.id]=f.primaryImage)});c.assetMapping=d;this.setSolrSessionVariable(a.baseProductId_s,c)},getBaseProductInfoFromSolr:function(a,b){var c=this;this.cs_commonLogger("in getBaseProductInfoFromSolr...");this.cs_commonLogger("baseProductId: "+a);this.cs_commonLogger("allVariantsOfBaseProduct: "+b);var d=Q.defer();if(a){var f="";a=a.split(",");a.forEach(function(k,h){f+=k;h<a.length-1&&(f+=",")});b=this.getDomain()+"tools/api/globalsearchquery?q\x3d*\x26locale\x3d"+this.getLocale().toLowerCase()+"\x26documentType\x3dProducts\x26fq\x3dbaseProductId_s:"+
f+"\x26channel\x3d"+this.getCustomerChannel();fetch(b,{method:"GET"}).then(function(k){if(k.ok)return k.json();throw Error(k.status+"-"+k.statusText);}).then(function(k){k=k.docs;c.cs_commonLogger("docs: "+k);if(k.length)for(var h=$jscomp.makeIterator(k),l=h.next();!l.done;l=h.next())l=l.value,"Products"==l.documentType&&c.createSolrSessionObj(l,k);else c.cs_commonLogger("Data not avaialble");d.resolve()}).catch(function(k){c.createErrorObject(d,"failed to get SOLR response of base product ["+a+"] - "+
k,null)})}else d.resolve(),this.cs_commonLogger("product id not valid "+a);return d.promise},getBaseProductInfo:function(a,b){var c=this;this.cs_commonLogger("in getBaseProductInfo...");this.cs_commonLogger("baseProductId: "+a);this.cs_commonLogger("allVariantsOfBaseProduct: "+b);var d=Q.defer();this.initialize("from getBaseProductInfo").then(function(f){c.cs_commonLogger("calling get product references");if(null==c.getSessionVariable(a))if(c.cs_commonLogger("base product ["+a+"] info not found in session"),
b&&0<b.length){var k={};k.code=a;k.variants=b;c.getProductPrice(b.toString()).then(function(){c.cs_commonLogger("base product variants pricing received");var h=0,l="",p=!0,q=0,t="",u=!0,C;for(C in b){var E=b[C];try{var F=c.getSessionVariable(E),K=F.prices.sale.amount?F.prices.sale.amount:0,G=F.percentageOff?F.percentageOff:0;if(p||K<h)h=K,l=E,p=!1;0<G&&(u||G>q)&&(q=G,t=E,u=!1);c.cs_commonLogger("for ["+k.code+"] "+E+" price \x3d "+K+", minPrice \x3d "+h+", minPricedSKU \x3d "+l);c.cs_commonLogger("for ["+
k.code+"] "+E+" discountPercentage \x3d "+G+", maxDiscountPercentage \x3d "+q+", maxDiscountPercentageSKU \x3d "+t)}catch(A){c.createErrorObject(null,"Error while getting base product variant's price information for sku ["+E+"]: "+A.message,null)}}k.minPricedSKU=l;t&&0<t.length&&(k.maxDiscountPercentageSKU=t);c.cs_commonLoggerObj("baseProductObject after adding min priced variant",k);c.updateBaseProductObjectWithProductReferences(d,k,a)},function(h){this.createErrorObject(null,"failed to get base product's variants ["+
b.toString()+"] price",null);this.updateBaseProductObjectWithProductReferences(d,k,a)}).catch(function(h){c.createErrorObject(null,"failed to get base product's variants ["+b.toString()+"] price",null);c.updateBaseProductObjectWithProductReferences(d,k,a)})}else c.createErrorObject(d,"failed to get variants pricing information of base product ["+a+"] because variants information is not provided.",null);else c.cs_commonLogger("base product ["+a+"] info found in session"),d.resolve()}).catch(function(f){c.createErrorObject(d,
"failed to initialize so cannot get base product ["+a+"] information",null)});return d.promise},updateBaseProductObjectWithProductReferences:function(a,b,c){var d=this,f=b.code;this.getProductReferences().then(function(k){d.cs_commonLogger("product references response received");var h=d.getSessionVariable(d.$data.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);h&&h[f]?(d.cs_commonLoggerObj("mapping product page found for sku: "+f,h[f]),b.pageTitle=h[f].pageTitle,b.pagePath=h[f].pagePath,b.pageImage=h[f].urlFileReference,
b.categories=h[f].categories,b.hideProductReviews=h[f].hideProductReviews,d.cs_commonLoggerObj("baseProductObject after product page reference",b)):d.cs_errorLogger("mapping product page NOT found for sku: "+f);if(b.minPricedSKU&&h[b.minPricedSKU]){k=h[b.minPricedSKU].categories;var l=[],p;for(p in k){var q=k[p];l.push(q.data[0].id)}b.minPriceSKUCategories=l;d.cs_commonLoggerObj("categories for minPricedSKU",b.minPriceSKUCategories)}else d.cs_errorLogger("minPricedSKU not available for ["+f+"]");
if(b.maxDiscountPercentageSKU&&h[b.maxDiscountPercentageSKU]){k=h[b.maxDiscountPercentageSKU].categories;h=[];for(p in k)q=k[p],h.push(q.data[0].id);b.maxDiscountPercentageSKUCategories=h;d.cs_commonLoggerObj("categories for maxDiscountPercentageSKU",b.maxDiscountPercentageSKU)}else d.cs_errorLogger("maxDiscountPercentageSKU not available for ["+f+"]");d.cs_commonLoggerObj("final base product ["+c+"] adding to session storage",b);d.setSessionVariable(c,b);a.resolve()},function(k){d.createErrorObject(a,
"failed to get product reference for base product ["+c+"] info",k)})},getRelatedProductsDetail:function(a,b){var c=this;this.cs_commonLogger("in getRelatedProductsDetail..."+a);var d=Q.defer();b=null!=b?!0:!1;a&&0<a.length?null!=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.REL_PROD+a)?(this.cs_commonLogger("related product ["+a+"] info found in session."),d.resolve()):(this.cs_commonLogger("related product ["+a+"] info NOT found in session, get it from service."),this.initialize("from getRelatedProductsDetail").then(function(f){c.cs_commonLogger("calling product reference service");
fetch(c.generateServiceURL("/products/"+a+"/relations","","BASIC"),{credentials:"include"}).then(function(k){c.cs_commonLoggerObj("related product response received",k);if(c.isResponseTypeJson(k))return k.json();c.createErrorObject(d,"Related product response object is not of type JSON",k)}).then(function(k){var h=[],l;for(l in k.references){var p={},q=k.references[l],t=q.referenceType;c.cs_commonLogger("referenceType: "+t);p.refType=t;var u=q.description;c.cs_commonLogger("referenceDesc: "+u);p.refDesc=
u;p.superPromoDescription=q.superPromoDescription?q.superPromoDescription:null;u=q.target.code;c.cs_commonLogger("baseRelatedProductId: "+u);p.code=u;if(b)c.getSessionVariable(p.code);else{u=[];for(var C in q.target.variantOptions)u.push(q.target.variantOptions[C].code);c.cs_commonLogger("variantRelatedProductIds: "+u);p.variants=u}b&&"SERVICE"==t?c.cs_commonLogger("Removing Service products from related prorducts: "):h.push(p)}c.cs_commonLoggerObj("relatedProductsObject initialize",h);c.setSessionVariable(c.$data.COMMERCE_CONSTANTS.REL_PROD+
a,h);d.resolve()}).catch(function(k){c.createErrorObject(d,"failed to get related product information : "+k.message,null)})}).catch(function(f){c.createErrorObject(d,"failed to initialize so cannot get related products detail",null)})):this.createErrorObject(d,"baseProductId is empty so cannot get related products detail",null);return d.promise},getAppyNowTreviPayURL:function(){var a="";if(this.getPurchasableCatalog()&&this.getCustomerChannel()==this.$data.COMMERCE_CONSTANTS.B2B){this.cs_commonLogger("catalog is purchasable for b2b channel");
a=this.getPlatformCommerceCreditURL()+"/";a+=this.getLanguage().toLowerCase()+"-"+this.getCountry();var b=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.USER_DETAILS);if(b&&b.customerChannel==this.$data.COMMERCE_CONSTANTS.B2B&&b.uid&&"undefined"!=typeof b.uid&&b.b2bUnitId&&"undefined"!=typeof b.b2bUnitId){var c=b.uid;b=b.b2bUnitId;this.cs_commonLogger("customerEmail: "+c);this.cs_commonLogger("b2bUnitId: "+b);a+="/apply?client_reference_customer_id\x3d"+encodeURIComponent(b);a+="\x26client_reference_buyer_id\x3d"+
encodeURIComponent(c)}else return this.cs_commonLogger("Trevipay Apply now link is empty as uid or b2bUnitId is null."),"";a+="\x26ecommerce_url\x3d"+this.gotoBusinessCommerceURL("my-account/credits")}return a},heartbeat:function(){var a=this;if(-1<this.getHeartbeatTimeoutPeriod()){this.cshb_commonLogger("heartbeat check is enabled");var b=this.getCookie("Channel");if(b){var c=this.getPlatformCommerceURL()+"/";"us"!=this.getCountry().toLowerCase()&&(c+=this.getLanguage().toLowerCase()+"-"+this.getCountry().toLowerCase()+
"/");c+="store/"+this.getPathFromCustomerChannel(b)+"heartbeat/getChannel";fetch(c,{method:"GET"}).then(function(d){return d.json()}).then(function(d){d=d.channel;b!=d?(Cookies.remove(a.$data.COMMERCE_CONSTANTS.CHANNEL_COOKIE),Cookies.remove(a.$data.COMMERCE_CONSTANTS.LOGIN_POPUP_COOKIE),a.removeAllSessionVariable(),document.querySelector("#sessionTimedoutContainer")&&document.querySelector("#sessionTimedoutContainer").classList.remove("hidden"),a.cshb_commonLogger("heartbeat - session logged out as channelCookie: "+
b+" is not equal to channelValue: "+d)):a.cshb_commonLogger("heartbeat - still in session as channelCookie: "+b+" is equal to channelValue: "+d)}).catch(function(d){a.createErrorObject(null,"failed to get heartbeat service response - "+d,null)})}else this.cshb_commonLogger("heartbeat check suppressed as no channel cookie found.")}else this.cshb_commonLogger("heartbeat check is disabled")},getLoyaltyMemberInfo:function(a){var b=this,c=Q.defer();this.cs_commonLogger("in getLoyaltyMemberInfo...");this.getCustomerChannel()==
this.$data.COMMERCE_CONSTANTS.B2B&&a&&0<a.trim().length?null==this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.LOYALTY_DETAILS)?(this.cs_commonLogger("loyalty details doesnt exist in session storage, fetching it first."),fetch("/bin/sd/zin.json?memberId\x3d"+a+"\x26pagePath\x3d"+document.querySelector("#commonUtilLoad").getAttribute("data-currentPagePath"),{credentials:"include"}).then(function(d){return d.json()}).then(function(d){b.setSessionVariable(b.$data.COMMERCE_CONSTANTS.LOYALTY_DETAILS,
d);b.cs_commonLogger("loyalty details added in session storage");c.resolve()}).catch(function(d){b.createErrorObject(c,"failed to get loyalty information for memberId: "+a+" from service :: "+d.message,null)})):(this.cs_commonLogger("loyalty details exists in session storage."),c.resolve()):(this.cs_commonLogger("Not invoking loyalty api call as channel ("+this.getCustomerChannel()+") is not B2B or memberId ("+a+") is not valid"),c.resolve());return c.promise},displayLoyaltyInfoOnBar:function(){var a=
this;this.cs_commonLogger("in displayLoyaltyInfoOnBar...");var b=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.USER_DETAILS);b&&b.loyaltyMemberId&&b.loyaltyOptIn?(b=b.loyaltyMemberId,this.cs_commonLogger("loyalty memberId: "+b),this.getLoyaltyMemberInfo(b).then(function(c){var d=a.getSessionVariable(a.$data.COMMERCE_CONSTANTS.LOYALTY_DETAILS);if(document.getElementById("loyalty-points-container")){a.cs_commonLogger("loyaltyInfo in session storage: "+JSON.stringify(d));c=d.loyaltyTierId?d.loyaltyTierId:
"";var f=d.memberStatusTranslated?d.memberStatusTranslated:"",k=d.availablePoints?d.availablePoints:"";d=d.pointsTextTranslated?d.pointsTextTranslated:"";k&&0<k.length&&(k=(new Intl.NumberFormat(a.getLocale())).format(k)+" "+d,document.getElementById("loyalty-points-container").innerHTML="\x3cspan class\x3d'font-medium "+c+"'\x3e"+f+"\x3c/span\x3e\x3cspan class\x3d'zrl_delimiter'\x3e\x26nbsp; |\x26nbsp; \x3c/span\x3e\x3cspan class\x3d'zrl_points'\x3e"+k+"\x3c/span\x3e")}else a.cs_commonLogger("Loyalty points container not found.")})):
this.cs_commonLogger("Not invoking loyalty api call as memberId is null.")},initialize:function(a,b){var c=this;this.cs_commonLogger("in initialize..."+a);var d=Q.defer();-1<this.getHeartbeatTimeoutPeriod()&&this.heartbeat();a=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.INVALIDATION_TIMEOUT);var f=(new Date).getTime();null==a?(this.cs_commonLogger("invalidationTimeout doesn't exist in session storage"),f+=6E4*this.getInvalidationTimeout(),this.setSessionVariable(this.$data.COMMERCE_CONSTANTS.INVALIDATION_TIMEOUT,
f),this.cs_commonLogger("invalidationTimeout set as: "+f)):(this.cs_commonLogger("invalidationTimeout exists in session storage"),this.cs_commonLogger("invalidationTimeout: "+a),this.cs_commonLogger("currentTimeInMilliseconds: "+f),a<f?(this.cs_commonLogger("out of session"),this.removeAllSessionVariable(),this.cs_commonLogger("empty session storage")):this.cs_commonLogger("within session"));b?(this.cs_commonLogger("do not force user details to load first"),d.resolve()):(b=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.USER_DETAILS),
this.getPurchasableCatalog()&&null==b?(this.cs_commonLogger("user details doesnt exist, fetching it first."),this.getUser().then(function(k){c.cs_commonLogger("get user success from initialize method...");c.cs_commonLogger("fetched user detail first, now continue to other calls");d.resolve()}).catch(function(k){c.cs_commonLogger("in initialize() :: error fetching user details");d.resolve()})):(this.cs_commonLogger("get user success from initialize method..."),d.resolve()));return d.promise},getSessionVariable:function(a){if("productReferences"==
a&&(navigator.vendor&&-1<navigator.vendor.indexOf("Apple")&&navigator.userAgent&&-1==navigator.userAgent.indexOf("FxiOS")||navigator.vendor&&-1<navigator.vendor.indexOf("Apple")&&navigator.userAgent&&-1<navigator.userAgent.indexOf("FxiOS")||this.excludeProductReferenceFromSession()||!this.isPublishInstance())){if(""!=prodRef)return prodRef;this.getProductReferences().then(function(b){return prodRef})}else try{return a=this.getCommercePrefix()+a.trim(),null==sessionStorage.getItem(a)||this.$data.COMMERCE_CONSTANTS.EMPTY==
sessionStorage.getItem(a)?null:JSON.parse(sessionStorage.getItem(a))}catch(b){return null}},excludeProductReferenceFromSession:function(){return"true"==document.querySelector("#commonUtilLoad").getAttribute("data-excludeProductReferenceFromSession")?!0:!1},setSessionVariable:function(a,b){sessionStorage.setItem(this.getCommercePrefix()+a.trim(),JSON.stringify(b))},removeSessionVariable:function(a){sessionStorage.removeItem(a)},removeAllSessionVariable:function(){this.cs_commonLogger("remove all commerce keys from session storage");
for(var a=sessionStorage.length;a--;){var b=sessionStorage.key(a).trim();0==b.indexOf(this.getCommercePrefix())?(this.removeSessionVariable(b),this.cs_commonLogger("remove key: "+b)):this.cs_commonLogger("keep key: "+b)}},removeRedundantSessionVariables:function(){this.cs_commonLogger("remove redundant session variables that are not matching the current locale from the session storage");for(var a=sessionStorage.length;a--;){var b=sessionStorage.key(a).trim();0<=b.indexOf(this.$data.COMMERCE_CONSTANTS.COMMERCE_PREFIX)&&
(0<=b.indexOf(this.getCommercePrefix())?this.cs_commonLogger("keep key: "+b):(this.removeSessionVariable(b),this.cs_commonLogger("remove key: "+b)))}},createErrorObject:function(a,b,c){var d={};d.status=c?c.status:-1;d.statusText=c?c.statusText:"this is not a service response error but custom processing error";d.responseText=b+(c?", serviceResponseText: "+c.responseText:this.$data.COMMERCE_CONSTANTS.EMPTY);this.cs_errorLogger(JSON.stringify(d));c&&401==c.status&&(this.removeAllSessionVariable(),window.location.replace(this.gotoCommerceURL("login")));
if(a)return a.reject(d),a.promise},isResponseTypeJson:function(a){a=a.headers.get("content-type");this.cs_commonLoggerObj("contentTypeHeader",a);return a?a?-1<a.indexOf("json"):!1:!0},getInvalidationTimeout:function(){var a=document.getElementById("commerceLoad").getAttribute("data-session-timeout");this.cs_commonLogger("invalidationTimeout: "+a);return a},cs_commonLogger:function(a){-1<window.location.search.indexOf("debugCommerce\x3dtrue")&&console.log("CSH: "+a)},cshb_commonLogger:function(a){-1<
window.location.search.indexOf("debugCommerce\x3dtrue")&&console.log("CSH: "+a);-1<window.location.search.indexOf("debugHeartbeat\x3dtrue")&&console.log("heartbeat: "+a)},cs_errorLogger:function(a){-1<window.location.search.indexOf("debugCommerce\x3dtrue")&&console.log(a)},cs_commonLoggerObj:function(a,b){-1<window.location.search.indexOf("debugCommerce\x3dtrue")&&(console.log("CSH: "+a+"-\x3e"),console.log(b))}}};
!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):(a=a||self,function(){var c=a.Cookies,d=a.Cookies=b();d.noConflict=function(){return a.Cookies=c,d}}())}(this,function(){function a(b){for(var c=1;c<arguments.length;c++){var d=arguments[c],f;for(f in d)b[f]=d[f]}return b}return function f(c,d){function k(h,l,p){if("undefined"!=typeof document){"number"==typeof(p=a({},d,p)).expires&&(p.expires=new Date(Date.now()+
864E5*p.expires));p.expires&&(p.expires=p.expires.toUTCString());h=encodeURIComponent(h).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var q="",t;for(t in p)p[t]&&(q+="; "+t,!0!==p[t]&&(q+="\x3d"+p[t].split(";")[0]));return document.cookie=h+"\x3d"+c.write(l,h)+q}}return Object.create({set:k,get:function(h){if("undefined"!=typeof document&&(!arguments.length||h)){for(var l=document.cookie?document.cookie.split("; "):[],p={},q=0;q<l.length;q++){var t=l[q].split("\x3d"),
u=t.slice(1).join("\x3d");try{var C=decodeURIComponent(t[0]);if(p[C]=c.read(u,C),h===C)break}catch(E){}}return h?p[h]:p}},remove:function(h,l){k(h,"",a({},l,{expires:-1}))},withAttributes:function(h){return f(this.converter,a({},this.attributes,h))},withConverter:function(h){return f(a({},this.converter,h),this.attributes)}},{attributes:{value:Object.freeze(d)},converter:{value:Object.freeze(c)}})}({read:function(c){return'"'===c[0]&&(c=c.slice(1,-1)),c.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},
write:function(c){return encodeURIComponent(c).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})});var languageList=[],defaultLanguage={};
document.addEventListener("DOMContentLoaded",function(){var a=document.getElementById("commonUtilLoad"),b=a.getAttribute("data-regionSelectorExcelPath"),c=a.getAttribute("data-country");a=a.getAttribute("data-language");var d=getCookie("X-COUNTRY-CODE"),f=c&&a?a+"-"+c.toLowerCase():void 0,k="";"undefined"!=sessionStorage.getItem("wd-regionSelectorData")&&null!=sessionStorage.getItem("wd-regionSelectorData")?(k=JSON.parse(sessionStorage.getItem("wd-regionSelectorData"))[0].data,createDataForBar(k,
d),showRegionSelector(c,d,f)&&createLanguageBar()):b&&fetch(b,{method:"GET",headers:{"Content-Type":"application/json"}}).then(function(h){if(200==h.status&&isResponseTypeJson(h))return h.json();console.error("The response for resgion selector excel is not a json/response status is 400")}).then(function(h){sessionStorage.setItem("wd-regionSelectorData",JSON.stringify(h));k=h[0].data;createDataForBar(k,d);showRegionSelector(c,d,f)&&createLanguageBar()}).catch(function(h){console.log("failed to get region selector details")});
document.querySelectorAll(".region-selection-bar .optionToggle").forEach(function(h){h.addEventListener("click",function(l){l=document.querySelectorAll(".region-selection-bar .selectDropdown li");var p=document.querySelector(".selectedOption \x3e a").textContent;l.forEach(function(q){var t=q.querySelector("a").textContent;p===t&&(Array.from(q.parentNode.children).forEach(function(u){u!==q&&u.classList.remove("hidden")}),q.classList.add("hidden"))})})})});
function createDataForBar(a,b){a.forEach(function(c,d){c.Country_code===b&&(languageList.push(c),c.default&&"true"==c.default.toLowerCase()&&(defaultLanguage=c))})}
function createLanguageBar(){var a=document.createElement("section");a.setAttribute("dir",defaultLanguage.dir);a.classList.add("relative","section","bg-grey-4","text-white","py-3","region-selection-bar");var b=document.createElement("div");b.classList.add("relative","container","contain","mx-auto");var c=document.createElement("div");c.classList.add("row","grid-12","xs:grid-12","sm:grid-12","md:grid-12","lg:grid-12","xl:grid-12","flex-wrap","md:flex","flex-wrap");var d=document.createElement("div");
d.classList.add("cols-12","md:cols-6","md:pr-4","mb-3","sm:mb-6","md:mb-0","pr-10","self-center","text-sm","sm:text-base");d.textContent=defaultLanguage.Redirect_message;c.append(d);d=document.createElement("div");d.classList.add("cols-12","md:cols-6","md:pl-4","xs:inline-flex","self-center");var f=document.createElement("div");f.classList.add("dropdownSelectOption","flex-1","relative");var k=document.createElement("div");k.classList.add("optionToggle","rounded-none","border","border-grey-2","w-full",
"appearance-none","relative","cursor-pointer");var h=document.createElement("span");h.classList.add("selectedOption","pt-px","block");var l=document.createElement("a");l.classList.add("px-2","py-3","block","w-full");l.setAttribute("aria-label",defaultLanguage.Country_title);l.append(defaultLanguage.Country_title);h.append(l);k.append(h);h=document.createElement("div");h.classList.add("pointer-events-none","absolute","pin-y","pin-r","mt-1","flex","items-center","px-2","caret-icon");h.innerHTML+="\x3csvg width\x3d'13' height\x3d'7' viewBox\x3d'0 0 13 7' fill\x3d'none' xmlns\x3d'http://www.w3.org/2000/svg'\x3e\x3cpath d\x3d'M1.50151 0L6.09377 3.84378L10.686 0L12.0967 1.18335L6.09377 6.21887L0.0908203 1.18335L1.50151 0Z' fill\x3d'currentcolor'\x3e\x3c/path\x3e\x3c/svg\x3e";
k.append(h);f.append(k);var p=document.createElement("ul");p.classList.add("list-reset","selectDropdown","p-0","absolute","w-full","pin-l","z-20","hidden");languageList.forEach(function(q,t){var u=document.createElement("li");u.classList.add("border-l","border-r","border-b","border-grey-2","cursor-pointer","bg-grey-3");0==t&&u.classList.add("selected");u.setAttribute("lang",getRedirectURL(q.Locale));t=document.createElement("a");t.classList.add("px-2","py-3","block","w-full");t.setAttribute("aria-label",
q.Country_title);t.append(q.Country_title);u.append(t);p.append(u)});k=document.createElement("li");k.classList.add("border-l","border-r","border-b","border-grey-2","cursor-pointer","bg-grey-3");k.setAttribute("lang","/en-us/region-selector");h=document.createElement("a");h.classList.add("px-2","py-3","block","w-full");h.setAttribute("aria-label",defaultLanguage.region_selector_message);l=document.createElement("img");l.setAttribute("src","/content/dam/sandisk/en-us/portal-assets/logos/shop-sandisk-fav-icon.ico");
l.setAttribute("alt",defaultLanguage.Country_title);l.setAttribute("height","18");l.classList.add("mx-2");h.append(l);h.append(defaultLanguage.region_selector_message);k.append(h);p.append(k);f.append(p);d.append(f);f=document.createElement("a");f.setAttribute("href",getRedirectURL(defaultLanguage.Locale));f.setAttribute("role","button");f.setAttribute("tabindex","0");f.classList.add("btn","text-white","bg-blue","inline-flex","items-center","border","border-blue","py-3","px-10","font-medium","text-sm",
"xs:ml-4","w-full","xs:w-auto","justify-center","mt-3","xs:mt-0");f.textContent=defaultLanguage.continue_text;d.append(f);f.addEventListener("click",function(q){q=q.currentTarget;var t=q.getAttribute("href");t.includes("/en-us/region-selector")||q.setAttribute("href",t+window.location.search)});f=document.createElement("button");f.classList.add("p-2","cursor-pointer","ml-2","absolute","pin-t-0","pin-r-20","md:relative","md:pin-r-0","region-selector-close-btn");f.setAttribute("aria-label","Close button");
f.setAttribute("tabindex","0");f.innerHTML+="\x3csvg class\x3d'flex-2' width\x3d'20' height\x3d'20' viewBox\x3d'0 0 31 31' fill\x3d'none' xmlns\x3d'http://www.w3.org/2000/svg'\x3e\x3cpath fill-rule\x3d'evenodd' clip-rule\x3d'evenodd' d\x3d'M15.2033 13.0819L2.12132 0L0 2.12132L13.0819 15.2032L0.000862062 28.2843L2.12219 30.4056L15.2033 17.3245L28.2843 30.4056L30.4056 28.2842L17.3246 15.2032L30.4065 2.12136L28.2852 4.14252e-05L15.2033 13.0819Z' fill\x3d'white'\x3e\x3c/path\x3e\x3c/svg\x3e";f.addEventListener("click",
function(q){regionSelectorClose()});d.append(f);c.append(d);b.append(c);a.append(b);document.querySelector("header").prepend(a)}var liElementsOnSelectDropDown=document.querySelector(".region-selection-bar .selectDropdown \x3e li");null!=liElementsOnSelectDropDown&&"undefined"!=typeof liElementsOnSelectDropDown&&(liElementsOnSelectDropDown.forEach(function(a){liElementsOnSelectDropDown.removeEventListener("click",null)}),liElementsOnSelectDropDown.forEach(function(a){a.addEventListener("click",function(b){setRedirectUrl(b.currentTarget)})}));
document.addEventListener("click",function(a){a=a.target.closest(".region-selection-bar .selectDropdown \x3e li");null!=a&&"undefined"!=typeof a&&setRedirectUrl(a)});
function getRedirectURL(a){var b=document.getElementById("commonUtilLoad").getAttribute("data-currentPagePath");if(null!=b&&""!=b&b.startsWith("/content/experience-fragments")&&window.location.pathname.includes("/store/"))if("en-in"!=a){if(window.location.pathname.startsWith("/store/"))return"/"+a+window.location.pathname;if(window.location.pathname.includes("/store/")&&"en-us"!=a)return b=window.location.pathname.split("/"),b[1]=a,b.join("/");if(window.location.pathname.includes("/store/")&&"en-us"==
a)return window.location.pathname.substring(6)}else{a="https://indiastore.sandisk.com";if(window.location.href.includes("www-uat")||window.location.href.includes("www-dev"))a="https://indiastore-stage.sandisk.com";return window.location.pathname.startsWith("/store/")?a+window.location.pathname:a+window.location.pathname.substring(6)}if(null!=b&&""!=b&b.startsWith("/content/experience-fragments")&&document.querySelector(".AEM-React-Pages")){b=document.getElementById("commonUtilLoad").getAttribute("data-locale");
if("en-us"==b.toLowerCase()&&"en-us"!=a)return"/"+a+window.location.pathname;if("en-us"!=b.toLowerCase()&&"en-us"!=a)return b=window.location.pathname.split("/"),b[1]=a,b.join("/");if("en-us"!=b.toLowerCase()&&"en-us"==a)return window.location.pathname.substring(6)}else return b=b.split("/"),b[3]=a,rewriteRegionSelectorPageURL(b.join("/"))}
function rewriteRegionSelectorPageURL(a){var b=document.querySelector("#commonUtilLoad").getAttribute("data-rootPathToReplaceInURL");return a&&-1<a.indexOf(b)?isPublishInstance()?a.replace(b,"").replace(".html",""):0>a.indexOf(".html")?a+".html":a:a&&-1<a.indexOf("/content/sandisk")&&-1==a.indexOf("/content/sandisk/en-us")?isPublishInstance()?a.replace("/content/sandisk","").replace(".html",""):0>a.indexOf(".html")?a+".html":a:a}
function regionSelectorClose(){for(var a=document.getElementsByClassName("region-selection-bar"),b=0;b<a.length;b++)a[b].remove();document.cookie="wd-region-selector\x3dclose; path\x3d/"}function showRegionSelector(a,b,c){return(!getCookie("wd-region-selector")||"close"!=getCookie("wd-region-selector"))&&0<languageList.length&&defaultLanguage.Locale&&a&&b&&c&&a!==b&&c!==defaultLanguage.Locale?!0:!1}
function setRedirectUrl(a){document.querySelectorAll(".region-selection-bar").forEach(function(b){b.querySelectorAll(".btn").forEach(function(c){c.setAttribute("href",a.getAttribute("lang"))})})}function getCookie(a){a+="\x3d";for(var b=document.cookie.split(";"),c=0;c<b.length;c++){for(var d=b[c];" "==d.charAt(0);)d=d.substring(1,d.length);if(0==d.indexOf(a))return d.substring(a.length,d.length)}return""}
function isResponseTypeJson(a){return(a=a.headers.get("content-type"))?a?-1<a.indexOf("json"):!1:!0}
var campaignService={data:{},mounted:function(){},methods:{getUserInfo:function(){var a=this;this.campaign_commonLogger("in getUserInfo...");var b=Q.defer();this.campaign_commonLogger("in getUserInfo... isCatalogPurchasable: "+this.getPurchasableCatalog());if(this.getPurchasableCatalog()){var c=this.getSessionVariable(this.COMMERCE_CONSTANTS.USER_DETAILS);null!=c?(this.campaign_commonLogger("in getUserInfo: user details found in session"),"undefined"!=typeof c.uid?(c=this.getSessionVariable(this.COMMERCE_CONSTANTS.USER_DETAILS),
b.resolve(c.userGroups)):b.resolve(null)):(this.campaign_commonLogger("in getUserInfo: user details not found in session"),this.getUser().then(function(d){c=a.getSessionVariable(a.COMMERCE_CONSTANTS.USER_DETAILS);null!=c&&"undefined"!=typeof c.uid?b.resolve(c.userGroups):b.resolve(null)},function(d){this.createErrorObject(b,"in getUserInfo: user info error ...",d)}))}else b.resolve(null);return b.promise},getCampaignDetails:function(a,b){var c=this;this.campaign_commonLogger("in getCampaignDetails..");
this.campaign_commonLogger("query: "+a);var d=null,f=Q.defer();b=this.createBrandQuery(b);-1<a.indexOf("{attConditionBrand}")&&(a=a.replace("{attConditionBrand}",b));var k=this.getPurchasableCatalog();this.getUserInfo().then(function(h){d=h;c.campaign_commonLogger("in getCampaignDetails functions - userGroup: "+d);h="101_property\x3dattConditionGroup\x26101_property.1_value\x3dall\x26";if(!k)a=a.replace("{attConditionGroup}\x26","");else if(null==d&k)a=a.replace("{attConditionGroup}",h+"101_property.2_value\x3danonymous");
else if(0<d.length){for(var l=0;l<d.length;l++)h=h+"101_property."+(l+2)+"_value\x3d"+d[l].id+"\x26";-1<a.indexOf("{attConditionGroup}")&&(a=a.replace("{attConditionGroup}",h))}h=c.getCurrentPagePath();a+="\x26103_property\x3durlApplicablePages\x26103_property.1_value\x3dall\x26103_property.2_value\x3d"+h;h=c.createChannelQuery(c.getCustomerChannel());-1<a.indexOf("{attCustChannel}")&&(a=a.replace("{attCustChannel}",h));c.campaign_commonLogger("updated query: "+a);fetch("/bin/sd/campaignQuery.json?"+
a,{credentials:"include"}).then(function(p){return p.json()}).then(function(p){f.resolve(p)}).catch(function(p){c.createErrorObject(f,"failed to get campaign info from service"+p.message,null)})});return f.promise},createBrandQuery:function(a){var b="";if(""!=a){if(b="102_property\x3dattConditionBrand\x26102_property.1_value\x3dall\x26",brandFilterArray=a.split(","),0<brandFilterArray.length){for(a=0;a<brandFilterArray.length;a++)b=b+"102_property."+(a+2)+"_value\x3d"+brandFilterArray[a]+"\x26";b+=
""}}else""==a&&(b="102_property\x3dattConditionBrand\x26102_property.1_value\x3dall");return b},createChannelQuery:function(a){return"104_property\x3dattCustChannel\x26104_property.1_value\x3dall\x26104_property.2_value\x3d"+a},createErrorObject:function(a,b,c){var d={};d.status=c?c.status:-1;d.statusText=c?c.statusText:"this is not a service response error but custom processing error";d.responseText=b+(c?", serviceResponseText: "+c.responseText:"");this.campaign_errorLogger(JSON.stringify(d));if(a)return a.reject(d),
a.promise},campaign_commonLogger:function(a){-1<window.location.search.indexOf("debugCampaign\x3dtrue")&&console.log("Store Campaign Service: "+a)},campaign_errorLogger:function(a){console.log(a)},campaign_commonLoggerObj:function(a,b){-1<window.location.search.indexOf("debugCampaign\x3dtrue")&&(console.log("CSH: "+a+"-\x3e"),console.log(b))}}},zinreloHelper={data:{apiKey:"",partnerId:"",jsLibraryUrl:"",isLoyaltyProgramEnabled:!1},mounted:function(){this.apiKey=document.querySelector("#commerceLoad").getAttribute("data-loyalty-api-key");
this.partnerId=document.querySelector("#commerceLoad").getAttribute("data-loyalty-partner-id");this.jsLibraryUrl=document.querySelector("#commerceLoad").getAttribute("data-zinrelo-js-library-url");this.isLoyaltyProgramEnabled="true"==document.querySelector("#commerceLoad").getAttribute("data-loyalty-program-check");this.zh_commonLoggerObj("api key",this.apiKey);this.zh_commonLoggerObj("partnerId",this.partnerId);this.zh_commonLoggerObj("jsLibraryUrl",this.jsLibraryUrl);this.zh_commonLoggerObj("isLoyaltyProgramEnabled",
this.isLoyaltyProgramEnabled)},methods:{isLoyaltyProgramEnabled:function(){return"true"==document.querySelector("#commerceLoad").getAttribute("data-loyalty-program-check")},getApiKey:function(){return document.querySelector("#commerceLoad").getAttribute("data-loyalty-api-key")},getPartnerId:function(){return document.querySelector("#commerceLoad").getAttribute("data-loyalty-partner-id")},getJsLibraryUrl:function(){return document.querySelector("#commerceLoad").getAttribute("data-zinrelo-js-library-url")},
zh_commonLoggerObj:function(a,b){-1<window.location.search.indexOf("debugCommerce\x3dtrue")&&(console.log("ZH: "+a+"-\x3e"),console.log(b))}}},EventBus=new Vue,compareTrayService={mixins:[commerceService],data:{COMPARE_CONSTANTS:{COMPARE_TRAY_COOKIE:"compareTray"},compareCookieJson:{},compareTrayArray:[],compareCount:0,skuMapping:[],modalTitle:"",variantCategoryOptions:[],alertMessage:"",primaryImage:"",selectedCats:[],comparePageLink:"",errorCodesArray:[]},mounted:function(){document.getElementById("ProductCompareTray")&&
(this.errorCodesArray=document.getElementById("ProductCompareTray").getAttribute("data-errorcodes").split(","))},methods:{addSkuToCookie:function(a,b,c){var d=this.getCompareCookie();d?(this.compareCookieJson=JSON.parse(d),this.compareCookieJson.hasOwnProperty(a)?(this.compare_commonLogger("Item already exists in the compare tray",a),this.openPopupModal(document.getElementById("ProductCompareTray").getAttribute("data-itemExists"))):4>Object.keys(this.compareCookieJson).length?this.addItemtoTray(a,
b,c):this.openPopupModal(document.getElementById("ProductCompareTray").getAttribute("data-canCompare"))):(this.compareCookieJson={},this.addItemtoTray(a,b,c))},addItemtoTray:function(a,b,c){var d=this,f=this.getCommercePrefix()+"solr_"+b.trim();if(null!=sessionStorage.getItem(f)){if(this.compareCookieJson[a]=b,this.compare_commonLogger("added to compare cookie",a),this.appendtoCompareTray(),c)try{c={};c.skuID=a;var k=window.aa.createEvent("PROD_COMPARE_INITIATE",c);window.dispatchEvent(k)}catch(h){console.log("Error while firing Analytics call for compare click: "+
h)}}else this.getBaseProductInfoFromSolr(b,[]).then(function(){var h=d.getCommercePrefix()+"solr_"+b.trim();h=sessionStorage.getItem(h);if(null!=h){d.compareCookieJson[a]=b;d.compare_commonLogger("added to compare cookie",a);d.appendtoCompareTray();try{h={};h.skuID=a;var l=window.aa.createEvent("PROD_COMPARE_INITIATE",h);window.dispatchEvent(l)}catch(p){console.log("Error while firing Analytics call for compare click: "+p)}}else d.openPopupModal(document.getElementById("ProductCompareTray").getAttribute("data-notAvailable")),
d.compare_commonLogger("sessionBaseProductInfo not available for "+b,h),l={event:"Adding to compare tray"},l.sku=a,l.reason=b+" missing in solr response",d.sendMailPctError(l)}).catch(function(h){d.showErrorPopup(h);d.compare_commonLogger("error thrown while getting sessionBaseProductInfo :: ",b);var l={event:"Adding to compare tray"};l.sku=a;l.reason=h.responseText;d.sendMailPctError(l)})},sendMailPctError:function(a){var b=this,c=window.location.href,d=document.getElementById("ProductCompareTray").getAttribute("data-emailSubject")+
" - Stage";if(c.includes("www.sandisk.com")||c.includes("author-p156201-e1699816.adobeaemcloud.com")||c.includes("preview.sandisk.com"))d=document.getElementById("ProductCompareTray").getAttribute("data-emailSubject")+" - Production";var f=new URLSearchParams(Object.entries({currentPagePath:window.location.href,emailTemplatePath:document.getElementById("ProductCompareTray").getAttribute("data-emailTemplatePath"),emailSubject:d,reason:a.reason,event:a.event,sku:a.sku?a.sku:""}));document.getElementById("ProductCompareTray").getAttribute("data-emailTo").split(",").forEach(function(k){return f.append("emailTo",
k)});(document.getElementById("ProductCompareTray").getAttribute("data-emailcc")?document.getElementById("ProductCompareTray").getAttribute("data-emailcc").split(","):[]).forEach(function(k){return f.append("emailcc",k)});a=!1;c.includes("www-uat.sandisk.com")&&"true"==document.getElementById("ProductCompareTray").getAttribute("data-enablestage")?a=!0:c.includes("www.sandisk.com")&&"true"==document.getElementById("ProductCompareTray").getAttribute("data-enableprod")&&(a=!0);a&&fetch("/bin/sd/formemail",
{credentials:"include",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:f}).then(function(k){if(k.ok)return b.isResponseJson(k)?k.json():k.text();throw Error(k.status+"-"+k.statusText);}).then(function(k){console.log(k)}).catch(function(k){console.log("failed to send email: "+k)})},isResponseJson:function(a){return(a=a.headers.get("content-type"))&&-1<a.indexOf("json")?!0:!1},appendtoCompareTray:function(){this.setCompareCookie(this.compareCookieJson);setTimeout(function(){document.querySelector(".wd-compare-tray-wrap")&&
document.querySelector(".wd-compare-tray-wrap").classList&&document.querySelector(".wd-compare-tray-wrap").classList.add("tray-open")},0)},removeSkuFromCookie:function(a){var b=this.getCompareCookie();b&&(this.compareCookieJson=JSON.parse(b),delete this.compareCookieJson[a],this.compare_commonLogger("deleted sku from compare cookie",a),this.setCompareCookie(this.compareCookieJson))},setCompareCookie:function(a){Cookies.set(this.getLocale().toLowerCase()+"_"+this.$data.COMPARE_CONSTANTS.COMPARE_TRAY_COOKIE,
JSON.stringify(a),{secure:!0,path:"/",expires:30});this.checkProductsAvailInSession(a)},checkProductsAvailInSession:function(a){var b=this,c="",d;for(d in a){var f=this.getCommercePrefix()+"solr_"+a[d].trim();sessionStorage.getItem(f)||(c+=a[d]+",",this.compare_commonLogger("Product "+a[d]+"not found in session."))}c?(c=c.slice(0,-1),this.getBaseProductInfoFromSolr(c,[]).then(function(){b.createTrayArray(a)}).catch(function(k){b.showErrorPopup(k);b.compare_commonLogger("error thrown while getting sessionBaseProductInfo :: ",
c);var h={event:"check procuts available in session - compare tray"};h.reason=k.responseText;b.sendMailPctError(h)})):this.createTrayArray(a)},createTrayArray:function(a){this.compare_commonLogger("Compare Cookie",a);this.compareTrayArray=[];var b=0;this.comparePageLink=("en-us"==this.getLocale().toLowerCase()?"":"/"+this.getLocale().toLowerCase())+"/tools/product-compare?ids\x3d";var c=!1,d;for(d in a){var f=this.getCommercePrefix()+"solr_"+a[d].trim();f=sessionStorage.getItem(f);if(null!=f){f=JSON.parse(f);
this.compare_commonLogger("sessionBaseProductInfo: ",f);var k={};k.primaryImage=f.assetMapping[d]?f.assetMapping[d]:f.primaryImage;k.title=f.pageTitle;k.skuID=d;k.baseProductId=f.code;k.pagePath=f.pagePath;this.compareTrayArray.push(k);b++;this.comparePageLink+=d+":"+a[d]+",";this.compare_commonLogger(this.compareTrayArray)}else this.removeOnlyFromCookie(d),c=!0,this.compare_commonLogger("Product "+a[d]+"not found in session."),this.compare_commonLogger("removed from cookie ",d)}this.comparePageLink=
this.comparePageLink.slice(0,-1);this.compare_commonLogger("comparePageLink",this.comparePageLink);this.compareCount=b;0===this.compareCount?document.querySelector("body").classList.remove("compare-tray"):0<this.compareCount&&document.querySelector("body").classList.add("compare-tray");if(4>this.compareTrayArray.length)for(a=4-this.compareTrayArray.length,b=0;b<a;b++)this.compareTrayArray.push({});this.compare_commonLogger("compareTrayArray",this.compareTrayArray);c&&this.openPopupModal(document.getElementById("ProductCompareTray").getAttribute("data-notAvailable"));
EventBus.$emit("trayDataReceiver",this.compareTrayArray,"compareTrayArray");EventBus.$emit("trayDataReceiver",this.compareCount,"compareCount");EventBus.$emit("trayDataReceiver",this.comparePageLink,"comparePageLink")},removeOnlyFromCookie:function(a){var b=this.getCompareCookie();b&&(this.compareCookieJson=JSON.parse(b),delete this.compareCookieJson[a],this.compare_commonLogger("deleted sku from compare cookie",a),Cookies.set(this.getLocale().toLowerCase()+"_"+this.$data.COMPARE_CONSTANTS.COMPARE_TRAY_COOKIE,
JSON.stringify(this.compareCookieJson),{secure:!0,path:"/",expires:30}))},loadCompareTray:function(){var a=this,b=this.getCompareCookie();if(b){b=JSON.parse(b);var c="",d;for(d in b){var f=this.getCommercePrefix()+"solr_"+b[d].trim();sessionStorage.getItem(f)||(c+=b[d]+",",this.compare_commonLogger("Product "+b[d]+"not found in session."))}c?(c=c.slice(0,-1),this.getBaseProductInfoFromSolr(c,[]).then(function(){a.showCompareTray()}).catch(function(k){a.showErrorPopup(k);a.compare_commonLogger("error thrown while getting sessionBaseProductInfo :: ",
c);var h={event:"loading compare tray"};h.reason=k.responseText;a.sendMailPctError(h)})):this.showCompareTray()}},clearAllSkus:function(){var a=this;document.querySelector(".wd-compare-tray-wrap").classList.add("fade-out");setTimeout(function(){Cookies.remove(a.getLocale().toLowerCase()+"_"+a.$data.COMPARE_CONSTANTS.COMPARE_TRAY_COOKIE);a.resetDefaultValues()},700);document.querySelector("body").classList.remove("compare-tray")},addToggleClass:function(){document.querySelector(".wd-compare-tray-wrap").classList.toggle("tray-open")},
openSkuModal:function(){document.querySelector("#compare-tray-modal").classList.remove("hidden")},resetDefaultValues:function(){this.compareCookieJson={};this.compareTrayArray=[];this.compareCount=0;this.comparePageLink=""},showSkuModal:function(a){var b=this;this.compare_commonLogger("showSkuModal",a);this.variantCategoryOptions=[];if(a){var c=this.getDomain()+"tools/api/globalsearchquery?q\x3d*\x26locale\x3d"+this.getLocale().toLowerCase()+"\x26documentType\x3dProducts\x26fq\x3dbaseProductId_s:"+
a+"\x26channel\x3d"+this.getCustomerChannel();fetch(c,{method:"GET"}).then(function(d){if(d.ok)return d.json();throw Error(d.status+"-"+d.statusText);}).then(function(d){d=d.docs;b.compare_commonLogger("docs",d);if(0<d.length){b.skuMapping=[];for(var f=$jscomp.makeIterator(d),k=f.next();!k.done;k=f.next())if(k=k.value,"Products"==k.documentType[0]){var h=k;b.createSolrSessionObj(k,d)}else{var l={};l.sku=k.id;l.categories=k.variantCategories_ss?k.variantCategories_ss:k.attrCategories_ss;l.baseProductId=
a;b.skuMapping.push(l)}if(h)if(1==h.skuId.length)b.compare_commonLogger("only one sku",h.skuId[0],a),b.addSkuToCookie(h.skuId[0],a,!0);else{if(1<h.skuId.length){var p=[];b.modalTitle=h.title[0];b.primaryImage=h.primaryImage;d=h.variantCategories_ss?h.variantCategories_ss:h.attrCategories_ss;var q=JSON.parse(h.categories_ss[0]);d.forEach(function(u){var C={};C.attVariantCategory=h.categoryAssociation[u+"-lbl_ss"][0];var E={};u.includes("vc-color/")&&q["vc-color"].data.forEach(function(K){K.id==u&&
(E.colorCode="#"+K.code)});E.val=u;E.text=h.categoryAssociation[u+"-val_ss"][0];E.viewType=0;var F=[];b.skuMapping.forEach(function(K){K.categories.includes(u)&&K.categories.forEach(function(G){G!=u&&F.push(G)})});E.variantMapping=F;E.showFlag=1;C.children=E;p.push(C)});b.compare_commonLogger("categoryOptions",p);var t=[];[].concat($jscomp.arrayFromIterable(new Set(p.map(function(u){return u.attVariantCategory})))).forEach(function(u){var C={};C[u]=[];t.push(C)});t.forEach(function(u){Object.keys(u).forEach(function(C){var E=
{};E.optionName=C;p.forEach(function(F){C==F.attVariantCategory&&u[C].push(F.children)});E.optionValues=u[C];E.selectedVarinat=u[C][0].val;u[C][0].viewType=1;b.variantCategoryOptions.push(E)})});for(d={$jscomp$loop$prop$i$56$275:0};d.$jscomp$loop$prop$i$56$275<b.variantCategoryOptions.length;d={$jscomp$loop$prop$i$56$275:d.$jscomp$loop$prop$i$56$275,$jscomp$loop$prop$selectedVarinats$276:d.$jscomp$loop$prop$selectedVarinats$276},d.$jscomp$loop$prop$i$56$275++)d.$jscomp$loop$prop$selectedVarinats$276=
[],b.variantCategoryOptions.forEach(function(u){return function(C,E){E<=u.$jscomp$loop$prop$i$56$275&&u.$jscomp$loop$prop$selectedVarinats$276.push(C.selectedVarinat)}}(d)),b.updateSKuVariantsView(d.$jscomp$loop$prop$selectedVarinats$276,d.$jscomp$loop$prop$i$56$275);EventBus.$emit("trayDataReceiver",b.variantCategoryOptions,"variantCategoryOptions");EventBus.$emit("trayDataReceiver",b.modalTitle,"modalTitle");EventBus.$emit("trayDataReceiver",b.primaryImage,"primaryImage");EventBus.$emit("trayDataReceiver",
b.skuMapping,"skuMapping");b.openSkuModal()}}else b.compare_commonLogger("Base product not avaialble"),b.openPopupModal(document.getElementById("ProductCompareTray").getAttribute("data-notAvailable")),d={event:"Show sku model in clp"},d.reason=a+" (base product doc) missing in solr response",b.sendMailPctError(d)}else b.compare_commonLogger("No sku is avaialble"),b.openPopupModal(document.getElementById("ProductCompareTray").getAttribute("data-notAvailable")),d={event:"Show sku model in clp"},d.reason=
a+" missing in solr response",b.sendMailPctError(d)}).catch(function(d){b.showErrorPopup(d);var f={event:"Show sku model in clp"};f.reason="failed to get SOLR response of base product ["+a+"] - "+d;b.sendMailPctError(f)})}else console.error("product id ",a)},showErrorPopup:function(a){var b=this;console.error(a);var c={};c="object"===typeof a&&a.hasOwnProperty("responseText")?a.responseText.split("Error:")[1]:a+"";console.log("errorText",c);var d=!0;this.errorCodesArray.forEach(function(f){if(c&&
c.includes(f)){var k=b.getLocale().toLowerCase()+"_"+f+"_pct_error";Cookies.get(k)?(d=!1,console.log(k+" cookie exists so error popup is not shown")):Cookies.set(k,JSON.stringify({errorCode:f}),{secure:!0,path:"/",expires:1})}});d&&this.openPopupModal(document.getElementById("ProductCompareTray").getAttribute("data-tryPctAgain"))},showCompareTray:function(){var a=this.getCompareCookie();a&&(a=JSON.parse(a),this.createTrayArray(a))},getCompareCookie:function(){return Cookies.get(this.getLocale().toLowerCase()+
"_"+this.$data.COMPARE_CONSTANTS.COMPARE_TRAY_COOKIE)},getSelectedCatValue:function(a,b,c){var d=a.target;this.variantCategoryOptions.forEach(function(k){b==k.optionName&&(k.selectedVarinat=d.value,k.optionValues.forEach(function(h){h.viewType=h.val==d.value?1:0}))});var f=[];this.variantCategoryOptions.forEach(function(k,h){h<=c&&f.push(k.selectedVarinat)});this.updateSKuVariantsView(f,c)},updateSKuVariantsView:function(a,b){this.variantCategoryOptions.forEach(function(c,d){if(d>b){var f=!0;c.optionValues.forEach(function(k){a.every(function(h){return k.variantMapping.includes(h)})?
(k.showFlag=1,f?(k.viewType=1,c.selectedVarinat=k.val,f=!1):k.viewType=0):k.showFlag=0})}});this.compare_commonLogger("variantCategoryOptions",this.variantCategoryOptions)},findSelectedSku:function(){var a=this;this.selectedCats=[];this.variantCategoryOptions.forEach(function(k){a.selectedCats.push(k.selectedVarinat)});this.compare_commonLogger("skuMapping",this.skuMapping);this.compare_commonLogger("selectedCats",this.selectedCats);for(var b=!1,c={},d=$jscomp.makeIterator(this.skuMapping),f=d.next();!f.done;c=
{$jscomp$loop$prop$categories$278:c.$jscomp$loop$prop$categories$278},f=d.next())if(f=f.value,c.$jscomp$loop$prop$categories$278=f.categories,this.selectedCats.length==c.$jscomp$loop$prop$categories$278.length&&this.selectedCats.every(function(k){return function(h){return k.$jscomp$loop$prop$categories$278.includes(h)}}(c))){b=!0;this.compare_commonLogger("selected sku ",f.sku);this.addSkuToCookie(f.sku,f.baseProductId,!0);break}b||this.compare_commonLogger("selected variants sku not found in SOLR response")},
handleCompareButtonClick:function(){try{sessionStorage.setItem("pctLoadingFromTray",!0);var a={},b=this.compareTrayArray.map(function(d){return d.skuID}).filter(function(d){return void 0!==d&&null!==d}).join(",");a.skuID=b;var c=window.aa.createEvent("PROD_COMPARE_MAIN",a);window.dispatchEvent(c)}catch(d){console.log("Error while firing Analytics call for compare button click: "+d)}window.location.href=this.comparePageLink},openPopupModal:function(a){this.alertMessage=a;EventBus.$emit("trayDataReceiver",
this.alertMessage,"alertMessage");document.querySelector("#compare-tray-alert").classList.remove("hidden")},compare_commonLogger:function(a,b){if(-1<window.location.search.indexOf("debugCompare\x3dtrue")||Cookies.get("debugCompare"))console.log(a),b&&console.log(b)}}},isAuthor=!1;document.body.classList.contains("aem-AuthorLayer-Edit")&&(isAuthor=!0);
function updateDOMElement(a,b){var c=getCookie("Channel");c&&"B2B"==c&&0<document.getElementsByClassName(b).length?(removeElementsByClass(a),document.getElementsByClassName(b)[0].classList.remove("hidden")):removeElementsByClass(b)}function removeElementsByClass(a){for(a=document.getElementsByClassName(a);0<a.length;)a[0].parentNode.removeChild(a[0])}function getCookie(a){for(var b=document.cookie.split("; "),c=0;c<b.length;c++){var d=b[c].split("\x3d");if(a==d[0])return d[1]}return null}
function redirectPageTo401(){var a=document.getElementById("customerChannel");if(a&&null!=a){var b=getCookie("Channel"),c=a.getAttribute("data-customerchannel"),d=a.getAttribute("data-ispublishenv");a=a.getAttribute("data-redirectpath")||"/content/sandisk/en-us/401.html";"true"==d&&null!=b&&null!=c&&c!=b&&window.location.replace(window.location.origin+a)}}
function addChannelClassToBodyEle(){var a=getCookie("Channel");document.body.className=a&&"B2B"==a?document.body.className+" b2b":document.body.className+" b2c"}
isAuthor?("undefined"!=typeof document.getElementsByClassName("store-retail-section")[0]?document.getElementsByClassName("store-retail-section")[0].classList.remove("hidden"):"","undefined"!=typeof document.getElementsByClassName("store-business-section")[0]?document.getElementsByClassName("store-business-section")[0].classList.remove("hidden"):""):(updateDOMElement("store-retail-section","store-business-section"),redirectPageTo401(),addChannelClassToBodyEle());
document.addEventListener("DOMContentLoaded",function(){document.getElementById("commonUtilLoad").getAttribute("data-isWcmModeDisabled");var a=document.querySelector("header.header")||"",b=document.createElement("div");b.classList.add("navOverlay","hidden");document.body.appendChild(b);document.querySelector(".headerContainer")&&document.querySelector("header.header")&&document.querySelector("body").classList.add("has-header-container");document.querySelector(".wd-header-2-5")&&a&&document.querySelector(".subnav2-0")?
setTimeout(function(){a.style.position="sticky";var d=document.querySelector("#sticky-nav")||"";d&&(d.style.position="relative")},500):a&&setTimeout(function(){var d=a.offsetHeight,f=document.querySelector("#sticky-nav")||"";a.style.top=0;document.querySelector(".wd-header-2-5")&&document.querySelector(".headerContainer");a.style.position="sticky";f&&(f.style.top=d+"px")},500);if(document.querySelector(".wdJavaScript")&&document.querySelector(".wdJavaScript").length){document.querySelector("header.header").classList.add("wd-header-2-0");
var c=document.querySelector("header.header").offsetHeight;window.addEventListener("resize",function(){c=document.querySelector("header.header").offsetHeight;var d=document.querySelector(".sticky"),f=document.querySelector(".sticky-stuck");document.querySelector("header.header").classList.contains("headerHidden")?(d&&(d.style.top="0px"),f&&(f.style.top="0px")):(d&&(d.style.top=c+"px"),f&&(f.style.top=c+"px"))})}window.location&&window.location.href&&window.location.href.includes("profile-useraccount")&&
setTimeout(function(){console.log("inside condition");document.querySelector("#profile")&&document.querySelector("li#profile")&&(document.querySelector("li#profile").click(),console.log("clicked account"))},2E3);(function(){setTimeout(function(){var d=(new URL(window.location.href)).searchParams.get("wd-modal");d&&(d=document.getElementById(d))&&d.classList.contains("hidden")&&d.classList.remove("hidden")},1E3)})()});
window.addEventListener("resize",function(){document.querySelector(".wd-header-2-5")&&document.querySelectorAll(".middleMenu li[id]").forEach(function(a){a.classList.contains("active")&&executeSlidingBar(a)})});function getAllSiblings(a,b){return[].concat($jscomp.arrayFromIterable(b.children)).filter(function(c){return c!==a})}var defaultBreadcrumbView=document.querySelector(".defaultBreadcrumbView "),header=document.querySelector("header.header")||"",defaultBreadcrumbViewHeight,headerHeight=header.offsetHeight;
if(defaultBreadcrumbView&&document.querySelector(".wd-header-2-5")&&!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){defaultBreadcrumbViewHeight=getOffset(defaultBreadcrumbView);var navigationListHeight;document.querySelector(".desktop-navigation-list")&&(navigationListHeight=document.querySelector(".desktop-navigation-list").offsetHeight);if(navigationListHeight){var totalHeight=headerHeight+navigationListHeight;document.querySelector(".left-filter-container")&&
(document.querySelector(".left-filter-container").style.top=navigationListHeight+"px")}}
function HideandShowHeader(){var a=document.querySelector("header.header")||"",b=window.scrollY,c=0,d=document.querySelector(".wd-header-2-5 .header-2-5")||"",f=d.offsetHeight,k=document.querySelector("#sticky-nav")||"",h=document.querySelectorAll(".dropDownContainer.productNavWrapper")||"";if(document.querySelector(".wd-header-2-5")){var l=a.offsetHeight;!k&&d&&(b===f?(a.style.top="-"+f+"px",992<=window.inner&&h.forEach(function(p){p.style.top=l-f+"px"})):b<f?(a.style.top="-"+b+"px",992<=window.inner&&
h.forEach(function(p){p.style.top=l-b+"px"})):b>f&&(a.style.top="-"+f+"px",992<=window.inner&&h.forEach(function(p){p.style.top=l-f+"px"})));b>c&&b>l?k&&(k.style.position="fixed",k.style.top="0"):k&&(k.style.position="relative")}else a&&(l=a.offsetHeight,b>c&&b>l?(a.style.top="-"+l+"px",a.style.position="fixed",a.classList.add("headerHidden"),k&&(k.style.top="0")):(a.style.top="0",a.style.position="fixed",a.classList.remove("headerHidden"),k&&(k.style.top=l+"px")),c=b)}
function getOffset(a){if(!a.getClientRects().length)return{top:0,left:0};var b=a.getBoundingClientRect();a=a.ownerDocument.defaultView;return{top:b.top+a.pageYOffset,left:b.left+a.pageXOffset}}window.onscroll=function(){HideandShowHeader()};
if(document.querySelector(".wd-header-2-5")&&991<=window.innerWidth){if(setTimeout(function(){document.querySelectorAll(".middleMenu li[id]").forEach(function(a){a.addEventListener("click",function(b){var c=a.getAttribute("aria-controls");document.querySelector("header").querySelectorAll(".productNavWrapper").forEach(function(d){d.addEventListener("click",function(k){k.stopPropagation()});var f=d.getAttribute("id");c===f?(a.classList.contains("active")&&(d.classList.remove("megaMenuOpen"),document.querySelector(".navOverlay")&&
document.querySelector(".navOverlay").classList.add("hidden"),d.classList.add("hidden"),a.classList.remove("border-b-4","border-blue","text-blue"),a.closest(".middleMenu").querySelector(".slidingDiv").style.visibility="hidden",setTimeout(function(){d.previousElementSibling&&d.previousElementSibling.classList.add("hidden")},300)),a.classList.contains("active")?setTimeout(function(){c!=f&&(d.classList.remove("megaMenuOpen"),d.classList.add("hidden"),a.classList.remove("border-b-4","border-blue","text-blue"),
a.closest(".middleMenu").querySelector(".slidingDiv").visibility="hidden",d.previousElementSibling&&d.previousElementSibling.classList.add("hidden"))},200):setTimeout(function(){d.classList.add("megaMenuOpen");document.querySelector(".navOverlay")&&document.querySelector(".navOverlay").classList.remove("hidden");d.classList.remove("hidden");executeSlidingBar(a);var k=getAllSiblings(a,a.closest(".middleMenu"));0<k.length&&k.map(function(h){h.classList.remove("active");h.classList.remove("border-b-4",
"border-blue","text-blue")});d.previousElementSibling&&(d.previousElementSibling.classList.remove("hidden"),d.previousElementSibling.style.height=d.offsetHeight+"px")},200)):(d.classList.add("hidden"),document.querySelector('[aria-controls\x3d"'+f+'"]')&&document.querySelector('[aria-controls\x3d"'+f+'"]').classList.remove("border-b-4","border-blue","text-blue"))});a.classList.toggle("active")})})},1500),document.querySelector(".header-2-5")&&document.querySelector(".header-container")){var headerBrandDropDown=
document.querySelector(" .dd-button")||"";headerBrandDropDown&&headerBrandDropDown.addEventListener("click",function(){headerBrandDropDown.classList.toggle("dropDownOpen")})}}else if(document.querySelector(".middleMenu")&&991<=window.outerWidth){var hideSlidingBar=function(){1==isMouseOutFromMegaMenu&&1==isMouseOutFromMenu&&(document.querySelector(".slidingBar \x3e .slidingDiv").style.width=0)},slidingDivCheck=!1;document.querySelectorAll(".middleMenu li[id]").forEach(function(a){a.addEventListener("mouseover",
function(){var b=a.getAttribute("aria-controls");document.querySelector("header")&&document.querySelector("header").querySelectorAll(".productNavWrapper").forEach(function(c){var d=c.getAttribute("id");b===d?(a.classList.add("border-b-4","border-blue","text-blue"),c.style.display="block"):(c.style.display="none",document.querySelector('[aria-controls\x3d"'+d+'"]')&&document.querySelector('[aria-controls\x3d"'+d+'"]').classList.remove("border-b-4","border-blue","text-blue"))})});document.querySelector("header")&&
document.querySelector("header").querySelectorAll(".productNavWrapper").forEach(function(b){b.addEventListener("mouseleave",function(c){setTimeout(function(){0===document.querySelector(".slidingDiv").offsetWidth&&HideHeaderMenu()},500)})});document.querySelector(".middleMenu").children[3]&&document.querySelector(".middleMenu").children[3].addEventListener("mouseover",function(){HideHeaderMenu()})});var activeMenuItem,isMouseOutFromMenu=!0,isMouseOutFromMegaMenu=!0;document.querySelectorAll(".slidingBar li").forEach(function(a){a.addEventListener("mouseover",
function(){executeSlidingBar(a)})});document.querySelectorAll(".productNavWrapper").forEach(function(a){a.addEventListener("mouseover",function(){isMouseOutFromMenu=isMouseOutFromMegaMenu=!1;executeSlidingBar(activeMenuItem)});a.addEventListener("mouseleave",function(){isMouseOutFromMenu=isMouseOutFromMegaMenu=!0;hideSlidingBar()})});document.querySelectorAll(".slidingBar li").forEach(function(a){a.addEventListener("mouseover",function(){isMouseOutFromMenu=isMouseOutFromMegaMenu=!1});a.addEventListener("mouseleave",
function(){isMouseOutFromMenu=isMouseOutFromMegaMenu=!0;hideSlidingBar();setTimeout(function(){0===document.querySelector(".slidingDiv").offsetWidth&&HideHeaderMenu()},500)})})}
function executeSlidingBar(a){document.querySelector("html").getAttribute("dir");activeMenuItem=a;if(a&&!document.querySelector(".wd-header-2-5")){var b=a.offsetWidth;widthAdd=a.offsetLeft+parseInt(window.getComputedStyle(a).paddingLeft)+document.body.scrollLeft;a.closest(".slidingBar").querySelector(".slidingDiv").style.cssText="\n            left: "+widthAdd+"px;\n            width: "+b+"px;\n            "}else b=a.offsetWidth,widthAdd=a.offsetLeft+parseInt(window.getComputedStyle(a).paddingLeft)+
document.body.scrollLeft,a.closest(".slidingBar").querySelector(".slidingDiv").style.minWidth="64px",a.closest(".slidingBar").querySelector(".slidingDiv").style.cssText="\n            left: "+widthAdd+"px;\n            visibility: visible;\n            width: "+b+"px;\n            "}
function HideHeaderMenu(){document.querySelector("#productNavStore").classList.add("hidden");document.querySelector("#productStore").classList.remove("border-b-4","border-blue","text-blue");document.querySelector("#consumerNavSolutions").classList.add("hidden");document.querySelector("#consumerSolutions").classList.remove("border-b-4","border-blue","text-blue");document.querySelector("#businessNavSolutions").classList.add("hidden");document.querySelector("#businessSolutions").classList.remove("border-b-4",
"border-blue","text-blue");document.querySelector("#companyNavWd").classList.add("hidden");document.querySelector("#companyWd").classList.remove("border-b-4","border-blue","text-blue")}
function dynamicHaderHeight(){if(document.querySelector(".mainContainWrap")){var a=document.querySelector("header.header")||"";if(a){var b=a.offsetHeight;a.style.position="fixed";a.style.top=0;document.querySelector(".mainContainWrap").style.marginTop=b+"px"}document.querySelector("window").addEventListener("scroll",function(){b=a.offsetHeight;a.classList.contains("header-loaded")||a.classList.add("header-loaded");a.classList.contains("header-compressed")?document.querySelector(".mainContainWrap").stle.marginTop=
b-20:document.querySelector(".mainContainWrap").stle.marginTop=b})}}
function AEMCallMmenuScript(){document.addEventListener("DOMContentLoaded",function(){if(null!=document.querySelector(".mobile-nav-bar")){var a=(new Mmenu(document.querySelector(".mobile-nav-bar"))).API,b=document.createElement("a"),c=document.createElement("a");b.classList.add("mmenu-close-hamburger");b.tabIndex=0;b.href="#";b.setAttribute("role","button");c.classList.add("mmenu-close-hamburger1");c.tabIndex=0;c.href="#";document.querySelector(".mm-menu").prepend(b);document.querySelector(".mm-menu").prepend(c);
window.addEventListener("click",function(d){992>window.innerWidth&&d.target&&(d.target.classList.contains("hamburger-menu-bar")||d.target.parentElement.classList.contains("hamburger-menu-bar"))&&(document.querySelector(".hamburger-menu-bar .bar").classList.toggle("animate"),document.querySelector(".mm-menu--offcanvas").classList.toggle("mMenutoggleWidth"),document.querySelector("body").classList.toggle("deviceNavView"),document.querySelector(".hamburger-menu-bar .bar").classList.contains("animate")?
(d.preventDefault(),a.open(),document.querySelector(".promo-carousel")&&(document.querySelector(".promo-carousel").style.opacity=0)):(d.preventDefault(),document.querySelector(".promo-carousel")&&(document.querySelector(".promo-carousel").style.opacity=1),a.close()))});document.querySelector(".mmenu-close-hamburger")&&document.querySelector(".mmenu-close-hamburger").addEventListener("click",function(d){document.querySelector(".hamburger-menu").click()})}})}
document.querySelector(".wd-header-2-5")||AEMCallMmenuScript();
document.querySelector(".wd-header-2-5 .hamburger-menu")&&(document.addEventListener("click",function(a){domClickEventCalled(a)}),document.querySelector("#searchBTN")&&document.querySelector("#searchBTN").addEventListener("click",function(a){(document.querySelector(".header-2-5 .dd-button")||document.querySelector(".header-2-5 .dd-button").classList.contains("dropDownOpen"))&&document.querySelector(".header-2-5 .dd-button").classList.remove("dropDownOpen");domClickEventCalled(a)}));
function domClickEventCalled(a){if(a.target.classList.contains("hamburger-menu-bar")||a.target.parentElement&&a.target.parentElement.classList.contains("hamburger-menu-bar"))a.stopPropagation(),document.querySelector(".mobile-nav-div").classList.remove("hide"),document.querySelector(".hamburger-menu-bar .bar").classList.toggle("animate"),document.querySelector(".mobile-nav-bar").classList.toggle("mMenutoggleWidth"),document.querySelector("body").classList.toggle("mobile-nav-open"),document.querySelector("body").classList.toggle("deviceNavView");
a.target.classList.contains("openLoginFlyout")||(a.target.parentElement&&!a.target.parentElement.classList.contains("openLoginFlyout")||a.target.closest(".cartwrapper"))&&0<document.querySelectorAll(".login-flyout").length&&document.querySelectorAll(".login-flyout").forEach(function(c){c.classList.add("hidden")});a.target.classList.contains("mini-cart-trigger")||"truste-consent-close"===a.target.id.toLowerCase()||a.target.closest(".mini-cart-trigger")||a.target.closest(".cartwrapper")||a.target.classList.contains("addToCartBtn")||
a.target.closest(".addToCartBtn")||document.querySelector("#openCartModal")&&document.querySelector("#openCartModal").classList.add("hidden");a.target.closest(".tooltip-pct")||document.querySelectorAll(".tooltip-pct .chart-tooltip-body").forEach(function(c){c.classList.add("hidden");c.closest("tr").classList.remove("tooltip-open")});if(!a.target.classList.contains("mainMenuItem")){var b=document.querySelector(".navOverlay");a.target.closest(".mainMenuItem")||b&&b.classList.add("hidden")}a.target.closest(".navContainer")||
0<document.querySelectorAll(".background-placeHolder").length&&document.querySelectorAll(".background-placeHolder").forEach(function(c){c.classList.add("hidden")})}var chatTriggerElement=document.querySelector(".js-trigger-start-chat");chatTriggerElement&&document.querySelectorAll(".js-trigger-start-chat").forEach(function(a){a.addEventListener("click",function(b){b.preventDefault();(b=document.querySelector(".oda-chat-button"))?b.click():Genesys("command","Messenger.open",{})})});
document.addEventListener("DOMContentLoaded",function(){centerAlignNav();document.getElementById("editorial-list-dropdown")&&document.getElementById("editorial-list-dropdown").addEventListener("change",function(){checkIfModalHasForm(this.value)});(new MutationObserver(function(){return enhanceInputs()})).observe(document.body,{childList:!0,subtree:!0});if(isPublishInstance()){var a=document.querySelectorAll(".responsive-columns-flexbox .reference");if(a&&0<a.length)for(var b=0;b<a.length;b++){var c=
a.item(b);1==c.parentNode.children.length&&0==c.children.length&&(c.parentNode.style.display="none")}}});
function centerAlignNav(){var a=document.querySelector("#profile");if(a){var b=document.querySelectorAll("ul.desktop-navigation-list li.mainMenuItem"),c=a.previousElementSibling;a=window.innerWidth;b=(a-(c.offsetLeft+c.offsetWidth)-(b[0].offsetLeft||b[1].offsetLeft))/2;30<b&&(document.querySelector(".navContainer.mobile-nav-bar").style.marginLeft=6.5*a/100+b+"px");-30>b&&(document.querySelector(".navContainer.mobile-nav-bar").style.marginLeft=-b+5+"px");console.log(b)}}
document.addEventListener("DOMContentLoaded",function(){var a=window.location.origin,b=window.location.host,c=document.querySelectorAll("a")||"";0<c.length&&c.forEach(function(d){var f=d.getAttribute("href"),k=d.getAttribute("target");f&&k&&"_self"!=k&&"undefined"!=typeof f&&"#"!=f.substring(0,1)&&-1<f.indexOf("http")&&0>f.indexOf(a)&&0>f.indexOf(b)&&(d.setAttribute("target","_blank"),d.setAttribute("rel","noreferer, ,noopener"))})});
if(992<=window.outerWidth){header=document.querySelector("header.header")||"";var skipBtn="";if(header){skipBtn=document.createElement("a");skipBtn.setAttribute("href","#mainContainWrap");skipBtn.setAttribute("tabindex","0");skipBtn.classList.add("skipBTN");var skipToContentLabel="Skip to main content";document.getElementById("skipToMainContent")&&document.getElementById("skipToMainContent").getAttribute("data-skipLabel")&&(skipToContentLabel=document.getElementById("skipToMainContent").getAttribute("data-skipLabel"));
skipBtn.innerHTML=skipToContentLabel;header.prepend(skipBtn)}skipBtn&&(skipBtn.addEventListener("click",function(a){a.preventDefault();focusToFirstElement()}),skipBtn.addEventListener("keyup",function(a){if("Enter"===a.key||"Space"===a.key)a.preventDefault(),focusToFirstElement()}))}var recaptchaScriptLoaded=!1;
function loadRecaptchaScript(){var a=document.createElement("script");a.onload=function(){};var b=document.getElementById("commonUtilLoad");b&&null!=b&&(recaptchaSitekey=b.getAttribute("data-recaptchaSiteKey"));a.src="https://www.google.com/recaptcha/api.js?render\x3d"+recaptchaSitekey;document.body.appendChild(a);recaptchaScriptLoaded=!0}var body=document.querySelector("body");body.classList.add("disabledOutine");document.addEventListener("mousedown",function(){body.classList.add("disabledOutine")});
document.addEventListener("keyup",function(a){body.classList.add("disabledOutine");tabKeyFunctionality(a);(9===a.which||16===a.which||a.shiftKey||"Enter"===a.key)&&body.classList.remove("disabledOutine")});
function focusToFirstElement(){var a=document.querySelector(".mainContainWrap"),b=document.querySelector(".mainContainWrap .hero-input input");if(document.querySelector(".wd-hero-carousel")){var c=new Event("mouseenter");document.querySelector(".wd-hero-carousel").dispatchEvent(c);document.querySelector(".wd-hero-carousel .splide__arrow--prev")&&(document.querySelector(".wd-hero-carousel .splide__arrow--prev").style.visibility="visible");document.querySelector(".wd-hero-carousel .splide__arrow--next")&&
(document.querySelector(".wd-hero-carousel .splide__arrow--next").style.visibility="visible")}if(a){c=a.querySelectorAll('a, input, button, select, li[tabIndex\x3d"0"], div[tabIndex\x3d"0"] ');a=null;if(b)a=b;else for(b=$jscomp.makeIterator(c),c=b.next();!c.done;c=b.next())if(c=c.value,"none"!==getComputedStyle(c).display&&!c.classList.contains("hidden")&&(a||!c||c.closest("#sticky-nav")||(a=c),1<c.offsetHeight&&c&&!c.closest("#sticky-nav"))){a=c;break}a&&(document.body.classList.contains("disabledOutine")&&
document.body.classList.remove("disabledOutine"),a.focus())}}document.addEventListener("keydown",function(a){tabKeyDownFunctionality(a);9===a.which&&body.classList.remove("disabledOutine")});var footer=document.querySelector("footer"),firstVisibleTag=null;footer&&(firstVisibleTag=footer.querySelector("a"));
var megaMenuFirstElement="",megaMenuLastElement="",mobileMenuFirstElement="",PCTFocusBtn=null,tray=document.querySelector(".wd-compare-tray-wrap"),emptyTray=document.querySelectorAll(".wd-compare-tray-wrap .tray-item-empty"),modalTray=document.querySelector("#compare-tray-modal"),alertModal=document.querySelector("#compare-tray-alert"),compareTray=null,anchorButtonToFocus=null;
function isHiddenBehindFooter(a){if(compareTray){a=a.getBoundingClientRect();var b=compareTray.getBoundingClientRect();return a.bottom>b.top}return!1}function isHiddenBehindHeader(a){var b=document.querySelector(".headerContainer");return b?(a=a.getBoundingClientRect(),b=b.getBoundingClientRect(),a.top<b.bottom):!1}
function scrollIfNecessary(a){if(isHiddenBehindFooter(a)){var b=a.closest(".left-filter-container"),c=document.querySelector(".wd-compare-tray-wrap").clientHeight;c=a.getBoundingClientRect().top+window.scrollY-c;window.scrollTo({top:c,behavior:"smooth"});b&&(b.scrollTop+=20)}isHiddenBehindHeader(a)&&(b=document.querySelector(".headerContainer").clientHeight,a=a.getBoundingClientRect().top+window.scrollY-b,window.scrollTo({top:a,behavior:"smooth"}))}
function updateTabIndexForInvisibleElements(){document.querySelectorAll("a, button").forEach(function(a){var b=window.getComputedStyle(a),c=parseInt(b.width,10);b=parseInt(b.height,10);0!==c&&0!==b||a.setAttribute("tabindex","-1")})}
function tabKeyDownFunctionality(a){a.target.getAttribute("href")&&a.target.getAttribute("href").startsWith("#")&&(PCTFocusBtn=a.target);updateTabIndexForInvisibleElements();0<document.querySelectorAll(".leading-loose").length&&document.querySelectorAll(".leading-loose").forEach(function(c){"none"===c.style.display&&c.closest("a")&&(c.closest("a").tabIndex=-1)});9===a.which&&a.shiftKey&&a.target.classList.contains("mmenu-close-hamburger")&&setTimeout(function(){a.preventDefault;document.querySelector(".mmenu-close-hamburger").focus();
a.stopPropagation()},100);9===a.which&&!a.shiftKey&&a.target.classList.contains("hamburger-menu")&&a.target.querySelector("div").classList.contains("animate")&&document.querySelector(".mm-panel--opened .mm-listview li a")&&document.querySelector(".mm-panel--opened .mm-listview li a").focus();9===a.which&&a.shiftKey&&!a.target.classList.contains("mob-openLoginFlyout")&&a.target.closest(".mm-panel--opened ")&&"-1"==a.target.closest(".mm-panel--opened ").querySelectorAll(".mm-navbar a")[0].tabIndex&&
null===a.target.parentElement.previousElementSibling&&(a.preventDefault(),document.querySelector(".mmenu-close-hamburger").focus());9===a.which&&a.shiftKey&&!a.target.classList.contains("mob-openLoginFlyout")&&a.target.classList.contains("mm-btn--prev")&&"-1"!=a.target.tabIndex&&null===a.target.parentElement.previousElementSibling&&(a.preventDefault(),document.querySelector(".mmenu-close-hamburger").focus());if(9===a.which){if(document.querySelector(".nav-brand-logo")&&document.querySelector(".nav-brand-logo").lastChild){var b=
document.querySelector(".nav-brand-logo").lastChild;a.target.classList===b.classList&&(a.preventDefault(),a.preventDefault(),document.querySelector(".mmenu-close-hamburger").focus())}!a.shiftKey&&a.target.closest("li")&&!a.target.closest("li").classList.contains("nav-brand-logo")&&null===a.target.closest("li").nextElementSibling&&document.querySelector(".mm-menu")&&document.querySelector(".mm-menu").classList.contains("mm-menu--opened")&&(a.preventDefault(),document.querySelector(".mmenu-close-hamburger").focus());
(b=document.querySelector(".wd-compare-tray-wrap"))&&!a.shiftKey&&a.target.classList.contains("compare-tray-btn")&&!b.classList.contains("tray-open")&&firstVisibleTag&&(a.preventDefault(),firstVisibleTag.focus());firstVisibleTag&&firstVisibleTag.addEventListener("keydown",function(c){if("Tab"===c.key&&c.shiftKey){var d=document.querySelector(".wd-compare-tray-wrap");d&&(c.preventDefault(),c.stopImmediatePropagation(),d.querySelector(".compare-tray-btn").focus())}})}if(13===a.which||32===a.keyCode)a.target.classList.contains("pointer-events-none")&&
(a.preventDefault(),a.stopImmediatePropagation()),a.target.closest(".product-card")&&!a.target.closest(".wd-modal")&&(a.stopPropagation(),a.target.click(),setTimeout(function(){a.target.closest(".product-card").querySelector(".wd-modal .wd-modal-close").focus()},200)),a.target.classList.contains("signedinFirstName")&&(b=document.querySelector("#profile button.dropDownItem"))&&b.click()}
function findLastVisibleFocusableElement(){var a=document.querySelector(".mainContainWrap").querySelectorAll('a, button ,li[tabindex\x3d"0"], select'),b=null;Array.from(a).filter(function(c){c&&0<c.clientHeight&&(b=c);return!1});b&&(b.focus(),scrollIfNecessary(b))}function checkModalTray(){setTimeout(function(){var a=document.querySelector(".wd-compare-tray-wrap");a&&a.classList.contains("tray-open")&&a.querySelector("button")&&a.querySelector("button").focus()},500)}var mystryCount=0,NavHeight=-1;
function checkforMystrySaving(a){var b=document.querySelector("#mystery-savings-modal")||"";b&&9===a.keyCode&&!b.classList.contains("hidden")&&(mystryCount++,b.querySelector("button.wd-modal-close").focus())}
function checkAccordion(){var a=document.querySelectorAll(".accordion-content");a.length&&a.forEach(function(b){if(b.classList.contains("hidden")&&!document.querySelector(".region-selector")){var c=b.querySelectorAll("a");b=b.querySelectorAll("button");c&&c.forEach(function(d){d.setAttribute("tabindex",-1)});b&&b.forEach(function(d){d.setAttribute("tabindex",-1)})}else c=b.querySelectorAll("a"),b=b.querySelectorAll("button"),c&&c.forEach(function(d){d.setAttribute("tabindex",0)}),b&&b.forEach(function(d){d.setAttribute("tabindex",
0)})})}document.addEventListener("DOMContentLoaded",function(){var a=document.querySelectorAll(".accordion-title");0<(null==a?void 0:a.length)&&a.forEach(function(b){b.addEventListener("click",function(c){setTimeout(function(){0===c.offsetX&&0===c.offsetY&&document.activeElement==c.target&&document.body.classList.contains("disabledOutine")&&(document.body.classList.remove("disabledOutine"),c.target.focus(),checkAccordion())},0)})})});
document.addEventListener("keydown",function(a){9==a.keyCode&&setTimeout(function(){var c=document.activeElement;c.classList.contains("accordion-title")&&"true"==c.getAttribute("aria-expanded")&&(c.setAttribute("tabIndex",-1),c.closest(".accordion-box").setAttribute("tabIndex",0),c.closest(".accordion-box").focus())},0);if(13==a.keyCode){var b=a.target;b.classList.contains("accordion-box")&&b.querySelector(".accordion-title").click();b.classList.contains("accordion-title")&&"false"==a.target.getAttribute("aria-expanded")&&
(b.click(),b.setAttribute("tabIndex",-1),b.closest(".accordion-box").setAttribute("tabIndex",0),b.closest(".accordion-box").focus())}});
function tabKeyFunctionality(a){0===mystryCount&&checkforMystrySaving(a);(compareTray=document.querySelector(".wd-compare-tray-wrap"))&&a.target&&"Tab"===a.key&&!a.shiftKey&&!a.target.closest(".wd-compare-tray-wrap")&&setTimeout(function(){scrollIfNecessary(document.activeElement)},0);compareTray&&a.target&&"Tab"===a.key&&a.shiftKey&&!a.target.closest(".wd-compare-tray-wrap")&&setTimeout(function(){scrollIfNecessary(document.activeElement)},0);checkAccordion();var b=document.querySelectorAll(".middleMenu li[id]")||
"";document.querySelectorAll(".mm-btn--prev");if(0<b.length&&a.target&&a.target.closest(".middleMenu")){var c=a.target.parentElement?a.target.parentElement.getAttribute("aria-controls"):null,d=document.querySelector("#"+c)||"";d&&!d.querySelector(".mainNavItemLink")&&(megaMenuFirstElement=d.querySelectorAll("a")[0],megaMenuLastElement=d.querySelectorAll("a")[d.querySelectorAll("a").length-1])}if(document.querySelector(".wd-header-2-5")){if(megaMenuFirstElement||megaMenuLastElement)megaMenuFirstElement.addEventListener("keydown",
function(A){9===A.which&&A.shiftKey&&(document.querySelector(".middleMenu .slidingDiv").style.visibility="hidden")}),megaMenuLastElement.addEventListener("keydown",function(A){A.preventDefault();A.stopPropagation();13==A.keyCode||9!=A.keyCode||A.shiftKey?(13==A.keyCode&&A.target.click(),9==A.keyCode&&A.shiftKey&&A.target.parentElement&&(A.target.parentElement.previousElementSibling.querySelector("a").classList.contains("hidden")||A.target.parentElement.previousElementSibling.querySelector("a").focus(),
document.querySelector(".middleMenu .slidingDiv").style.visibility="hidden")):A.target.closest(".productNavWrapper")&&(A=A.target.closest(".productNavWrapper").getAttribute("id"),document.querySelector("[aria-controls\x3d"+A+"]")&&document.querySelector("[aria-controls\x3d"+A+"]").nextElementSibling.hasAttribute("id")&&document.querySelector("[aria-controls\x3d"+A+"]").nextElementSibling.classList.contains("mainMenuItem")?(document.querySelector("[aria-controls\x3d"+A+"]").nextElementSibling.querySelector("button").focus(),
document.querySelector(".middleMenu .slidingDiv").style.visibility="hidden"):document.querySelector(".login-btn-trigger button")?(document.querySelector(".login-btn-trigger button").focus(),document.querySelector(".middleMenu .slidingDiv").style.visibility="hidden"):document.querySelector(".btn-search")&&(document.querySelector(".btn-search").focus(),document.querySelector(".middleMenu .slidingDiv").style.visibility="hidden"))})}else if(megaMenuFirstElement||megaMenuLastElement)megaMenuFirstElement.addEventListener("keydown",
function(A){9===A.which&&A.shiftKey&&(A=A.target.closest(".productNavWrapper").getAttribute("id"),document.querySelector(".middleMenu [aria-controls\x3d"+A+"]").focus())}),megaMenuLastElement.addEventListener("keydown",function(A){13==A.keyCode||9!=A.keyCode||A.shiftKey?13==A.keyCode&&A.target.click():A.target.closest(".productNavWrapper")&&(A=A.target.closest(".productNavWrapper").getAttribute("id"),document.querySelector("[aria-controls\x3d"+A+"]")&&document.querySelector("[aria-controls\x3d"+A+
"]").nextElementSibling.hasAttribute("id")?document.querySelector("[aria-controls\x3d"+A+"]").focus():document.querySelector(".btn-search")?document.querySelector(".btn-search").focus():document.querySelector(".btn-search")&&(document.querySelector(".btn-search").focus(),document.querySelector(".middleMenu .slidingDiv").style.visibility="hidden"))});c=document.querySelectorAll("ul.variant-axis-default li")||"";if(a.target&&a.target.closest(".header-2-5")){var f=document.querySelectorAll(".header-2-5 .dd-menu li")[document.querySelectorAll(".header-2-5 .dd-menu li").length-
1];f&&0<f.length&&f.addEventListener("keydown",function(A){var O=new Event("click");A.target&&A.target.closest(".header-2-5").querySelector(".dd-button").dispatchEvent(O);return!1})}0<c.length&&c.forEach(function(A){A.querySelector("button")||A.querySelector("a")?(A.removeAttribute("tabindex"),A.querySelector("button")&&A.querySelector("button").setAttribute("tabindex",0),A.querySelector("a")&&A.querySelector("a").setAttribute("tabindex",0)):A.setAttribute("tabindex",0)});if(9===a.keyCode){c=function(A){A=
A.querySelectorAll("a");A=$jscomp.makeIterator(A);for(var O=A.next();!O.done;O=A.next())if(O=O.value,!O.hasAttribute("disabled")&&"-1"!==O.getAttribute("tabindex"))return O;return null};f=document.querySelector(".product-banner")||"";var k=document.querySelectorAll(".relatedProduct li");0<k.length&&k.forEach(function(A){A&&(A.querySelector("button")?(A.removeAttribute("tabindex"),A.querySelector("button").setAttribute("tabindex",0)):A.querySelector("a")?(A.removeAttribute("tabindex"),A.querySelector("a").setAttribute("tabindex",
0)):A.setAttribute("tabindex",0))});f&&(f=f.querySelectorAll("#updateProductGallery .vertical-carousel-single li.splide__slide[id].is-active.is-visible"),0<f.length&&f.forEach(function(A){A&&(A.querySelector("button")?(A.removeAttribute("tabindex"),A.querySelector("button").setAttribute("tabindex",0)):A.setAttribute("tabindex",0))}));document.querySelector(".searchSummaryViewInput")&&""==document.querySelector(".searchSummaryViewInput").value?(document.querySelector(".svClearInput").setAttribute("tabindex",
"-1"),document.querySelector(".searchSummaryViewInput").setAttribute("tabindex","-1")):document.querySelector(".svClearInput")&&(document.querySelector(".svClearInput").removeAttribute("tabindex"),document.querySelector(".searchSummaryViewInput").setAttribute("tabindex","0"));a.target.closest(".productNavWrapper")||(document.querySelectorAll(".productNavWrapper").forEach(function(A){A.classList.add("hidden")}),0<document.querySelectorAll(".background-placeHolder").length&&document.querySelectorAll(".background-placeHolder").forEach(function(A){A.classList.add("hidden");
document.querySelector(".navOverlay")&&document.querySelector(".navOverlay").classList.add("hidden")}));a.target.classList.add("focusOutline");0<document.querySelectorAll(".wd-modal").length&&document.querySelectorAll(".wd-modal").forEach(function(A){if(!A.classList.contains("hidden")){A=A.querySelectorAll("select, input, textarea, button, a, .cursor-pointer");var O=A[0],W=A[A.length-1];a.target.closest(".wd-modal")||O.focus();W.addEventListener("keydown",function(Z){9!==Z.which||Z.shiftKey||(Z.preventDefault(),
O.focus())});O.addEventListener("keydown",function(Z){9===Z.which&&Z.shiftKey&&(Z.preventDefault(),W.focus())})}});a.target.classList.contains("wd-modal-close")&&a.target.closest(".wd-modal-content")&&a.target.closest(".wd-modal-content").querySelector("iframe")&&setTimeout(function(){a.target.closest(".wd-modal-content").querySelector("iframe").focus();document.querySelector("#updateProductGallery .wd-modal .wd-modal-content .wd-modal-close").classList.remove("focusOutline")},400);(f=document.querySelector("#hero-video .wd-modal"))&&
!f.classList.contains("hidden")&&f.querySelector(".wd-modal-close").focus();a.target.classList.contains("splide__slide")&&document.querySelector("#updateProductGallery")&&document.querySelector("#updateProductGallery .wd-modal")&&!document.querySelector("#updateProductGallery .wd-modal").classList.contains("hidden")&&(document.querySelector("#updateProductGallery .wd-modal .wd-modal-content button").focus(),document.querySelector("#updateProductGallery .wd-modal .wd-modal-content button").classList.add("focusOutline"));
document.querySelector(".splide__slide")&&document.querySelector(".rd-main-carousel")&&(document.querySelector(".product-img-carousel .rd-main-carousel .splide__slide.is-active.is-visible")&&(document.querySelector(".product-img-carousel .rd-main-carousel .splide__slide.is-active.is-visible").tabIndex="0"),document.querySelector(".product-img-carousel .rd-main-carousel .splide__slide")&&document.querySelectorAll(".product-img-carousel .rd-main-carousel .splide__slide").forEach(function(A){A.classList.contains("is-active")||
(A.tabIndex="-1")}));a.target&&a.target.classList.contains("dd-button")?document.querySelector(".dd-button").classList.contains("dropDownOpen")||(f=document.querySelectorAll(".dd-menu li a"),0<f.length&&f.forEach(function(A){A.setAttribute("tabindex",-1)})):a.target&&!a.target.closest(".dd-menu")&&document.querySelector(".dd-button")&&(document.querySelector(".dd-button").classList.remove("dropDownOpen"),f=document.querySelectorAll(".dd-menu li a"),0<f.length&&f.forEach(function(A){A.setAttribute("tabindex",
-1)}));var h,l,p,q,t,u;if(a.target&&a.target.closest("#sticky-nav")){var C=[];0<document.querySelectorAll("#sticky-nav a").length&&document.querySelectorAll("#sticky-nav a").forEach(function(A){A.closest("div").classList.contains("hidden")||C.push(A)});(h=C[C.length-1])&&h.addEventListener("keydown",function(A){9===A.keyCode&&!A.shiftKey&&document.querySelector(".productBannerApp .product-details a")&&(document.querySelector('.productBannerApp .product-details .pdpBreadcrumbView a[data-track-type\x3d"breadcrumb"]').focus(),
p=document.querySelector(".productBannerApp .product-details .pdpBreadcrumbView a"),setTimeout(function(){p.focus();p&&p.addEventListener("keydown",function(O){9===O.keyCode&&O.shiftKey&&setTimeout(function(){h.focus()},100)})},100))})}a.target&&a.target.closest(".product-details")&&(0<document.querySelectorAll(".productBannerApp .product-details .store-product-wtb a, .productBannerApp .product-details .store-product-wtb button").length&&(l=document.querySelectorAll(".productBannerApp .product-details .store-product-wtb a, .productBannerApp .product-details .store-product-wtb button ")[document.querySelectorAll(".productBannerApp .product-details .store-product-wtb a, .productBannerApp .product-details .store-product-wtb button ").length-
1]),l&&l.addEventListener("keydown",function(A){if(9===A.keyCode&&!A.shiftKey){var O=function(W){for(var Z=[];W.nextSibling;)W=W.nextSibling,1===W.nodeType&&Z.push(W);return Z};document.querySelector(".productBannerApp .product-details")&&document.querySelector(".productBannerApp .product-details").previousElementSibling&&document.querySelector(".productBannerApp .product-details").previousElementSibling.querySelectorAll("#updateProductGallery div.store-product-image").forEach(function(W){W.classList.contains("hidden")||
(setTimeout(function(){(t=W.querySelector('a, button, li[tabindex\x3d"0"]'))&&!document.querySelector(".pdp-redesign")&&t.addEventListener("keydown",function(Z){9===Z.keyCode&&Z.shiftKey&&setTimeout(function(){l.focus()},100)})},100),W.querySelectorAll(".vertical-carousel li.is-visible")[W.querySelectorAll(".vertical-carousel li.is-visible").length-1]?q=W.querySelectorAll(".vertical-carousel li.is-visible")[W.querySelectorAll(".vertical-carousel li.is-visible").length-1]:W.querySelectorAll(".vertical-carousel-single li.is-visible")[W.querySelectorAll(".vertical-carousel-single li.is-visible").length-
1]?q=W.querySelectorAll(".vertical-carousel-single li.is-visible")[W.querySelectorAll(".vertical-carousel-single li.is-visible").length-1]:0<W.querySelectorAll(".vertical-carousel li.is-visible").length&&(q=W.querySelectorAll(".vertical-carousel li.is-visible")[W.querySelectorAll(".vertical-carousel li.is-visible").length-1].previousElementSibling))});q&&q.addEventListener("keydown",function(W){9!==W.keyCode||W.shiftKey||W.target.closest(".productBannerWrapper")&&W.target.closest(".productBannerWrapper").nextElementSibling&&
setTimeout(function(){var Z=[];O(W.target.closest(".productBannerWrapper")).map(function(fa){if(0<fa.offsetHeight){outsideElmList=fa.querySelectorAll('a, button, li[tabindex\x3d"0"]');for(fa=0;fa<outsideElmList.length;fa++)0<outsideElmList[fa].offsetHeight&&Z.push(outsideElmList[fa]);u=Z[0];u.focus();return!1}});u.addEventListener("keydown",function(fa){9===fa.keyCode&&fa.shiftKey&&q.focus()})},100)})}}));f=document.querySelector(".wd-compare-tray-wrap");a.target.classList.contains("compare-link-clp")&&
f&&f.classList.contains("tray-open")&&(scrollToSmoothly(a.target.offsetTop,200),f.classList.remove("tray-open"));!a.target.closest(".wd-compare-tray-wrap")&&f&&f.classList.remove("tray-open");a.target&&a.target.classList.contains("redirectToUrl")?a.target.closest(".splide__list")&&((f=document.querySelector(".storeSearchResult"))&&f.querySelectorAll("[tabindex]").forEach(function(A){A.setAttribute("tabindex","0")}),0>NavHeight&&(NavHeight=a.target.closest(".splide__list").offsetHeight),f=a.target.closest(".splide__list").querySelectorAll(".splide__slide"),
0<f.length&&f.forEach(function(A){A.querySelector(".storeSearchWrapper").style.height=NavHeight+"px";A.querySelector(".productCTAwrap").classList.remove("productCTAwrapShow")}),a.target.closest(".splide__slide").querySelector(".productCTAwrap").classList.add("productCTAwrapShow"),a.target.closest(".splide__slide").querySelector(".storeSearchWrapper").style.height=""):document.querySelector("#storeSearchResult-list")&&NavHeight&&!a.target.closest(".splide__list")&&(f=document.querySelectorAll("#storeSearchResult-list.splide__list .splide__slide"),
f.forEach(function(A){A.querySelector(".storeSearchWrapper").style.height=NavHeight+"px";A.querySelector(".productCTAwrap").classList.remove("productCTAwrapShow")}));!a.target.closest(".hero-input")&&document.querySelector(".ui-autocomplete")&&(f=document.querySelectorAll(".ui-autocomplete li"),f.length&&f.forEach(function(A){A&&(A.style.display="none")}));document.querySelector(".tooltiptrigger")&&0<document.querySelectorAll(".tooltipbox").length&&document.querySelectorAll(".tooltipbox").forEach(function(A){A.style.display=
"none"});"Tab"!==a.key&&"Shift"!==a.key||a.target.closest(".predictive-search-form")||a.target.closest(".support-search")||a.target.closest(".nav-container")||a.target.closest(".dd-menu")||a.target.closest(".login-flyout")||a.target.closest(".cartwrapper")||document.querySelector(".search-collapse")&&document.querySelector(".search-collapse").click();f=document.querySelector("#predictiveSearchContainer");var E=document.querySelector("#predictiveSearchNavForm input.searchSummaryViewInput");f&&E&&(c=
c(f))&&c.addEventListener("keydown",function(A){"Tab"===A.key&&A.shiftKey&&(A.preventDefault(),E.focus())})}if(13===a.keyCode||32===a.keyCode){a.stopPropagation();a.preventDefault();checkAccordion();a.target.closest(".product-promo")&&a.target.click();a.target.classList.contains("is-active")&&a.target.closest(".rd-main-carousel")&&a.target.click();a.target.closest(".variant-category-container")&&a.target.querySelector("img")&&a.target.querySelector("img").click();a.target.closest(".store-product-wtb")&&
a.target.classList.contains("wtbBtbwWithIcon")&&a.target.click();a.target.classList.contains(".signInBTN")&&a.target.click();a.target.classList.contains("accordion-svg-unique-element")&&a.target.click();document.querySelector("#mystery-savings-modal")&&!document.querySelector("#mystery-savings-modal").classList.contains("hidden")&&setTimeout(function(){document.querySelector("#mystery-savings-modal").querySelector("button.wd-modal-close").focus()},500);a.target&&a.target.classList.contains("redirectToUrl")&&
a.target.click();"checkbox"==a.target.type&&a.target.click();"radio"==a.target.type&&a.target.click();a.target.classList.contains("compare-link-clp")&&(PCTFocusBtn=a.target);a.target&&a.target.classList.contains("dd-button")&&(32===a.keyCode&&a.target.click(),document.querySelector(".dd-button").classList.contains("dropDownOpen")&&(f=document.querySelectorAll(".dd-menu li a"),0<f.length&&f.forEach(function(A){A.setAttribute("tabindex",0)})));a.target.classList.contains("mmenu-close-hamburger")&&(a.preventDefault(),
document.querySelector(".hamburger-menu").click());a.target.classList.contains("skipBTN")&&focusToFirstElement();0<b.length&&a.target&&a.target.closest(".middleMenu")&&(c=a.target.getAttribute("aria-controls"),d=document.querySelector(".productNavWrapper#"+c)||"")&&(d.style.display="block",d.classList.remove("hidden"),setTimeout(function(){d.querySelectorAll("a")[0].focus();megaMenuFirstElement=d.querySelectorAll("a")[0]},500));if(a.target.classList.contains("shopAccountLogin")||a.target.closest(".shopAccountLogin")&&
a.target.closest(".shopAccountLogin").classList.contains("shopAccountLogin"))b=new Event("click"),a.target.dispatchEvent(b),setTimeout(function(){document.querySelector("#login-modal-win")&&document.querySelector("#login-modal-win").querySelector("button").focus()},300);(a.target.classList.contains("openLoginFlyout")||a.target.closest(".openLoginFlyout"))&&setTimeout(function(){document.querySelector(".login-flyout").querySelector("button").focus()},300);a.target.classList.contains("wd-modal-close")&&
setTimeout(function(){document.querySelector(".login-flyout")&&!document.querySelector(".login-flyout").classList.contains("hidden")&&document.querySelector(".login-flyout").querySelector("button").focus();document.querySelector(".bundled-promotion")&&closeModalWindow(a.target)},300);a.target.classList.contains("play-btn")&&a.target.closest(".splide--nav")&&setTimeout(function(){document.querySelector(".product-banner #updateProductGallery .splide--draggable .splide__slide.is-active button").focus();
document.querySelector(".product-banner #updateProductGallery .splide--draggable .splide__slide.is-active button").classList.add("focusOutline");document.querySelector(".product-banner #updateProductGallery .splide--draggable .splide__slide.is-active button").style.margin="5px"},200);a.target.classList.contains("slide-down")&&(b=new Event("click"),a.target.dispatchEvent(b),b=a.target.closest(".pts-accordion-btn"),b.querySelector(".slide-up")&&b.querySelector(".slide-up").focus());a.target.classList.contains("slide-up")&&
(b=new Event("click"),a.target.dispatchEvent(b),b=a.target.closest(".pts-accordion-btn"),b.querySelector(".slide-down")&&b.querySelector(".slide-down").focus());a.target.classList.contains("mob-openLoginFlyout")&&a.target.click();(a.target.classList.contains("filter-more")||a.target.classList.contains("filter-less"))&&a.target.click();a.target.closest(".clp-pagination-wrap")&&(a.target.classList.contains("pointer-events-none")||a.target.classList.contains("btnprev")||a.target.classList.contains("btnnext")||
a.target.click());if("A"===a.target.tagName||"BUTTON"===a.target.tagName){a.target.classList.contains("compare-link-clp")&&(anchorButtonToFocus=a.target);(b=a.target.getAttribute("href"))&&"compare-tray-alert"==b.substring(1)&&(anchorButtonToFocus=a.target,32===a.keyCode&&a.target.click());if(b&&b.startsWith("#")){b=b.substring(1);var F=document.querySelector("#"+b);if(F){var K=F.querySelector(".wd-modal-close");K&&K.addEventListener("keydown",function(A){});"compare-tray-modal"===b?((new MutationObserver(function(A){A.forEach(function(O){"attributes"===
O.type&&"class"===O.attributeName&&(F.classList.contains("hidden")||K.focus())})})).observe(F,{attributes:!0,attributeFilter:["class"]}),32===a.keyCode&&a.target.classList.contains("compare-link-clp")&&(a.target.click(),K&&K.focus())):K.focus()}}32===a.keyCode&&a.target.classList.contains("wd-modal-close")&&(a.target.click(),anchorButtonToFocus&&anchorButtonToFocus.focus());var G=null;a.target&&a.target.closest(".bundlePromotionApp")&&(G=a.target,b=document.querySelector("#openCartModal"),c=null,
b&&(c=b.querySelector(".wd-modal-close")),c&&(c.focus(),c.addEventListener("keydown",function(A){if(13===A.keyCode||32===A.keyCode)A.preventDefault(),A.stopPropagation(),G.closest(".editorial-dropdown-content-wrap")&&G.closest(".editorial-dropdown-content-wrap").previousElementSibling&&(G.closest(".editorial-dropdown-content-wrap").previousElementSibling.focus(),document.querySelector("body").classList.remove("overflow-hidden"))})))}setTimeout(function(){document.querySelector("#compare-tray-alert")&&
!document.querySelector("#compare-tray-alert").classList.contains("hidden")&&document.querySelector("#compare-tray-alert").querySelector(".alert-close-btn")&&document.querySelector("#compare-tray-alert").querySelector(".alert-close-btn").focus()},300);a.target.classList.contains("js-trigger-start-chat")&&a.target.click();a.target.classList.contains("addToCartBtn")&&setTimeout(function(){document.querySelector("body").classList.remove("disabledOutine");document.querySelector("#openCartModal .wd-modal-close").focus()},
200);a.target.classList.contains("tooltiptrigger")&&(console.log("clicked on toolTip"),a.target&&a.target.querySelector(".tooltipbox")&&(a.target.querySelector(".tooltipbox").style.display="block"));a.target.classList.contains("wtbBtbwWithIcon")&&"requestQuote-modal"===a.target.getAttribute("data-target")&&a.target.click()}c=b=b="";document.querySelector("#compare-tray-alert")&&(b=document.querySelector("#compare-tray-alert"),b=b.querySelectorAll(".wd-modal-close"),c=document.querySelectorAll("#compare-tray-modal .wd-modal-close"),
0<b.length&&b.forEach(function(A){A.addEventListener("keydown",function(O){"Enter"===O.key&&PCTFocusBtn&&(O.preventDefault(),O.stopImmediatePropagation(),O.target.click(),PCTFocusBtn.focus())})}),0<c.length&&c.forEach(function(A){A.addEventListener("keydown",function(O){"Enter"===O.key&&PCTFocusBtn&&(O.preventDefault(),O.stopImmediatePropagation(),O.target.click(),PCTFocusBtn.focus())})}));991>=window.innerWidth&&(0<document.querySelectorAll(".placeHolder").length&&document.querySelectorAll(".placeHolder").forEach(function(A){A.setAttribute("tabindex",
0)}),0<document.querySelectorAll(".dropDownContainer").length&&0<document.querySelectorAll(".dropDownContainer .left-slide").length&&document.querySelectorAll(".dropDownContainer").forEach(function(A){A.classList.contains("hidden")?A.querySelectorAll(".left-slide").forEach(function(O){O.setAttribute("tabindex",-1)}):A.querySelectorAll(".left-slide").forEach(function(O){O.setAttribute("tabindex",0)})}))}
function checkIfModalHasForm(a){a&&(a=-1<a.indexOf("#")?a.replace("#",""):a,0<document.getElementById(a).getElementsByClassName("store-form").length&&!recaptchaScriptLoaded&&loadRecaptchaScript())}
document.addEventListener("click",function(a){a=a.target.closest(".selectDropdown \x3e li");if(null!=a&&"undefined"!=typeof a){var b=a.innerHTML;a.closest(".dropdownSelectOption").querySelector(".selectedOption").innerHTML=b;a=a.closest(".dropdownSelectOption").querySelector(".selectDropdown");null!=a&&"undefined"!=typeof a&&(a.classList.toggle("hidden"),a.querySelectorAll("li").forEach(function(c){c.classList.toggle("selected")}))}});
document.addEventListener("click",function(a){a=a.target.closest(".optionToggle");null!=a&&"undefined"!=typeof a&&a.closest(".dropdownSelectOption").querySelector(".selectDropdown").classList.toggle("hidden")});
window.addEventListener("click",function(a){null==a.target.closest(".dropdownSelectOption")&&null!=document.querySelector(".dropdownSelectOption")&&document.querySelector(".dropdownSelectOption").querySelector(".selectDropdown").classList.add("hidden");null==a.target.closest(".user-profile")&&null!=document.querySelector(".user-profile-dropdown")&&document.querySelector(".user-profile-dropdown").removeAttribute("style");document.querySelector("#predictiveSearchNavForm")||null!=a.target.closest("#searchSummaryViewForm")||
null==document.querySelector(".search-expanded")||(a=new Event("click"),document.querySelector(".search-collapse").dispatchEvent(a))});
window.addEventListener("click",function(a){null!=a.target.closest(".modal")&&a.target.classList.contains("wd-modal-close")&&a.target.closest(".wd-modal").classList.add("hidden");null!=a.target.closest(".wd-modal")&&a.target.classList.contains("wd-modal-close")&&a.target.closest(".wd-modal").classList.add("hidden");null!=a.target.closest(".modal-content")&&null!=a.target.closest(".modal-content").querySelector("iframe")&&a.target.closest(".modal-content").querySelector("iframe").setAttribute("src",
"")});
function storeOpenVideoModal(a){var b=a.getAttribute("data-target"),c=document.querySelector(b);if(c){var d=c.querySelector(".videoHtml");d&&setTimeout(function(){var k=d.querySelector("iframe"),h=d.querySelector("#progress-bar");k=new Vimeo.Player(k.getAttribute("id"));fnVimeoProgressBar(k,h)},3E3)}if("undefined"!=typeof c){"undefined"!=typeof d?c.querySelector("iframe").setAttribute("src",a.getAttribute("data-videosrc").replace("muted\x3d1","muted\x3d0")):c.querySelector("iframe").setAttribute("src",a.getAttribute("data-videosrc"));
body.classList.add("overflow-hidden");c.classList.remove("hidden");c={};c.modalId=b;c.videoURL=a.getAttribute("data-videosrc");try{var f=window.aa.createEvent("VIDEO",c);window.dispatchEvent(f)}catch(k){console.log("Error while triggering analytics VIDEO event")}}}
function storeCloseVideoModal(a){null!=a.closest(".wd-modal")&&null!=a.closest(".wd-modal").querySelector("iframe")&&(a.closest(".wd-modal").classList.add("hidden"),a.closest(".wd-modal").querySelector("iframe").setAttribute("src",""),body.classList.remove("overflow-hidden"))}document.querySelector(".sbgv-main")&&document.querySelector(".sbgv-main").closest(".video").classList.add("section-bg-video-view");
document.querySelector(".pausePlay-btn")&&document.querySelectorAll(".pausePlay-btn").forEach(function(a){a&&a.addEventListener("click",function(){a.classList.toggle("sbgv-is-active");if(a.closest(".sbgv-video-contain")&&a.closest(".sbgv-video-contain").querySelector(".sbgv-video")){var b=a.closest(".sbgv-video-contain").querySelector(".sbgv-video");b&&a.classList.contains("sbgv-is-active")?b.play():b&&b.pause()}})});
document.querySelectorAll(".view-sbgv-main").forEach(function(a){var b=a.querySelectorAll(".view-sbgv-video"),c=a.querySelector(".sbgv-pausePlay-btn"),d=a.querySelector(".audioToggle-btn"),f=function(){var h=null;b.forEach(function(l){0<l.offsetWidth&&0<l.offsetHeight&&"hidden"!==window.getComputedStyle(l).visibility&&(h=l)});return h};c&&c.addEventListener("click",function(){var h=f();h&&(h.paused?(h=h.play(),void 0!==h&&h.catch(function(l){console.log("Play prevented:",l)})):h.pause())});if(d){var k=
a.querySelector(".view-sbgv-video");k?"true"===k.getAttribute("data-audio-enabled")?(d.style.display="inline-block",(a=f())&&(a.muted?d.classList.add("audio-is-active"):d.classList.remove("audio-is-active")),d.addEventListener("click",function(){var h=f();h&&(h.muted=!h.muted,d.classList.toggle("audio-is-active",h.muted))})):(d.style.display="none",b.forEach(function(h){h.muted=!0})):(d.style.display="none",console.warn("No video element found for audio toggle in component:",a))}b.forEach(function(h){var l=
"true"===h.getAttribute("data-autoplay-enabled"),p="true"===h.getAttribute("data-play-when-visible"),q=parseInt(h.getAttribute("data-loop-count"))||1,t=0;p?(new IntersectionObserver(function(u){u.forEach(function(C){C.isIntersecting?h.paused&&(C=h.play(),void 0!==C&&C.catch(function(E){console.log("Autoplay prevented:",E)})):h.paused||h.pause()})},{threshold:.8})).observe(h):h.paused&&(p=h.play(),void 0!==p&&p.catch(function(u){console.log("Play prevented:",u)}));h.addEventListener("ended",function(){t++;
if(l&&t<q){h.currentTime=0;var u=h.play();void 0!==u&&u.catch(function(C){console.log("Autoplay prevented:",C)})}else h.pause()});h.addEventListener("play",function(){c&&c.classList.add("sbgv-is-active")});h.addEventListener("pause",function(){c&&c.classList.remove("sbgv-is-active")})})});function getJsonFrmExcelSheet(a,b){return fetch(b?a+".exceltojson."+b+".json":a+".exceltojson.json")}function next(a,b){a=a.nextElementSibling;return!b||a&&a.matches(b)?a:null}
document.addEventListener("DOMContentLoaded",function(){document.getElementsByClassName("clickableDropdown")[0]&&document.getElementsByClassName("clickableDropdown")[0].addEventListener("change",function(a){if(a=a.srcElement.value)window.location.href=a;return!1})});
document.addEventListener("DOMContentLoaded",function(){if(document.querySelector(".wd-rellax")){var a=document.querySelectorAll(".wd-rellax");a.forEach(function(b){new Rellax(b,{speed:2})})}document.querySelector(".wd-rellax-slow")&&(a=document.querySelectorAll(".wd-rellax-slow"),a.forEach(function(b){new Rellax(b,{speed:1.32})}));document.querySelector(".wd-rellax-fast")&&(a=document.querySelectorAll(".wd-rellax-fast"),a.forEach(function(b){new Rellax(b,{speed:2.66})}))});
function getSha256Hash(a){var b,c,d,f;return $jscomp.asyncExecutePromiseGeneratorProgram(function(k){if(1==k.nextAddress)return b=(new TextEncoder).encode(a),k.yield(crypto.subtle.digest("SHA-256",b),2);c=k.yieldResult;d=Array.from(new Uint8Array(c));f=d.map(function(h){return h.toString(16).padStart(2,"0")}).join("");return k.return(f)})}
function enhanceInputs(){document.querySelectorAll("input[type\x3d'text'], input[type\x3d'email'], input[type\x3d'number'], textarea").forEach(function(a){var b=a.closest(".formRedesign");b&&""!==a.value.trim()&&b.classList.add("filled","focused")})}
document.addEventListener("DOMContentLoaded",function(){var a=document.querySelectorAll(".scroll-reveal"),b=new IntersectionObserver(function(c,d){c.forEach(function(f){f.isIntersecting&&(f.target.classList.add("in-view"),d.unobserve(f.target))})},{threshold:.15});a.forEach(function(c){return b.observe(c)})});
function getClientInfo(a){a=void 0===a?navigator.userAgent:a;var b=/Mobi|iPhone|Android/i.test(a);b=/iPad/i.test(a)?"tablet":b?"mobile":"desktop";var c="Unknown";/iPhone/i.test(a)?c="iPhone":/iPad/i.test(a)?c="iPad":/Android/i.test(a)?c="Android":/Macintosh/i.test(a)?c="Mac":/Windows/i.test(a)?c="Windows":/Linux/i.test(a)&&(c="Linux");var d="Unknown";/FxiOS/i.test(a)?d="Firefox (iOS)":/CriOS/i.test(a)?d="Chrome (iOS)":/EdgiOS/i.test(a)?d="Edge (iOS)":/OPiOS/i.test(a)?d="Opera (iOS)":/Firefox/i.test(a)?
d="Firefox":/Edg/i.test(a)?d="Edge":/Chrome/i.test(a)?d="Chrome":/Safari/i.test(a)&&(d="Safari");return{deviceType:b,device:c,browser:d}}document.addEventListener("DOMContentLoaded",function(){var a=getClientInfo(navigator.userAgent);"mobile"===a.deviceType&&"iPhone"===a.device&&"Firefox (iOS)"===a.browser&&(console.log("Detected user using an iPhone on Firefox"),document.querySelectorAll("picture").forEach(function(b){var c=b.querySelector("img");c&&(c=c.cloneNode(!0),b.replaceWith(c))}))});
document.addEventListener("DOMContentLoaded",function(){if(991>=window.innerWidth){var a=document.querySelectorAll(".wd-header-2-5 .mobile-nav-bar .dropDownItem")||"",b=document.querySelectorAll(".wd-header-2-5 .mobile-nav-bar .left-slide")||"",c=document.querySelectorAll(".wd-header-2-5 .mobile-nav-bar .placeHolder")||"";if(991>=window.outerWidth){if(document.querySelector(".sd-header")){var d=function(){k.style.left=0;k.style.right="unset"},f=document.querySelectorAll(".dropDownItem"),k=document.querySelector(".hamburger-menu-bar"),
h=document.querySelectorAll(".dropDownContainer"),l=document.querySelectorAll(".secondInheritWrapper .placeHolder"),p=document.querySelector("#profile button"),q=document.querySelector(".rd-mobile-account-icon button");q&&q.addEventListener("click",function(){k&&p&&(k.click(),p.click())});f.forEach(function(K){K.addEventListener("click",function(G){k.style.left="unset";k.style.right=0})});l.forEach(function(K){K.addEventListener("click",function(){d()})});k.addEventListener("click",function(){var K=
document.querySelectorAll("ul.desktop-navigation-list li[id]");K.forEach(function(G){G.style.opacity=0});setTimeout(function(){document.querySelector("body").classList.contains("mobile-nav-open")&&K.forEach(function(G){G.style.opacity=1})},500);d();h.forEach(function(G){G.classList.remove("fullWidth")})})}document.querySelector(".mob-footer-banner")&&document.querySelector(".mobile-nav-div")&&document.querySelector(".mobile-nav-div").classList.add("has-mob-footer-banner");if(0<a.length){var t=function(K,
G,A){for(var O=0;O<K.length;O++)K[O].classList[A](G)},u=document.querySelector(".mob-footer-banner");a.forEach(function(K){K.addEventListener("click",function(G){G.stopPropagation();document.querySelector(".mob-footer-banner")&&document.querySelector(".mobile-nav-div")&&document.querySelector(".mobile-nav-div").classList.add("has-mob-footer-banner");var A=document.querySelectorAll(".dropDownContainer"),O=document.querySelectorAll(".dropDownItem"),W=!this.classList.contains("up-arrow");t(O,"up-arrow",
"remove");t(A,"fullWidth","remove");t(A,"hidden","add");document.querySelector(".sd-header")?(this.closest("li[id]").querySelector("ul.dropDownContainer").classList.toggle("fullWidth"),A=G.target.closest("li").querySelectorAll("ul.dropDownContainer li.left-slide .secondInheritWrapper"),G=G.target.closest("li").querySelectorAll('ul.dropDownContainer li.left-slide .secondInheritWrapper ul[data-mx\x3d"secondInherit"]'),0<A.length&&0<G.length&&(A.forEach(function(Z){Z.classList.add("left")}),G.forEach(function(Z){Z.classList.remove("hidden")}))):
W&&(this.classList.toggle("up-arrow"),this.parentElement.querySelector("ul.dropDownContainer").classList.toggle("fullWidth"),this.parentElement.querySelector("ul.dropDownContainer").classList.toggle("hidden"))})})}document.querySelector(".sd-header")||0<b.length&&b.forEach(function(K){K.addEventListener("click",function(G){G.stopPropagation();G=K.dataset.text;u&&u.classList.add("hidden");document.querySelector(".mob-footer-banner")&&document.querySelector(".mobile-nav-div")&&document.querySelector(".mobile-nav-div").classList.remove("has-mob-footer-banner");
K.querySelector("ul span.placeHolder").innerText=G;document.querySelector(".headerContainer")?(K.querySelectorAll("ul").forEach(function(A){A.classList.remove("hidden")}),K.querySelector(".secondInheritWrapper").classList.add("left")):(K.querySelector("ul").classList.remove("hidden"),K.querySelector("ul").classList.add("left"))})});0<c.length&&c.forEach(function(K){K.addEventListener("click",function(G){G.stopPropagation();document.querySelector(".mob-footer-banner")&&(u.classList.remove("hidden"),
document.querySelector(".mobile-nav-div")&&document.querySelector(".mobile-nav-div").classList.add("has-mob-footer-banner"));if(document.querySelector(".sd-header")){var A=G.target.closest("li.mainMenuItem").querySelectorAll("ul.dropDownContainer li.left-slide .secondInheritWrapper"),O=G.target.closest("li.mainMenuItem").querySelectorAll('ul.dropDownContainer li.left-slide .secondInheritWrapper ul[data-mx\x3d"secondInherit"]');0<A.length&&0<O.length&&(A.forEach(function(W){W.classList.remove("left")}),
O.forEach(function(W){W.classList.add("hidden")}),G.target.closest("ul.dropDownContainer").classList.remove("fullWidth"))}document.querySelector(".headerContainer")?K.parentElement.parentElement.classList.remove("left"):K.parentElement.classList.remove("left")})});document.querySelector(".closeBusiness")&&document.querySelector(".closeBusiness").addEventListener("click",function(){document.querySelector(".mob-footer-banner")&&document.querySelector(".mobile-nav-div")&&document.querySelector(".mobile-nav-div").classList.remove("has-mob-footer-banner");
document.querySelector(".mob-footer-banner").remove()})}}else if(document.querySelector(".sd-header")){a=document.querySelectorAll(".sd-hover-item");var C=document.querySelectorAll(".showHideCardInfo"),E=document.querySelector(".ssd-Prod-card-section"),F=document.querySelector(".prod-card-container");a.forEach(function(K){K.addEventListener("mouseover",function(G){F&&C&&(F.style.display="block",C.forEach(function(A){A.style.display="none"}));G=G.currentTarget.getAttribute("data-target");document.querySelector("#"+
G).style.display="flex";E.style.display="none"});K.addEventListener("mouseout",function(){F&&C&&(F.style.display="none",E.style.display="block")})})}});
window.addEventListener("DOMContentLoaded",function(){setTimeout(function(){var b=window.location.hash;""!=b&&(b=document.querySelectorAll('a[href \x3d "'+b+'"]')||"",0<b.length&&b.forEach(function(c){if(0<c.offsetTop){var d=new Event("click");c.dispatchEvent(d)}}))},500);var a=document.querySelector(".disclosures")||"";a&&0<a.querySelectorAll("ol").length&&a.querySelectorAll("ol").forEach(function(b){b.querySelectorAll("li").forEach(function(c,d){c.setAttribute("id","disclosures"+(d+1))})});document.querySelector(".compareTable")&&
scrollPCT()});function scrollPCT(){document.addEventListener("scroll",function(){var a=document.querySelector(".compareTable th"),b=document.querySelector(".header-nav-bar"),c=document.querySelector(".compareTable table");1460<=window.innerWidth&&a&&b&&(parseInt(a.getBoundingClientRect().top)<=parseInt(b.getBoundingClientRect().height)?c.classList.add("theadStick"):c.classList.remove("theadStick"))})}
function scrollToSmoothly(a,b){var c=window.pageYOffset,d=null;null==b&&(b=500);a=+a;b=+b;window.requestAnimationFrame(function h(k){d=d?d:k;k-=d;c<a?window.scrollTo(0,(a-c)*k/b+c):window.scrollTo(0,c-(c-a)*k/b);k<b?window.requestAnimationFrame(h):window.scrollTo(0,a)})}
document.addEventListener("click",function(a){var b=a.target,c="",d=null;if(null==b.closest(".product-compare")&&null==b.closest(".wd-compare-tray-wrap")&&null==b.closest(".subnav")&&null==b.closest(".content-subnav-list")&&null==b.closest(".subnav-vertical-list")&&null==b.closest(".cta-showhide-section-control")&&null==b.closest(".modal")&&("SUP"==b.tagName&&(b=b.parentElement),"A"!=b.tagName&&(b=b.closest("a")),b&&(c=b.getAttribute("href"),d=getOffset(b).top),null!=c&&"undefined"!=typeof c&&""!=
c&&0==c.indexOf("#")&&1<c.length&&null!=document.querySelector(c)&&!b.classList.contains("store-content-listing-anchor"))){a.preventDefault();a.stopPropagation();var f=0;c=document.querySelectorAll("[id \x3d'"+c.substring(1,c.length)+"']");if(0<c.length)for(var k=0;k<c.length;k++){var h=c[k],l=getOffset(h).top,p=document.querySelector(".header-main")?document.querySelector(".header-main").offsetHeight:155;if(b.classList.contains("disclosure")){var q=b.getAttribute("href").replace("#","");b.setAttribute("id",
"content"+q);var t=document.createElement("a");t.setAttribute("tabindex",0);t.setAttribute("href","#content"+q);t.classList.add("backToContant");t.innerHTML="Back to content";h.append(t);0<l&&(f=l-p);p=null!=h.closest(".digital-commerce-attributes")?h.closest(".digital-commerce-attributes").querySelector(".active").querySelector("#"+q).querySelectorAll("a"):h.querySelectorAll("a");null!=p[p.length-1]&&p[p.length-1].focus()}else b.classList.contains("backToContant")||b.classList.contains("skipBTN")?
(document.querySelector(".backToContant")&&document.querySelector(".backToContant").remove(),0<l&&(f=l-p,q=b.getAttribute("href"),h.closest(""+q).focus())):b.classList.contains("store-content-listing-anchor")?(h=20,992>window.outerWidth&&(h=75),0<d&&(f=d-(p+h))):0<l&&(f=l)}scrollToPosition(f)}a.target.closest(".middleMenu")?a.target.classList.add("dd-no-action"):a.target.classList.contains("productNavWrapper")||a.target.closest(".productNavWrapper")||hideMegaMenu();a.target.classList.contains("productNavWrapper")?
a.target.classList.add("dd-no-action"):a.target.closest(".productNavWrapper")||a.target.closest(".middleMenu")||hideMegaMenu();a.target.classList.contains("dd-button")||a.target.classList.contains("dd-input")||(document.querySelector(".dd-input")?document.querySelector(".dd-input").checked=!1:"",document.querySelector(".dd-button")&&document.querySelector(".dd-button").classList.remove("dropDownOpen"))});
function hideMegaMenu(){if(document.querySelector(".wd-header-2-5")){var a=document.querySelectorAll(".header .productNavWrapper")||"";0<a.length&&a.forEach(function(b){if(!b.classList.contains("hidden")){var c=b.getAttribute("id");b.classList.add("hidden");b.classList.add("hidden");document.querySelector(".desktop-navigation-list [aria-controls\x3d"+c+"]")&&(document.querySelector(".desktop-navigation-list [aria-controls\x3d"+c+"]").classList.remove("active","border-b-4","border-blue","text-blue"),
document.querySelector(".desktop-navigation-list").querySelector(".slidingDiv").style.visibility="hidden")}})}else a=document.querySelectorAll(".header .productNavWrapper")||"",0<a.length&&a.forEach(function(b){if(!b.classList.contains("hidden")){var c=b.getAttribute("id");b.classList.add("hidden");b.style.display="none";document.querySelector("[aria-controls\x3d"+c+"]")&&(document.querySelector("[aria-controls\x3d"+c+"]").classList.remove("active","border-b-4","border-blue","text-blue"),document.querySelector("[aria-controls\x3d"+
c+"]").closest(".middleMenu").querySelector(".slidingDiv").style.width=0)}})}document.addEventListener("keyup",function(a){9===a.key&&a.currentTarget.closest("li").querySelector(".backToContant")&&document.querySelector(".backToContant").remove()});recaptchaScriptLoaded=!1;
function initSiteRedesign(){for(var a=document.getElementsByClassName("wd-modal-btn"),b=0;b<a.length;b++)a[b].classList.contains("section")?a[b].querySelector("a").addEventListener("click",showModalWindow,!1):a[b].addEventListener("click",showModalWindow,!1);a=document.getElementsByClassName("wd-modal-close");for(b=0;b<a.length;b++)a[b].addEventListener("click",closeModalWindow,!1);a=document.getElementsByClassName("store-form");for(b=0;b<a.length;b++)null===a[b].offsetParent||recaptchaScriptLoaded||
loadRecaptchaScript()}function loadRecaptchaScript(){var a=document.createElement("script");a.onload=function(){};var b=document.getElementById("commonUtilLoad");b&&null!=b&&(recaptchaSitekey=b.getAttribute("data-recaptchaSiteKey"));a.src="https://www.google.com/recaptcha/api.js?render\x3d"+recaptchaSitekey;document.body.appendChild(a);recaptchaScriptLoaded=!0}
function closeModalWindow(a){"undefined"!=typeof a&&"click"!=a.type?a.closest(".wd-modal").classList.add("hidden"):this.closest(".wd-modal").classList.add("hidden");document.body.classList.remove("overflow-hidden");document.body.classList.remove("mob-minicart-open");document.querySelector(".wd-modal-active")&&document.querySelector(".wd-modal-active").focus();document.querySelector(".wd-modal-active")&&document.querySelector(".wd-modal-active").classList.remove("wd-modal-active")}
function showModalWindow(a){var b=this.getAttribute("data-target");a.target.classList.add("wd-modal-active");"undefined"!=typeof b&&b||(b=this.getAttribute("href"));b=b&&-1<b.indexOf("#")?b.replace("#",""):b;if(a=document.getElementById(b))a.classList.remove("hidden"),document.body.classList.add("overflow-hidden"),a=a.getElementsByClassName("store-form"),0<a.length&&!recaptchaScriptLoaded&&loadRecaptchaScript(),0<a.length&&!formInit&&initializeFormEventHandlers()}
function scrollToTop(a){function b(k){if(null!==f){d+=Math.PI*(k-f)/a;if(d>=Math.PI)return document.scrollingElement.scrollTop=0;document.scrollingElement.scrollTop=c+c*Math.cos(d)}f=k;window.requestAnimationFrame(b)}if(0!==document.scrollingElement.scrollTop){var c=document.scrollingElement.scrollTop/2,d=0,f=null;window.requestAnimationFrame(b)}}function getOffset(a){var b={top:0,left:0};a&&(a=a.getBoundingClientRect(),b={top:a.top+window.scrollY,left:a.left+window.scrollX});return b}
function scrollToPosition(a){window.scroll({behavior:"smooth",left:0,top:a})}function selectInputValueonLoad(){var a=new URLSearchParams(window.location.search);if(a.has("selectedValue")){a=a.get("selectedValue");var b=document.querySelectorAll("select"),c=b.length,d=0;for(;d<c;d++){var f=b[d],k=f.options,h=k.length,l=0;b:for(;l<h;l++)if(k[l].value==a){f.value=a;f.dispatchEvent(new Event("change"));break b}}}}
window.onload=function(){setTimeout(function(){initSiteRedesign();selectInputValueonLoad()},700)};
function botCheck(){return/(googlebot\/|Googlebot-Mobile|Googlebot-Image|Google favicon|Mediapartners-Google|bingbot|slurp|java|wget|curl|Commons-HttpClient|Python-urllib|libwww|httpunit|nutch|phpcrawl|msnbot|jyxobot|FAST-WebCrawler|FAST Enterprise Crawler|biglotron|teoma|convera|seekbot|gigablast|exabot|ngbot|ia_archiver|GingerCrawler|webmon |httrack|webcrawler|grub.org|UsineNouvelleCrawler|antibot|netresearchserver|speedy|fluffy|bibnum.bnf|findlink|msrbot|panscient|yacybot|AISearchBot|IOI|ips-agent|tagoobot|MJ12bot|dotbot|woriobot|yanga|buzzbot|mlbot|yandexbot|purebot|Linguee Bot|Voyager|CyberPatrol|voilabot|baiduspider|citeseerxbot|spbot|twengabot|postrank|turnitinbot|scribdbot|page2rss|sitebot|linkdex|Adidxbot|blekkobot|ezooms|dotbot|Mail.RU_Bot|discobot|heritrix|findthatfile|europarchive.org|NerdByNature.Bot|sistrix crawler|ahrefsbot|Aboundex|domaincrawler|wbsearchbot|summify|ccbot|edisterbot|seznambot|ec2linkfinder|gslfbot|aihitbot|intelium_bot|facebookexternalhit|yeti|RetrevoPageAnalyzer|lb-spider|sogou|lssbot|careerbot|wotbox|wocbot|ichiro|DuckDuckBot|lssrocketcrawler|drupact|webcompanycrawler|acoonbot|openindexspider|gnam gnam spider|web-archive-net.com.bot|backlinkcrawler|coccoc|integromedb|content crawler spider|toplistbot|seokicks-robot|it2media-domain-crawler|ip-web-crawler.com|siteexplorer.info|elisabot|proximic|changedetection|blexbot|arabot|WeSEE:Search|niki-bot|CrystalSemanticsBot|rogerbot|360Spider|psbot|InterfaxScanBot|Lipperhey SEO Service|CC Metadata Scaper|g00g1e.net|GrapeshotCrawler|urlappendbot|brainobot|fr-crawler|binlar|SimpleCrawler|Livelapbot|Twitterbot|cXensebot|smtbot|bnf.fr_bot|A6-Indexer|ADmantX|Facebot|Twitterbot|OrangeBot|memorybot|AdvBot|MegaIndex|SemanticScholarBot|ltx71|nerdybot|xovibot|BUbiNG|Qwantify|archive.org_bot|Applebot|TweetmemeBot|crawler4j|findxbot|SemrushBot|yoozBot|lipperhey|y!j-asr|Domain Re-Animator Bot|AddThis)/i.test(navigator.userAgent)?!0:
!1}function rewritePageURL(a){var b=document.querySelector("#commonUtilLoad").getAttribute("data-rootPathToReplaceInURL");return a&&-1<a.indexOf(b)?isPublishInstance()?a.replace(b,"").replace(".html",""):0>a.indexOf(".html")?a+".html":a:a}function isPublishInstance(){return"true"==document.querySelector("#commonUtilLoad").getAttribute("data-isPublishInstance")?!0:!1}var clicked=!1;
function initZoom(){var a=document.getElementsByClassName("zoomContainer");0<a.length&&991<=document.body.clientWidth&&Array.prototype.forEach.call(a,function(b){b.addEventListener("click",attachClick,!1)})}
function attachClick(a){clicked=!clicked;a=document.getElementsByClassName("zoomContainer");clicked?Array.prototype.forEach.call(a,function(b){b.getElementsByTagName("picture")[0].classList.remove("flex");b.getElementsByTagName("picture")[0].classList.add("hidden");b=b.getElementsByTagName("figure")[0];null==b.getAttribute("style")&&b.setAttribute("style",b.getAttribute("data-style"));var c=b.getElementsByTagName("img")[0];null==c.getAttribute("src")&&c.setAttribute("src",c.getAttribute("data-src"));
b.classList.remove("hidden");b.addEventListener("mousemove",attachZoom,!1)}):Array.prototype.forEach.call(a,function(b){b.getElementsByTagName("picture")[0].classList.add("flex");b.getElementsByTagName("picture")[0].classList.remove("hidden");b=b.getElementsByTagName("figure")[0];b.classList.add("hidden");b.removeEventListener("mousemove",attachZoom,!1)})}
function attachZoom(a){var b=a.currentTarget;a.offsetX?offsetX=a.offsetX:offsetX=a.touches[0].pageX;a.offsetY?offsetY=a.offsetY:offsetX=a.touches[0].pageX;x=offsetX/b.offsetWidth*100;y=offsetY/b.offsetHeight*100;b.style.backgroundPosition=x+"% "+y+"%"}window.addEventListener("DOMContentLoaded",initZoom);
document.addEventListener("DOMContentLoaded",function(){if(0<document.querySelectorAll(".heroBannerCarousel").length){null!=document.querySelector(".promo-carousel")&&document.querySelectorAll(".heroBannerCarousel.slider.promo-carousel").forEach(function(b){hasClass(b,"slider")&&hasClass(b,"promo-carousel")&&b.querySelectorAll(".slide").forEach(function(c,d){b.closest("section").querySelector(".heroBannerCarousel.splide.promo-carousel .splide__list").children[d].innerHTML=c.innerHTML})});var a=document.querySelectorAll(".heroBannerCarousel .reference");
0<a.length&&a.forEach(function(b){1==b.parentNode.children.length&&0==b.children.length&&b.closest(".splide__slide")&&b.closest(".splide__slide").remove()});document.querySelectorAll(".heroBannerCarousel.splide").forEach(function(b){if(hasClass(b,"splide"))try{var c=JSON.parse(b.getAttribute("data-autorotate")),d=JSON.parse(b.getAttribute("data-autorotatespeed")),f=JSON.parse(b.getAttribute("data-pauseonhover"));JSON.parse(b.getAttribute("data-showNewPaginationBtn"));if(hasClass(b,"promo-carousel"))(new Splide(b,
{preloadPages:1,perPage:1,type:"fade",height:"40px",pagination:!1,arrows:!0,cover:!0,autoplay:!0,interval:7E3,wheel:!1,rewind:!0,dragMinThreshold:1,direction:"rtl"===document.querySelector("html").getAttribute("dir")?"rtl":"ltr"})).mount();else if(hasClass(b,"wd-card-carousel")){var k=b.querySelector("ul.splide__list").childElementCount,h=new Splide(b,{lazyLoad:"nearby",preloadPages:1,perPage:1,wheel:!1,type:"scroll",height:"auto",pagination:!1,arrows:1<k?!0:!1,gap:8,direction:"rtl"===document.querySelector("html").getAttribute("dir")?
"rtl":"ltr",dragMinThreshold:{mouse:4,touch:10},breakpoints:{7680:{perPage:5,arrows:5<k?!0:!1,gap:16},1920:{perPage:4,arrows:4<k?!0:!1,gap:16},1464:{perPage:3,arrows:3<k?!0:!1,gap:16},992:{perPage:2,arrows:2<k?!0:!1,gap:16},768:{perPage:1,arrows:1<k?!0:!1},576:{perPage:1,arrows:1<k?!0:!1}}});h.mount();slidNavshow(b);window.addEventListener("resize",function(E){slidNavshow(b)},!0);h.on("moved",function(){slidNavshow(b)})}else if(hasClass(b,"wd-hero-carousel"))"rtl"===document.querySelector("html").getAttribute("dir")?
wdHeroCarousel("rtl",b):wdHeroCarousel("ltr",b);else if(hasClass(b,"wd-1col-carousel")){var l=b.querySelector("ul.splide__list").childElementCount,p=new Splide(b,{lazyLoad:"nearby",preloadPages:1,perPage:1,wheel:!1,height:"auto",pagination:!1,type:1<l?"loop":"",autoplay:1<l&&"true"===c,interval:d?d:3E3,pauseOnHover:f,arrows:1<l?!0:!1,gap:16,dragMinThreshold:{mouse:4,touch:10}});p.mount();slidNavshow(b);window.addEventListener("resize",function(E){slidNavshow(b)},!0);p.on("moved",function(){slidNavshow(b)})}else if(hasClass(b,
"wd-2col-carousel")){var q=b.querySelector("ul.splide__list").childElementCount,t=new Splide(b,{lazyLoad:"nearby",preloadPages:1,perPage:2,wheel:!1,height:"auto",pagination:!1,type:2<q?"loop":"",autoplay:1<q&&"true"===c,interval:d?d:3E3,pauseOnHover:f,gap:16,arrows:2<q?!0:!1,dragMinThreshold:{mouse:4,touch:10},breakpoints:{992:{perPage:2,arrows:2<q?!0:!1,gap:16},768:{perPage:1,arrows:1<q?!0:!1},576:{perPage:1,arrows:1<q?!0:!1}}});t.mount();slidNavshow(b);window.addEventListener("resize",function(E){slidNavshow(b)},
!0);t.on("moved",function(){slidNavshow(b)})}else if(hasClass(b,"wd-4col-carousel")){var u=b.querySelector("ul.splide__list").childElementCount,C=new Splide(b,{lazyLoad:"nearby",preloadPages:1,perPage:4,arrows:4<u?!0:!1,wheel:!1,height:"auto",pagination:!1,type:4<u?"loop":"",autoplay:1<u&&"true"===c,interval:d?d:3E3,pauseOnHover:f,gap:16,dragMinThreshold:{mouse:4,touch:10},breakpoints:{7680:{perPage:5,arrows:5<u?!0:!1,gap:16},1920:{perPage:4,arrows:4<u?!0:!1,gap:16},1464:{perPage:3,arrows:3<u?!0:
!1,gap:16},992:{perPage:2,arrows:2<u?!0:!1,gap:16},768:{perPage:1,arrows:1<u?!0:!1},576:{perPage:1,arrows:1<u?!0:!1}}});C.mount();slidNavshow(b);window.addEventListener("resize",function(E){slidNavshow(b)},!0);C.on("moved",function(){slidNavshow(b)})}else hasClass(b,"wd-custom-carousel")?(new Splide(b,{preloadPages:1,perPage:1,type:"loop",height:"40px",pagination:!1,arrows:!0,cover:!0,autoplay:!0})).mount():hasClass(b,"spotlight")&&(new Splide(b,{type:"loop",gap:"16px",padding:"20%",pagination:!0,
arrows:!0,autoplay:c,pauseOnHover:f,direction:"rtl"===document.querySelector("html").getAttribute("dir")?"rtl":"ltr"})).mount()}catch(E){console.log("error while init carousel",E)}})}document.querySelectorAll(".splide").forEach(function(b){var c=b.getAttribute("data-shownewpaginationbtn");if(c&&JSON.parse(c)){var d=b.getAttribute("data-custompaginationsvg");b.querySelectorAll(".splide__pagination li").forEach(function(f){if(!f.querySelector("svg")){var k;null==(k=f.querySelector("button"))||k.insertAdjacentHTML("afterbegin",
""+(1<(null==d?void 0:d.length)?d:'\x3csvg class\x3d"pointer-events-none" xmlns\x3d"http://www.w3.org/2000/svg" width\x3d"16" height\x3d"16" viewBox\x3d"0 0 16 16" fill\x3d"none"\x3e\n                  \x3crect width\x3d"16" height\x3d"16" /\x3e\n                 \x3c/svg\x3e'))}})}})});function hasClass(a,b){return a.classList.contains(b)}
function slidNavshow(a){a.querySelector(".splide__slider .splide__arrows")?(a.querySelector(".splide__slider ul.splide__list").classList.remove("justify-center"),a.getElementsByClassName("firstSlide")[0].classList.contains("is-visible")?(a.getElementsByClassName("splide__track")[0].classList.remove("leftSpace"),a.getElementsByClassName("splide__track")[0].classList.add("rightSpace")):a.getElementsByClassName("lastSlide")[0].classList.contains("is-visible")&&(a.getElementsByClassName("splide__track")[0].classList.remove("rightSpace"),
a.getElementsByClassName("splide__track")[0].classList.add("leftSpace"))):(a.getElementsByClassName("splide__track")[0].classList.remove("leftSpace"),a.getElementsByClassName("splide__track")[0].classList.remove("rightSpace"),a.querySelector(".splide__slider ul.splide__list").classList.add("justify-center"))}
function checkForSubNav(a){a.mount();var b=document.querySelectorAll(".subnav-link-to-carousel a")||"";0<b.length&&(b.forEach(function(c){c.addEventListener("click",function(d){d.preventDefault();d.stopPropagation();d=c.closest(".subnav-link-to-carousel").querySelector(".slidingDiv");var f=c.offsetLeft,k=c.offsetWidth,h=c.getAttribute("href");h.startsWith("#")&&(h=parseInt(h.split("-")[h.split("-").length-1]),hero.go(h),d.style.cssText="\n                    left: "+f+"px;\n                    width: "+
k+"px;\n                    ")})}),a.on("moved",function(c){c=thisElement.querySelector(".is-active").querySelector("section").getAttribute("id");if(c=document.querySelector('[href\x3d"#'+c+'"]')){var d=c.offsetLeft,f=c.offsetWidth;c.closest(".subnav-link-to-carousel").querySelector(".slidingDiv").style.cssText="\n                left: "+d+"px;\n                width: "+f+"px;\n                "}}))}
function splideMobileView(a){a.mount();var b=document.querySelectorAll(".subnav-link-to-carousel a")||"";0<b.length&&b.forEach(function(c){c.addEventListener("click",function(){e.preventDefault();e.stopPropagation();var d=c.closest(".subnav-link-to-carousel").querySelector(".slidingDiv"),f=c.offsetLeft,k=c.offsetWidth,h=c.getAttribute("href");h.startsWith("#")&&(h=parseInt(h.split("-")[h.split("-").length-1]),a.go(h),d.style.cssText="\n                    left: "+f+"px;\n                    width: "+
k+"px;\n                    ")})})}
function wdHeroCarousel(a,b){var c=this,d=b.getAttribute("data-autorotate"),f=b.getAttribute("data-autorotatespeed"),k=b.getAttribute("data-pauseonhover");if(hasClass(b,"disable-splide-mobile")){if(991<=window.innerWidth){var h=b.querySelector("ul.splide__list").childElementCount,l=new Splide(b,{lazyLoad:"nearby",preloadPages:1,perPage:1,wheel:!1,height:"auto",pagination:1<h?!0:!1,arrows:1<h?!0:!1,type:1<h?"loop":"",autoplay:1<h?d:"",interval:f?f:3E3,pauseOnHover:k,dragMinThreshold:{mouse:4,touch:10},
direction:a});document.querySelector(".subnav-link-to-carousel")?window.addEventListener("load",function(q){c.checkForSubNav(l)}):this.checkForSubNav(l)}}else{h=b.querySelector("ul.splide__list").childElementCount;var p=new Splide(b,{lazyLoad:"nearby",preloadPages:1,perPage:1,wheel:!1,height:"auto",pagination:1<h?!0:!1,arrows:1<h?!0:!1,type:1<h?"loop":"",autoplay:1<h?d:"",interval:f?f:3E3,pauseOnHover:k,dragMinThreshold:{mouse:4,touch:10},direction:a});document.querySelector(".subnav-link-to-carousel")?
window.addEventListener("load",function(q){c.splideMobileView(p)}):this.splideMobileView(p)}}
document.addEventListener("DOMContentLoaded",function(){document.querySelector(".splide.promo-carousel-2-5")&&document.querySelectorAll(".splide.promo-carousel-2-5").forEach(function(a){var b=a.getAttribute("data-autorotate"),c=a.getAttribute("data-autorotatespeed"),d=a.getAttribute("data-pauseonhover");(new Splide(a,{preloadPages:1,perPage:1,type:"fade",height:"40px",pagination:!1,arrows:!0,cover:!0,autoplay:b,interval:c?c:7E3,pauseOnHover:d,wheel:!1,rewind:!0,dragMinThreshold:1})).mount()})});
var StoreProductCart=Vue.newInstance("StoreProductCartApp",{el:"#product-cart-component",mixins:[commerceService],data:{totalItems:0,cartItemsLabelFromI18n:"Cart Items:",sessionCartDetails:{},isCatalogPurchasable:!1,platformCommerceURL:"",totalItemsAriaLabel:"",cartItems:{},promotionsFound:!1,promotionsInfoFromI18n:{},promotion:{},defaultPromotions:{},acceptedPromotions:[],showCandyRackContainer:!1,isUserLoggedIn:!1,isCandyRackCartCTAClicked:!1,skuId:"",productInfo:{},productPriceObj:{},accordionShow:!1,
responseMessage:"",pbScope:{},mainSkuId:"",mainSkuQuantity:1,productQuantity:{},mainEvent:{},productReferences:{},candyRackProducts:[],isUpsellAdded:!1,upsellSku:"",isServiceProductAdded:!1,serviceProductSku:"",cartObjectMap:{},dataRequest:{},freeShippingMessage:""},mounted:function(){var a=this;this.$nextTick(function(){a.isWcmModeDisabled()&&null!=document.querySelector('[ng-controller\x3d"StoreProductCartController"]')&&document.querySelector('[ng-controller\x3d"StoreProductCartController"]').closest(".product-cart").remove();
a.$data.isCatalogPurchasable=a.getPurchasableCatalog();a.$data.platformCommerceURL=a.getPlatformCommerceURL();a.initCart();a.getCartData()})},methods:{initCart:function(){var a=this,b=this.$refs.cartpromotion.dataset.cartpromotionsjsonstring;this.$data.cartItemsLabelFromI18n=this.$refs.cartitems.dataset.cartitems;this.$data.promotionsInfoFromI18n=JSON.parse(b);this.pc_commonLogger("cart promotions",this.$data.promotionsInfoFromI18n);var c=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.USER_DETAILS);
this.pc_commonLogger("sessionUserDetails::"+JSON.stringify(c));null!=c?(this.pc_commonLogger("userid::"+c.uid),"undefined"!=typeof c.uid?this.$data.isUserLoggedIn=!0:(this.pc_commonLogger("in initUserInfo: anonymous user ..."),this.$data.isUserLoggedIn=!1)):this.getUser().then(function(){c=a.getSessionVariable(a.$data.COMMERCE_CONSTANTS.USER_DETAILS);a.pc_commonLogger("userid::"+c.uid);null!=c&&"undefined"!=typeof c.uid?a.$data.isUserLoggedIn=!0:(userInfoLogger("anonymous user ..."),a.$data.isUserLoggedIn=
!1)}).catch(function(d){a.pc_commonLogger("user info error ...");a.$data.isUserLoggedIn=!1})},showCandyRackProducts:function(a,b,c,d,f,k){var h=this;document.querySelector(".cartwrapper").classList.remove("hidden");document.querySelector(".wd-header-2-5")&&!document.querySelector(".minicartWrapper")||document.querySelector("body").classList.add("overflow-hidden","miniCartOpen");992>=window.screen.width&&document.querySelector(".wd-header-2-5")&&(document.querySelector("body").classList.add("mob-minicart-open"),
this.getTotalItemHeight());this.pc_commonLogger("in showCandyRackProducts");try{var l=[],p=[],q=[];this.$data.pbScope=a;if("undefined"==typeof f||null==f)f=this.$data.pbScope.$data.product.quantity;this.$data.mainSkuId=c;this.$data.mainSkuQuantity=f;this.$data.productQuantity[c]=f;this.$data.mainEvent=d;this.getProductInfo(c);this.getPrice(c);this.pc_commonLogger("adding main sku to cart obj");this.updateCartObject(c,f,"MAIN");k&&""!=k&&(this.$data.isServiceProductAdded=!1,this.updateCartObject(k,
f,"SERVICE"));b.forEach(function(t,u){p.push(t.code);null==h.getSessionVariable(t.code)&&q.push(t.code)});this.pc_commonLogger("all product ID's",p.join());this.pc_commonLogger("missingFromSessionProductIds",q.join());0<q.length?this.getProductPrice(p.join()).then(function(t){h.pc_commonLogger("product cart - got price for all missing SKUs");b.forEach(function(u,C){h.$data.productQuantity[u.code]=1;C=h.getSessionVariable(u.code);h.pc_commonLogger("product cart - candy rack sku inventory",C);null==
C||!C.purchasable||"Active"!=C.productLifeCycle||"inStock"!=C.stockStatus&&"lowStock"!=C.stockStatus?h.pc_commonLogger("product cart - check inventory",u):(l.push(u),h.getProductInfo(u.code),h.getPrice(u.code))})}).catch(function(t){pc_commonLogger("product cart - Rejection from commerce service")}):b.forEach(function(t,u){h.$data.productQuantity[t.code]=1;u=h.getSessionVariable(t.code);h.pc_commonLogger("product cart - candy rack sku inventory",u);null==u||!u.purchasable||"Active"!=u.productLifeCycle||
"inStock"!=u.stockStatus&&"lowStock"!=u.stockStatus?h.pc_commonLogger("product cart - check inventory",t):(l.push(t),h.getProductInfo(t.code),h.getPrice(t.code))});this.$data.productReferences=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);null==this.$data.productReferences?(this.pc_commonLogger("calling get product references from product cart component. . ."),this.getProductReferences().then(function(){h.$data.productReferences=h.getSessionVariable(h.$data.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);
h.$data.showCandyRackContainer=!0;h.$data.candyRackProducts=l;h.getCartData();h.triggerCandyRackAnalyticsWhenProductsAreAvailable();setTimeout(function(){tabKeyFunctionality("#openCartModal")},1E3)}).catch(function(t){h.pc_commonLogger("Issue in getting product references ",t)})):(this.$data.showCandyRackContainer=!0,this.$data.candyRackProducts=l,this.getCartData(),this.triggerCandyRackAnalyticsWhenProductsAreAvailable(),setTimeout(function(){tabKeyFunctionality("#openCartModal")},1E3))}catch(t){console.error("Issue in showing candy rack products  ",
t),this.$data.pbScope.triggerAddToCart(this.$data.mainSkuId,this.$data.mainEvent,this.$data.mainSkuQuantity,this.$data)}},triggerCandyRackAnalyticsWhenProductsAreAvailable:function(){var a=this;"undefined"==typeof this.$data.candyRackProducts||""==this.$data.candyRackProducts?setTimeout(function(){"undefined"!=typeof window.aa&&window.aa&&a.triggerCandyRackAnalyticsWhenProductsAreAvailable()},1E3):this.triggerCandyRackAnalyticsEvent("SC_CRI")},triggerCandyRackAnalyticsEvent:function(a){try{var b=
{};b.sourceSkuid=this.$data.mainSkuId;b.upsellSkuid=[];b.crosssellSkuid=[];this.$data.candyRackProducts.forEach(function(c){-1<c.refType.indexOf("UPSELLING")?b.upsellSkuid.push(c.code):b.crosssellSkuid.push(c.code)});a=window.aa.createEvent(a,b);window.dispatchEvent(a)}catch(c){console.log("Error while triggering analytics Candy Rack",a)}},addActiveBorder:function(a){(a=a.target.closest(".cr-product-item"))&&a.classList.toggle("crp-prodect-item-active")},updateCartObject:function(a,b,c){var d=!0;
-1<c.indexOf("UPSELLING")?this.$data.isUpsellAdded?(delete this.$data.cartObjectMap[this.$data.upsellSku],this.pc_commonLogger("upsellSku equal ?  ",a,this.$data.upsellSku),a==this.$data.upsellSku?(this.$data.isUpsellAdded=!1,this.$data.upsellSku="",d=!1):(this.$data.upsellSku=a,this.$data.isUpsellAdded=!0)):(this.$data.upsellSku=a,this.$data.isUpsellAdded=!0):"SERVICE"==c?this.$data.isServiceProductAdded?(delete this.$data.cartObjectMap[this.$data.serviceProductSku],this.pc_commonLogger("serviceProductSku equal ?  ",
a,this.$data.serviceProductSku),a==this.$data.serviceProductSku?(this.$data.isServiceProductAdded=!1,this.$data.serviceProductSku="",d=!1):(this.$data.serviceProductSku=a,this.$data.isServiceProductAdded=!0)):(this.$data.serviceProductSku=a,this.$data.isServiceProductAdded=!0):null!=this.$data.cartObjectMap[a]&&this.$data.cartObjectMap[a].quantity==this.$data.productQuantity[a]&&(delete this.$data.cartObjectMap[a],d=!1);if(d){var f={};f.quantity=this.$data.productQuantity[a];var k={};k.code=a;var h=
{};h.code=c;k.productType=h;"SERVICE"==c&&(k.associatedProductCode=this.$data.mainSkuId);f.product=k;this.$data.cartObjectMap[a]=f}this.$forceUpdate();this.pc_commonLogger("cartObj",this.$data.cartObjectMap);"MAIN"!=c&&this.triggerCandyRackPopUpActionsEvent(a,b,c,d)},triggerCandyRackPopUpActionsEvent:function(a,b,c,d){try{var f={},k="";-1<c.indexOf("UPSELLING")?(f.upsellSkuid=a,f.upsellSkuUnit=this.$data.productQuantity[this.$data.mainSkuId],k=d?"SC_CRU":"SC_CRUR"):(f.crosssellSkuid=a,f.crosssellSkuUnit=
b,k=d?"SC_CRA":"SC_CRAR");k=window.aa.createEvent(k,f);window.dispatchEvent(k)}catch(h){console.log("Error while triggering analytics Candy Rack Popup Actions SC_CRA,SC_CRAR,SC_CRU,SC_CRUR event")}},addToCartCandyRack:function(a){var b=this;this.$data.dataRequest={};var c=this.$data.mainSkuId;this.$data.isCandyRackCartCTAClicked=!0;if(a)try{if(null!=this.$data.cartObjectMap[this.$data.upsellSku]&&(delete this.$data.cartObjectMap[this.$data.mainSkuId],this.$data.cartObjectMap[this.$data.upsellSku].quantity=
this.$data.productQuantity[this.$data.mainSkuId],c=this.$data.upsellSku,null!=this.$data.cartObjectMap[this.$data.serviceProductSku])){var d=JSON.parse(JSON.stringify(this.$data.cartObjectMap[this.$data.serviceProductSku]));delete this.$data.cartObjectMap[this.$data.serviceProductSku];this.$data.cartObjectMap[this.$data.serviceProductSku]=d;this.$data.cartObjectMap[this.$data.serviceProductSku].product.associatedProductCode=this.$data.upsellSku}null!=this.$data.cartObjectMap[this.$data.serviceProductSku]&&
(this.$data.cartObjectMap[this.$data.serviceProductSku].quantity=this.$data.productQuantity[this.$data.mainSkuId]);this.$data.showCandyRackContainer=!this.$data.showCandyRackContainer;var f=document.querySelector(".cartwrapper");null!=f&&this.removeClass(f.querySelector(".cartShowInProgress"),"hidden");768>window.innerWidth&&this.scrollToTop(600);this.$data.dataRequest.cartEntries=Object.values(this.$data.cartObjectMap);this.pc_commonLogger("Add to cart candyrack : Json Object",this.$data.dataRequest);
this.$data.isNewCartInstance=!1;var k=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.CART_DETAILS);null==k||"undefined"!=typeof k.cartId&&null!=k.cartId&&"undefined"!=typeof k.cartEntries&&0!=k.cartEntries.length||(this.$data.isNewCartInstance=!0);this.addMultipleProductToCart(this.$data.dataRequest).then(function(h){b.$forceUpdate();b.pc_commonLogger("returned from adding product to cart, now update cart");b.setSkuId(c);b.showMiniCart();b.triggerCandyRackAddToCartAnalyticsEvent()}).catch(function(h){console.error("Issue while adding candy rack products  ");
b.$data.pbScope.triggerAddToCart(b.$data.mainSkuId,b.$data.mainEvent,b.$data.mainSkuQuantity,b)})}catch(h){console.error("Issue while adding candy rack products  ",h),this.$data.pbScope.triggerAddToCart(this.$data.mainSkuId,this.$data.mainEvent,this.$data.mainSkuQuantity,this)}else this.$data.pbScope.triggerAddToCart(this.$data.mainSkuId,this.$data.mainEvent,this.$data.mainSkuQuantity,this)},triggerCandyRackAddToCartAnalyticsEvent:function(){var a=this;try{var b={},c=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.CART_DETAILS),
d=Object.keys(this.$data.cartObjectMap);b.cartID=c.cartId;if(this.$data.isUpsellAdded){var f={},k=this.$data.productInfo[this.$data.upsellSku];f.productName=k.pageTitle;f.productSkuName=k.variantTitle;f.productID=k.pagePath.substring(k.pagePath.lastIndexOf("/")+1);f.skuID=this.$data.upsellSku;h=this.$data.productPriceObj[this.$data.upsellSku];f.productUnitPrice=h.prices.list.amount.toFixed(2).toString();f.productSalePrice=h.prices.sale.amount.toFixed(2).toString();f.productDiscount=(h.prices.list.amount-
h.prices.sale.amount).toFixed(2);b.upsellProduct=f}else{k={};f=this.$data.productInfo[this.$data.mainSkuId];k.productName=f.pageTitle;k.productSkuName=f.variantTitle;k.productID=f.pagePath.substring(f.pagePath.lastIndexOf("/")+1);k.skuID=this.$data.mainSkuId;var h=this.$data.productPriceObj[this.$data.mainSkuId];k.productUnitPrice=h.prices.list.amount.toFixed(2).toString();k.productSalePrice=h.prices.sale.amount.toFixed(2).toString();k.productDiscount=(h.prices.list.amount-h.prices.sale.amount).toFixed(2);
b.mainProduct=k}var l=[];d.forEach(function(q){if(q!=a.$data.upsellSku&&q!=a.$data.mainSkuId){var t={},u=a.$data.productInfo[q];t.productName=u.pageTitle;t.productSkuName=u.variantTitle;t.productID=u.pagePath.substring(u.pagePath.lastIndexOf("/")+1);t.skuID=q;q=a.$data.productPriceObj[q];t.productUnitPrice=q.prices.list.amount.toFixed(2).toString();t.productSalePrice=q.prices.sale.amount.toFixed(2).toString();t.productDiscount=(q.prices.list.amount-q.prices.sale.amount).toFixed(2);l.push(t)}});l.length&&
(b.crosssellProducts=l);this.pc_commonLogger("candy rack addtocart analytics dataObj",b);var p=window.aa.createEvent(this.$data.isNewCartInstance?"CANDY_RACK_SC_FIRST":"CANDY_RACK_ADD_TO_CART",b);window.dispatchEvent(p)}catch(q){console.log("Error while triggering analytics Candy Rack add to cart event")}},getFilteredCandyRackProducts:function(a,b){return b?this.$data.candyRackProducts.filter(function(c){return-1<c.refType.indexOf(a)}):this.$data.candyRackProducts.filter(function(c){return c.refType!=
a})},increment:function(a){this.$data.productQuantity[a]++;this.$data.cartObjectMap[a]&&(this.$data.cartObjectMap[a].quantity=this.$data.productQuantity[a]);this.$forceUpdate();this.pc_commonLogger("cartObj after increment",this.$data.cartObjectMap)},decrement:function(a){this.$data.productQuantity[a]--;this.$data.cartObjectMap[a]&&(this.$data.cartObjectMap[a].quantity=this.$data.productQuantity[a]);this.$forceUpdate();this.pc_commonLogger("cartObj after decrement",this.$data.cartObjectMap)},resetCandyRackData:function(){this.$data.showCandyRackContainer=
!1;this.$data.candyRackProducts=[];this.$data.cartObjectMap={};this.$data.productQuantity={};this.$data.productTypeMap={};this.$data.pbScope=null;this.$data.mainSkuId="";this.$data.mainSkuQuantity="";this.$data.mainEvent="";this.$data.upsellSku="";this.$data.serviceProductSku="";this.$data.isCandyRackCartCTAClicked=!1;this.$data.isUpsellAdded=!1;this.$data.isServiceProductAdded=!1},getCartData:function(){var a=this;this.pc_commonLogger("in getCartData...");if(this.$data.isCatalogPurchasable){this.$data.totalItems=
0;this.$data.totalItemsAriaLabel=this.$data.cartItemsLabelFromI18n+"0";var b=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.CART_DETAILS);null!=b&&"undefined"!=typeof b.cartId?(this.pc_commonLogger("cart details found in session"),this.$data.totalItems=b.totalUnitCount,this.$data.totalItemsAriaLabel=this.$data.cartItemsLabelFromI18n+this.$data.totalItems,this.freeShippingMessage=b.freeShippingMessage):this.getCartSummary().then(function(c){a.pc_commonLogger(c);a.pc_commonLogger("product cart - got cart details");
b=a.getSessionVariable(a.$data.COMMERCE_CONSTANTS.CART_DETAILS);a.pc_commonLogger(b);null!=b&&"undefined"!=typeof b.cartId&&(a.$data.totalItems=b.totalUnitCount,a.$data.totalItemsAriaLabel=a.$data.cartItemsLabelFromI18n+a.$data.totalItems,a.freeShippingMessage=b.freeShippingMessage)}).catch(function(c){a.pc_commonLogger("error while getting cart summary...")})}},showMiniCart:function(a,b){var c=this;this.pc_commonLogger("in show minicart...",a);this.pc_commonLogger("in show minicart...cartUrl..",
b);if(a&&a.target&&null!=a.target.closest(".store-product-cart-container")&&!a.target.classList.contains("pointer-events-none")){b=this.gotoCommerceURL(b);this.pc_commonLogger("in show minicart...cart icon clicked.. navigating to cart page..",b);try{var d=window.aa.createEvent("MINI_CART_IMPRESSION",{});window.dispatchEvent(d)}catch(f){console.log("Error while triggering analytics mini cart impression event")}this.removeAllSessionVariable();window.location=b}else document.querySelector(".mm-ocd--open")&&
(document.querySelector(".mm-ocd--open").style.zIndex=1),document.querySelector(".mMenutoggleWidth")&&(document.querySelector(".mMenutoggleWidth").style.zIndex="11"),992>=window.screen.width&&document.querySelector(".wd-header-2-5")&&(document.querySelector("body").classList.add("mob-minicart-open"),this.getTotalItemHeight()),a=document.querySelector(".mini-cart-trigger"),b=document.querySelector(".cartinitloadmessage"),null!=a&&a.classList.contains("triggerdFromAddToCart")?a.classList.remove("triggerdFromAddToCart"):
null!=b&&b.classList.remove("hidden"),a=document.querySelector(".addToCartBogo"),null!=a&&(a.classList.add("pointer-events-none"),a.classList.add("opacity-25")),this.getCartInfo().then(function(){c.pc_commonLogger("product cart - got cart info");c.$data.promotionsFound=!1;var f=c.getSessionVariable(c.$data.COMMERCE_CONSTANTS.CART_DETAILS);c.$data.cartItems=f;c.$data.totalItems=f.totalUnitCount;c.$data.totalItemsAriaLabel=c.$data.cartItemsLabelFromI18n+c.$data.totalItems;c.freeShippingMessage=f.freeShippingMessage;
"undefined"==typeof c.$data.totalItems||0==c.$data.totalItems?(document.querySelector(".cartwrapper").classList.add("hidden"),document.querySelector(".wd-header-2-5")&&!document.querySelector(".minicartWrapper")||document.querySelector("body").classList.remove("overflow-hidden","miniCartOpen")):(document.querySelector(".cartwrapper").classList.remove("hidden"),document.querySelector(".wd-header-2-5")&&!document.querySelector(".minicartWrapper")||document.querySelector("body").classList.add("overflow-hidden",
"miniCartOpen"));if(f.promotions&&f.promotions.length&&Object.keys(c.$data.promotionsInfoFromI18n).length){for(var k=0;k<f.promotions.length;k++){var h=f.promotions[k].consumedEntries;if(h[0]&&h[0].code==c.getSkuId()){c.$data.promotion.code=h[0].code;c.$data.promotion.orderEntryNumber=h[0].orderEntryNumber;c.$data.promotion.targetProducts=f.promotions[k].targetProducts;var l=f.promotions[k].msgText.split("|")[0],p=f.promotions[k].msgText.split("|")[1];null!=l&&"displayMessage"==l?c.$data.promotionsFound=
!1:(c.$data.promotion.key=p,c.$data.promotion.info=c.$data.promotionsInfoFromI18n.promotions[0][p],c.pc_commonLogger("promotionobj ",c.$data.promotion),c.$data.promotionsFound=-1==p.indexOf("Default"))}}if(!c.$data.promotionsFound){for(k=0;k<f.promotions.length;k++)c.$data.defaultPromotions={},h=f.promotions[k].consumedEntries,l=f.promotions[k].msgText.split("|")[0],p=f.promotions[k].msgText.split("|")[1],null!=l&&"displayMessage"!=l&&-1!=p.indexOf("Default")&&(c.$data.defaultPromotions[h[0].code]=
c.$data.promotionsInfoFromI18n.promotions[0][p].desc);c.pc_commonLogger(c.$data.defaultPromotions)}}f.acceptedPromotions&&(c.$data.acceptedPromotions=f.acceptedPromotions.filter(function(t){if(t.isPromotionAccepted)return t}));if(c.$data.promotionsFound)for(k=0;k<c.$data.promotion.targetProducts.length;k++)c.$data.promotion.targetProducts[k].productInfo=c.getProductInfo(c.$data.promotion.targetProducts[k].productId),c.$data.promotion.targetProducts[k].productPriceObj=c.getPrice(c.$data.promotion.targetProducts[k].productId),
c.$data.promotion.targetProducts[k].selected=!1;c.processCartStatus(f.responseMessage);c.processProductAddMessage(f.responseMessage);null!=document.querySelector("[data-target\x3d'#openCartModal']")&&document.querySelector("[data-target\x3d'#openCartModal']").removeAttribute("data-target");f=document.querySelector(".addToCartBtn");null!=f&&f.matches(".addToCartBtnActive")?(f.setAttribute("data-target","#openCartModal"),c.removeClass(f,"addToCartBtnActive"),document.querySelector("#openCartModal .wd-modal-close")&&
document.querySelector("#openCartModal .wd-modal-close").focus()):document.querySelector(".mini-cart-trigger").setAttribute("data-target","#openCartModal");try{var q=window.aa.createEvent("MINI_CART_IMPRESSION",{});window.dispatchEvent(q)}catch(t){console.log("Error while triggering analytics mini cart impression event")}document.querySelector(".sd-minicart-wrapper")&&c.getTotalItemHeight()})},getTotalItemHeight:function(){},getSkuId:function(){return this.$data.skuId},setSkuId:function(a){this.$data.skuId=
a},getProductInfo:function(a){var b=this;this.pc_commonLogger("in getProductInfo...");var c={},d=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);d&&d[a]?(c.pagePath=d[a].pagePath,c.pageTitle=d[a].pageTitle,c.urlFileReference=d[a].urlFileReference,c.variantTitle=d[a].variantTitle,this.$data.productInfo[a]=c):this.getProductReferences().then(function(){var f=b.getSessionVariable(b.$data.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);f&&f[a]&&(c.pagePath=f[a].pagePath,c.pageTitle=f[a].pageTitle,
c.urlFileReference=f[a].urlFileReference,c.variantTitle=f[a].variantTitle,b.$data.productInfo[a]=c,b.$forceUpdate())});this.pc_commonLogger("product info for "+a,c);return c},getPrice:function(a){var b=this;this.pc_commonLogger("in getProductPrice...");var c={},d=this.getSessionVariable(a);null!=d&&null!=d.prices?(c=d,this.$data.productPriceObj[a]=c):this.getProductPrice(a).then(function(){var f=b.getSessionVariable(a);null!=f&&(c=f,b.$data.productPriceObj[a]=c,b.$forceUpdate())});this.pc_commonLogger("product price for "+
a,c);return c},selectBogoProduct:function(a,b){this.pc_commonLogger("in selectBogoProduct...");b=b.currentTarget;null!=document.querySelector(".bogoProduct.active")&&(this.removeClass(document.querySelector(".bogoProduct.active"),"border-black"),this.removeClass(document.querySelector(".bogoProduct.active"),"border-2"),this.addClass(document.querySelector(".bogoProduct.active"),"border"),this.addClass(document.querySelector(".bogoProduct.active"),"border-grey-light"),this.removeClass(document.querySelector(".bogoProduct.active"),
"active"));a.selected?(this.addClass(document.querySelector(".addToCartBogo"),"pointer-events-none"),this.addClass(document.querySelector(".addToCartBogo"),"opacity-25"),this.removeClass(b,"border-black"),this.removeClass(b,"border-2"),this.removeClass(b,"active"),this.addClass(b,"border-grey-light"),this.addClass(b,"border")):(this.removeClass(document.querySelector(".addToCartBogo"),"pointer-events-none"),this.removeClass(document.querySelector(".addToCartBogo"),"opacity-25"),this.addClass(b,"border-black"),
this.addClass(b,"border-2"),this.addClass(b,"active"),this.removeClass(b,"border-grey-light"),this.removeClass(b,"border"),b.setAttribute("data-productId",a.productId),b.setAttribute("data-quantity",a.qty));for(b=0;b<this.$data.cartItems.promotions.length;b++)for(var c=0;c<this.$data.cartItems.promotions[b].targetProducts.length;c++)this.$data.cartItems.promotions[b].targetProducts[c].selected&&this.$data.cartItems.promotions[b].targetProducts[c].productId!=a.productId&&(this.$data.cartItems.promotions[b].targetProducts[c].selected=
!1);return!a.selected},addToCart:function(){var a=this;this.pc_commonLogger("in addToCart...");if(null!=document.querySelector(".bogoProduct.active")){var b=document.querySelector(".bogoProduct.active").getAttribute("data-productId"),c=document.querySelector(".bogoProduct.active").getAttribute("data-quantity");c="undefined"!=typeof c?parseInt(c):1;this.pc_commonLogger("productId..."+b);this.pc_commonLogger("quantity..."+c);this.addProductToCart(b,c).then(function(d){a.$data.promotion={};a.showMiniCart();
a.$data.promotionsFound=!1;a.$forceUpdate()})}},handleSkipBogoPromotions:function(){var a=this;this.pc_commonLogger("in handleSkipBogoPromotions");var b=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.CART_DETAILS);this.getCartInfo().then(function(){a.pc_commonLogger("product cart - got cart details");b=a.getSessionVariable(a.$data.COMMERCE_CONSTANTS.CART_DETAILS);a.skipBogoPromotion(b)})},skipBogoPromotion:function(a){var b=this;a=this.$data.promotion.code;var c=this.$data.promotion.orderEntryNumber;
this.pc_commonLogger("skipping bogo promotion: consumed entry :"+a+" , entryNumber:"+c);this.skipBogoOffer(a,c).then(function(){b.pc_commonLogger("bogo promotion skipped");b.$data.promotion={};b.showMiniCart();b.$forceUpdate()},function(d){this.pc_commonLogger("failed to skip bogo promotion");this.$data.promotion={};this.showMiniCart();this.$forceUpdate()})},accept3PP:function(a,b){var c=this;this.pc_commonLogger("in accept3PPromotion...");this.pc_commonLogger("consumed entry..."+this.$data.promotion.code);
var d;b&&null!=document.querySelector(".bogoProduct.active")&&(d=document.querySelector(".bogoProduct.active").getAttribute("data-productId"));this.accept3PPromotion(this.$data.promotion.key,a,d).then(function(){c.pc_commonLogger("3pp response success...");c.$data.promotion={};c.showMiniCart();c.$data.promotionsFound=!1})},processCartStatus:function(a){var b=this,c=document.querySelector(".cartwrapper");this.hasClass(c,"updateCartData")&&(this.addClass(c.querySelector(".cartSignInBar"),"hidden"),
this.addClass(c.querySelector(".cartShowInProgress"),"hidden"),void 0!=a&&""!=a?setTimeout(function(){},5E3):(this.removeClass(c.querySelector(".cartShowCompleted"),"hidden"),this.addClass(c.querySelector(".cartShowCompleted"),"miniCartAnimateBar"),setTimeout(function(){b.removeClass(document.querySelector(".cartShowCompleted"),"miniCartAnimateBar")},4600),setTimeout(function(){b.addClass(document.querySelector(".cartShowCompleted"),"hidden")},5E3),setTimeout(function(){},5200)))},processProductAddMessage:function(a){void 0!=
a&&""!=a?(this.$data.responseMessage=a,this.removeClass(document.querySelector(".showProductAddResponse"),"hidden"),a=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.CART_DETAILS),null!=a&&(a.responseMessage="",this.setSessionVariable(this.$data.COMMERCE_CONSTANTS.CART_DETAILS,a))):this.addClass(document.querySelector(".showProductAddResponse"),"hidden")},getCartUrl:function(a){return this.$data.platformCommerceURL+a},hideMiniCart:function(){var a=document.querySelector(".cartwrapper");a.classList.add("hidden");
992>=window.screen.width&&document.querySelector(".wd-header-2-5")&&document.querySelector("body").classList.remove("mob-minicart-open");document.querySelector(".mm-ocd--open")&&(document.querySelector(".mm-ocd--open").style.zIndex=130);document.querySelector("body").classList.remove("overflow-hidden","miniCartOpen");this.$data.showCandyRackContainer&&!this.$data.isCandyRackCartCTAClicked?(this.triggerCandyRackAnalyticsEvent("SC_CRC"),this.$data.pbScope.triggerAddToCart(this.mainSkuId,this.mainEvent,
this.mainSkuQuantity,this)):(a.classList.remove("updateCartData"),null!=a.querySelector(".cartShowInProgress")&&a.querySelector(".cartShowInProgress").classList.add("hidden"),null!=a.querySelector(".cartShowCompleted")&&a.querySelector(".cartShowCompleted").classList.add("hidden"),null!=a.querySelector(".cartSignInBar")&&a.querySelector(".cartSignInBar").classList.remove("miniCartAnimateBar"));document.querySelector(".sd-minicart-wrapper")&&(a=document.querySelector(".sd-minicart-content"),document.querySelector(".transition-animi").classList.remove("opacityAnimi"),
a.classList.remove("widthAnimi"));this.resetCandyRackData()},openLoginPopupFromCart:function(a){this.pc_commonLogger("in openLoginPopupFromCart");this.hideMiniCart();StoreCommerceUserInfoApp[0].triggerSignInModal();StoreCommerceUserInfoApp[0].$forceUpdate()},closeSignInBanner:function(a){a.currentTarget.parentElement.style.display="none";if(a=document.querySelector(".signInSection"))a.classList.remove("flex"),a.classList.add("hidden");this.getTotalItemHeight()},formatPrice:function(a,b){a=(new Intl.NumberFormat(this.getLocale(),
{style:"currency",currency:b})).format(a);if("en-CA"==this.getLocale()||"fr-CA"==this.getLocale())a=a.replace("$","C$ ");return a},updatePromoMessage:function(a){return a.superPromoDescription&&this.productPriceObj[a.code].prices.upsell&&this.productPriceObj[a.code].prices.upsell.amount?a.superPromoDescription.replace("upsellPriceDifference",this.formatPrice(this.productPriceObj[a.code].prices.upsell.amount-this.productPriceObj[this.mainSkuId].prices.sale.amount,this.productPriceObj[a.code].prices.upsell.currency)):
a.refDesc},pc_commonLogger:function(a,b){-1<window.location.search.indexOf("debugSPC\x3dtrue")&&console.log("PC: "+a,null!=b?b:"")}}}),StoreCommerceUserInfoApp=Vue.newInstance("StoreCommerceUserInfoApp",{el:"#commerce-user-info-component",mixins:[commerceService],data:{isUserLoggedIn:!1,totalItems:0,isCustomerChannelB2B:!1,wdCreditEnabledForUser:!1,firstName:"",emailId:"",popupType:"",platformCommerceURL:"",isCatalogPurchasable:!1,showLoginForm:!1,showResendEmailForm:!1,showForgotPwdForm:!1,resendVerificationSuccess:!1,
resendVerificationSuccessMsg:"",loginSource:"",showPasswordResetMessage:!1,forgotPwdSuccess:!1,forgotSuccessMsg:"",validUserName:!0,loginEmail:"",passwordNotEmpty:!0,loginPassword:"",redirectPaths:{},b2bLoginRedirectPath:null,appyNowTreviPayURL:""},mounted:function(){this.isWcmModeDisabled()&&null!=document.querySelector('[ng-controller\x3d"StoreCommerceUserInfoAppController"]')&&document.querySelectorAll('[ng-controller\x3d"StoreCommerceUserInfoAppController"]').forEach(function(a){a.closest(".commerce-user-info").remove()});
this.initUserInfo()},methods:{initUserInfo:function(){var a=this;this.userInfoLogger("in initUserInfo...");this.$data.isCatalogPurchasable=this.getPurchasableCatalog();this.$data.platformCommerceURL=this.getPlatformCommerceURL();var b=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.USER_DETAILS);this.userInfoLogger("in initUserInfo::sessionUserDetails::"+JSON.stringify(b));null!=b?(this.userInfoLogger("in initUserInfo::userid::"+b.uid),"undefined"!=typeof b.uid?(this.$data.isUserLoggedIn=!0,
b=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.USER_DETAILS),this.$data.totalItems=b.wishlistCount,this.$data.isCustomerChannelB2B=b.customerChannel&&"B2B"==b.customerChannel?!0:!1,this.$data.wdCreditEnabledForUser=b.enableWDCredit,this.$data.firstName=b.firstName,this.$data.emailId=b.uid,this.$data.popupType=b.popupType,this.showAfterLoginPopup()):(this.userInfoLogger("in initUserInfo: anonymous user ..."),this.$data.isUserLoggedIn=!1,this.$data.isCustomerChannelB2B=!1,this.$data.wdCreditEnabledForUser=
!1),this.showProfileIconAndSection()):this.getUser().then(function(c){b=a.getSessionVariable(a.$data.COMMERCE_CONSTANTS.USER_DETAILS);a.userInfoLogger("in initUserInfo: user info :"+JSON.stringify(b));null!=b&&"undefined"!=typeof b.uid?(a.$data.isUserLoggedIn=!0,a.$data.totalItems=b.wishlistCount,a.$data.isCustomerChannelB2B=b.customerChannel&&"B2B"==b.customerChannel?!0:!1,a.$data.wdCreditEnabledForUser=b.enableWDCredit,a.$data.firstName=b.firstName,a.$data.emailId=b.uid,a.$data.popupType=b.popupType,
a.showAfterLoginPopup()):(a.userInfoLogger("in initUserInfo: anonymous user ..."),a.$data.isUserLoggedIn=!1,a.$data.isCustomerChannelB2B=!1,a.$data.wdCreditEnabledForUser=!1);a.showProfileIconAndSection()},function(){this.userInfoLogger("in initUserInfo: user info error ...");this.$data.isUserLoggedIn=!1;this.$data.isCustomerChannelB2B=!1;this.$data.wdCreditEnabledForUser=!1;this.showProfileIconAndSection()}).catch(function(c){a.userInfoLogger("in initUserInfo: user info exception ...");a.$data.isUserLoggedIn=
!1;a.$data.isCustomerChannelB2B=!1;a.$data.wdCreditEnabledForUser=!1;a.showProfileIconAndSection()})},showProfileIconAndSection:function(){this.$data.appyNowTreviPayURL=this.getAppyNowTreviPayURL();var a=document.querySelector(".nav-container");if(a){a=a.querySelector("li#profile");var b=a.querySelector("div\x3ebutton.dropDownItem");this.$data.isUserLoggedIn?(a.querySelectorAll(".signin").forEach(function(c){c.remove()}),!this.$data.isCustomerChannelB2B&&a.querySelector(".mobileMyAccount")&&(a.ariaLabel=
a.querySelector(".mobileMyAccount").innerHTML,b.dataset.trackHeading=a.querySelector(".mobileMyAccount").innerHTML+" - Nav",a.querySelector(".mobileMyAccount").classList.remove("hidden"),a.querySelector(".mobileMyAccount").classList.add("md:hidden")),this.$data.isCustomerChannelB2B&&a.querySelector(".mobileMyBusinessAccount")&&(a.ariaLabel=a.querySelector(".mobileMyBusinessAccount").innerHTML,b.dataset.trackHeading=a.querySelector(".mobileMyBusinessAccount").innerHTML+" - Nav",a.querySelector(".mobileMyBusinessAccount").classList.remove("hidden"),
a.querySelector(".mobileMyBusinessAccount").classList.add("md:hidden")),a.querySelector(".signedinFirstName").classList.add("md:block"),a.querySelector("#profile-firstname").innerHTML=this.$data.firstName,document.querySelector(".rd-mobile-account-icon button")&&(document.querySelector(".rd-mobile-account-icon").classList.add("updateIconToText"),document.querySelector(".rd-mobile-account-icon button").innerHTML=this.$data.firstName),null!=a.querySelector(".b2b_homepage")&&(a.querySelector(".b2b_homepage").classList.remove("hidden"),
a.querySelector(".b2b_homepage").classList.add("md:hidden")),this.$data.isCustomerChannelB2B&&null!=a.querySelector(".b2b_homepage")&&a.querySelector(".b2b_homepage").remove(),(a=a.querySelector("ul#profile"))&&a.querySelector(".signedin").classList.remove("hidden")):(a.querySelectorAll(".signedin").forEach(function(c){c.remove()}),a.ariaLabel=a.querySelector(".mobileSignIn").innerHTML,b.dataset.trackHeading=a.querySelector(".mobileSignIn").innerHTML+" - Nav",a.querySelector(".mobileSignIn").classList.remove("hidden"),
a.querySelector(".mobileSignIn").classList.add("md:hidden"),this.$data.showLoginForm=!0,null!=a.querySelector(".b2b_homepage")&&(a.querySelector(".b2b_homepage").classList.remove("hidden"),a.querySelector(".b2b_homepage").classList.add("md:hidden")),(a=a.querySelector("ul#profile"))&&a.querySelector(".signin").classList.remove("hidden"))}else this.$data.showLoginForm=!0},showAfterLoginPopup:function(){var a=this,b=Cookies.get(this.$data.COMMERCE_CONSTANTS.LOGIN_POPUP_COOKIE),c=this.getLocale().toLowerCase();
void 0==this.$data.popupType||""==this.$data.popupType||"trevipaynotopted"==this.$data.popupType.toLowerCase()||b||(Cookies.set(this.$data.COMMERCE_CONSTANTS.LOGIN_POPUP_COOKIE,!0,{secure:!0}),fetch("/api/assets/store/en-us/content-fragments/"+this.$data.popupType+".json",{credentials:"include"}).then(function(d){return d.json()}).then(function(d){var f=this;if(d&&d.properties&&d.properties.elements&&d.properties.elements.main&&d.properties.elements.main.value){var k=document.body,h="";h=d.properties.elements.main.variations&&
d.properties.elements.main.variations[c]?d.properties.elements.main.variations[c].value:d.properties.elements.main.value;d=document.createElement("div");d.innerHTML=h.replace(/(\r\n\t|\n|\r\t)/gm,"");k.appendChild(d);document.querySelector(".wd-consent-modal-close").addEventListener("click",function(l){f.passShowPopUpConsent("no")});document.querySelector(".wd-after-login-modal-btn").addEventListener("click",function(l){l=l.target.getAttribute("data-attr");window.location.href=f.rewritePageURL(l)})}}).catch(function(d){a.userInfoLogger("Error while get content fragments",
d)}))},passShowPopUpConsent:function(a){var b=this,c=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.USER_DETAILS);null!=c&&(c.popupType=void 0,this.setSessionVariable(this.$data.COMMERCE_CONSTANTS.USER_DETAILS,c));this.addConsentForUser(this.$data.emailId,this.$data.popupType,a).then(function(d){b.userInfoLogger("Add Consent For User response",d)})},openLoginFlyout:function(a){document.querySelector(".mMenutoggleWidth")&&!document.querySelector(".wd-header-2-5")&&(document.querySelector(".mMenutoggleWidth").style.zIndex=
"11");document.querySelector(".mm-ocd--open")&&!document.querySelector(".wd-header-2-5")&&(document.querySelector(".mm-ocd--open").style.zIndex="11");this.removeClass(a.target.closest("body").querySelector(".login-flyout"),"hidden");this.addClass(a.target.closest("body"),"mob-visibleLoginFlyout")},closeLoginFlyout:function(a){this.removeClass(a.target.closest("body"),"mob-visibleLoginFlyout");setTimeout(function(){document.querySelector(".mm-ocd--open")&&!document.querySelector(".wd-header-2-5")&&
(document.querySelector(".mm-ocd--open").style.zIndex="103");document.querySelector(".mMenutoggleWidth")&&!document.querySelector(".wd-header-2-5")&&(document.querySelector(".mMenutoggleWidth").style.zIndex="103")},500)},openLoginPopup:function(a){initializeFormEventHandlers();a.preventDefault();a=a.target;var b=a.closest(".commerce-user-info"),c=b.querySelector(".login-error");null!=c&&(this.addClass(c.closest(".form-error"),"hidden"),this.removeClass(c.closest(".errorcontent"),"alert-warning"),
this.addClass(c.closest(".errorcontent"),"alert-danger"));this.addClass(a.closest("body"),"overflow-hidden");this.$data.showLoginForm=!0;this.$data.showForgotPwdForm=!1;this.$data.showResendEmailForm=!1;this.$forceUpdate();null!=document.getElementById("login-selection")?(this.hideB2CSpincoFlashMessage(),this.hideB2BSpincoFlashMessage()):null==document.getElementById("login-selection")&&this.showB2CSpincoFlashMessage();setTimeout(function(){document.querySelector(".loginForm")},500);null!=document.querySelector("[data-target\x3d'#login-modal-win']")&&
document.querySelector("[data-target\x3d'#login-modal-win']").removeAttribute("data-target");null!=b.querySelector(".login-modal")&&this.hasClass(b.querySelector(".login-modal"),"addToFavorites")?document.querySelector(".product-price.active").querySelector(".addToFavoritesTrigger").setAttribute("data-target","#login-modal-win"):a.setAttribute("data-target","#login-modal-win");this.getCustomerChannel()==this.$data.COMMERCE_CONSTANTS.B2B&&null!=document.querySelector("input[name\x3dcustomerChannel]")&&
(document.querySelector("input[name\x3dcustomerChannel]")[1].checked=!0)},closeProfileMenu:function(){991>=window.innerWidth&&991>=window.outerWidth?document.querySelector(".hamburger-menu-bar")&&document.querySelector(".hamburger-menu-bar").click():document.querySelector("#profile").querySelector("button.dropDownItem").click()},signInFormHasAnyFormErrors:function(){var a=document.querySelector(".personalDetailInfo .b2c_login .form-error");return a?!this.hasClass(a,"hidden"):!1},hideB2CSpincoFlashMessage:function(){document.querySelector(".spinco-flash-msg-b2c")&&
(document.querySelector(".spinco-flash-msg-b2c").style.display="none")},showB2CSpincoFlashMessage:function(){document.querySelector(".spinco-flash-msg-b2c")&&!this.signInFormHasAnyFormErrors()&&(document.querySelector(".spinco-flash-msg-b2c").style.display="block")},hideB2BSpincoFlashMessage:function(){document.querySelector(".spinco-flash-msg-b2b")&&(document.querySelector(".spinco-flash-msg-b2b").style.display="none")},showB2BSpincoFlashMessage:function(){document.querySelector(".spinco-flash-msg-b2b")&&
(document.querySelector(".spinco-flash-msg-b2b").style.display="block")},openForgotPasswordPopup:function(a,b){initializeFormEventHandlers();this.$data.loginSource="";a=a.currentTarget.closest(".commerce-user-info");this.addClass(a.querySelector(".login-error").closest(".form-error"),"hidden");this.$data.forgotPwdSuccess=!1;this.$data.showForgotPwdForm=!0;this.$data.showLoginForm=!1;this.$data.showResendEmailForm=!1;this.hideB2CSpincoFlashMessage();this.$forceUpdate();""!=b&&(this.$data.loginSource=
b);setTimeout(function(){},1E3)},forgotPwd:function(a){var b=this;this.userInfoLogger("CUI: FORGOT PWD");a.preventDefault();a.stopPropagation();if(""==this.$data.loginEmail)return!0;var c=a.currentTarget;c.closest(".commerce-user-info");var d={};d.formRef=c;var f=new FormData(c);f=(new URLSearchParams(f)).toString();var k=c.querySelector(".login-error");k.innerHTML="";this.$data.email=c.querySelector('[name\x3d"email"]').value;a=a.currentTarget.action;"b2b"==this.$data.loginSource&&(a=a.replace("/store/",
"/store/business/"));fetch(a,{method:"POST",body:f,credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(function(h){return h.text()}).then(function(h){b.userInfoLogger("FORGOT PWD Service response :",h);if(-1<h.indexOf("success")){b.$data.forgotPwdSuccess=!0;b.$data.forgotSuccessMsg=h;c.reset();try{var l=window.aa.createEvent("FORM_SUBMITTED",d);window.dispatchEvent(l);b.userInfoLogger("Forgot password form successfully submitted to analytics.."+d)}catch(p){console.log("Error while triggering analytics FORM_SUBMITTED event")}b.$forceUpdate();
b.handleForgotPasswordSuccessResendEmailVerification();b.handleForgotPasswordSuccessClose()}else{b.$data.forgotPwdSuccess=!1;k.innerHTML="Server Error";b.removeClass(k.closest(".form-error"),"hidden");b.handleErrorClose(k);try{d.errorMessage="Form Error | Server unavailable",l=window.aa.createEvent("FORM_ERROR",d),window.dispatchEvent(l),b.userInfoLogger("Error while triggering analytics for forgot password form.."+d)}catch(p){console.log("Error while triggering analytics FORM_ERROR event")}}b.$forceUpdate();
setTimeout(function(){},1E3)}).catch(function(h){b.$data.forgotPwdSuccess=!1;k.innerHTML="Server Error";b.removeClass(k.closest(".form-error"),"hidden");b.handleErrorClose(k);b.userInfoLogger("failed to reset password",h);try{d.errorMessage="Form Error | Server unavailable";var l=window.aa.createEvent("FORM_ERROR",d);window.dispatchEvent(l);b.userInfoLogger("Error while triggering analytics for forgot password form.."+d)}catch(p){console.log("Error while triggering analytics FORM_ERROR event")}})},
handleForgotPasswordSuccessClose:function(){var a=this,b=document.querySelector(".forgotten-password");null!=b&&(b.querySelector(".wd-modal-close"),document.addEventListener("click",function(c){a.$data.showResendEmailForm||(a.closeLoginModal(c),a.closeLoginFlyout(c))},{once:!0}));(b=document.querySelector(".forgetPassForm"))&&(b=b.querySelector(".confirm"))&&b.addEventListener("click",function(c){c.preventDefault();c.stopPropagation();null!=c.target&&"BUTTON"==c.target.tagName&&c.target.classList.contains("wd-modal-close")&&
(a.openLoginPopup(c),a.closeProfileMenu())},{once:!1})},handleForgotPasswordSuccessResendEmailVerification:function(){var a=this,b=document.querySelector(".forgetPassForm");b&&(b=b.querySelector(".confirm"))&&b.addEventListener("click",function(c){c.preventDefault();c.stopPropagation();null!=c.target&&"SPAN"==c.target.tagName&&c.target.closest("a").classList.contains("customer-verification-resend-email")&&(c=c.target.closest(".commerce-user-info"),a.addClass(c.querySelector(".login-error").closest(".form-error"),
"hidden"),a.$data.resendVerificationSuccess=!1,a.$data.showForgotPwdForm=!1,a.$data.showLoginForm=!1,a.$data.showResendEmailForm=!0,a.hideB2CSpincoFlashMessage(),a.$forceUpdate(),initializeFormEventHandlers())},{once:!1})},closeLoginModal:function(a){"undefined"==typeof a&&(a.preventDefault(),a.stopPropagation());Cookies.get(this.$data.COMMERCE_CONSTANTS.CHANNEL_COOKIE)?(Cookies.remove(this.$data.COMMERCE_CONSTANTS.CHANNEL_COOKIE),this.removeAllSessionVariable(),location.reload()):(this.$data.showLoginForm=
!0,this.$data.showForgotPwdForm=!1,this.$data.showPasswordResetMessage=!1,this.$data.validUserName=!1,this.$data.loginEmail="",this.$data.passwordNotEmpty=!1,this.$data.loginPassword="",a=document.querySelector(".login-modal"),null!=a&&(null!=a.querySelector(".loginForm")&&a.querySelector(".loginForm").reset(),this.addClass(a,"hidden"),this.removeClass(a,"addToFavorites"),this.removeClass(a,"addToFavorites"),a.querySelector(".wd-modal-dialog").setAttribute("aria-modal","false")),null!=document.querySelector(".migrated-user-msg-container")&&
document.querySelector(".migrated-user-msg-container").remove(),this.removeClass(document.querySelector("body"),"overflow-hidden"))},loginUser:function(a,b){var c=this;this.userInfoLogger("CUI: Login USER");a.preventDefault();a.stopPropagation();if(""==this.$data.loginEmail||""==this.$data.loginPassword)return!0;this.hideB2CSpincoFlashMessage();var d=a.target,f={};f.formRef=d;var k=new FormData(d);k=(new URLSearchParams(k)).toString();""!=k&&(k+="\x26otpUserName\x3d\x26otpPassword\x3d\x26lastOtpUserName\x3d");
var h=d.closest(".commerce-user-info"),l=h.querySelector(".login-error");null!=l&&(l.innerHTML="");var p=a.target.action;b&&(h=h.querySelector(".personalDetailInfo.businessAccount"),p=null!=h&&null!=h.querySelector("form")&&null!=h.querySelector("form").getAttribute("action")&&""!=h.querySelector("form").getAttribute("action")?h.querySelector("form").getAttribute("action"):this.$data.platformCommerceURL+"/store/business/popup/login");a.target.customerChannel&&(p=a.currentTarget.customerChannel.value);
fetch(p,{method:"POST",body:k,credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(function(q){c.userInfoLogger("User Login response :",q);return q.text()}).then(function(q){c.userInfoLogger("User Login response data:",q);if(-1<q.indexOf("redirect:/cart")){Cookies.set(c.$data.COMMERCE_CONSTANTS.CHANNEL_COOKIE,c.getCustomerChannelFromPath(p),{secure:!0,path:"/"});c.removeAllSessionVariable();c.userInfoLogger("User Login Success");c.getUser().then(function(C){b&&
null!=document.querySelector(".loginRedirectPaths")?null!=c.b2bLoginRedirectPath?window.location.href=c.rewritePageURL(c.b2bLoginRedirectPath):(document.querySelectorAll("header .loginRedirectPaths").forEach(function(E){c.redirectPaths[E.getAttribute("data-sourcePath")]=E.getAttribute("data-redirectPath")}),c.redirectPaths.hasOwnProperty(c.getCurrentPagePath())?window.location.href=c.rewritePageURL(c.redirectPaths[c.getCurrentPagePath()]):window.location.reload()):window.location.reload()});try{var t=
window.aa.createEvent("FORM_SUBMITTED",f);window.dispatchEvent(t);c.userInfoLogger("Sign in FORM successfully submitted to analytics.."+f)}catch(C){console.log("Error while triggering analytics FORM_SUBMITTED event")}}else if(-1<q.indexOf("showResetMessage_"))c.userInfoLogger("User is Migrated User"),null!=l&&(l.innerHTML=eval(q.replace("showResetMessage_","")),c.addClass(l.closest(".errorcontent"),"alert-danger"),c.removeClass(l.closest(".errorcontent"),"alert-warning"),c.removeClass(l.closest(".form-error"),
"hidden")),c.handleResetPasswordClick(l),c.handleErrorClose(l);else if(-1<q.indexOf("showEmailValidationMessage_")){c.userInfoLogger("user email verification pending");null!=l&&(l.innerHTML=eval(q.replace("showEmailValidationMessage_","")),c.removeClass(l.closest(".errorcontent"),"alert-danger"),c.addClass(l.closest(".errorcontent"),"alert-warning"),c.removeClass(l.closest(".form-error"),"hidden"));try{f.errorMessage="Login Status | "+q.replace("showEmailValidationMessage_","");var u=window.aa.createEvent("FORM_ERROR",
f);window.dispatchEvent(u);userInfoLogger("Error while triggering analytics for sign in form.."+f)}catch(C){console.log("Error while triggering analytics FORM_ERROR event")}c.handleResendVerificationEmailClick(l);c.handleErrorClose(l)}else if(-1<q.indexOf("showB2BUserValidationMessage_")){c.userInfoLogger("b2b user validation message");l.innerHTML=eval(q.replace("showB2BUserValidationMessage_",""));c.removeClass(l.closest(".form-error"),"hidden");try{f.errorMessage="Login Status | "+q.replace("showB2BUserValidationMessage_",
""),u=window.aa.createEvent("FORM_ERROR",f),window.dispatchEvent(u),c.userInfoLogger("Error while triggering analytics for sign in form.."+f)}catch(C){console.log("Error while triggering analytics FORM_ERROR event")}}else if(-1<q.indexOf("Your username or password was incorrect.")||-1<q.indexOf("attempts remaining before your account is locked.")||-1<q.indexOf("Your account is locked")){c.userInfoLogger("User Login Failure");null!=l&&(l.innerHTML=eval(q),c.addClass(l.closest(".errorcontent"),"alert-danger"),
c.removeClass(l.closest(".errorcontent"),"alert-warning"),c.removeClass(l.closest(".form-error"),"hidden"),d.reset(),-1<q.indexOf("triggerForgotPasswordModal")&&c.handleResetPasswordErrorClick(l),c.handleErrorClose(l));try{f.errorMessage="Login Status | "+q,u=window.aa.createEvent("FORM_ERROR",f),window.dispatchEvent(u),c.userInfoLogger("Error while triggering analytics for sign in form.."+f)}catch(C){console.log("Error while triggering analytics FORM_ERROR event")}}else if(-1<q.indexOf("isB2BUser")){c.userInfoLogger("User is a B2B user, Login into B2B account");
null!=l&&(l.innerHTML=eval(q.replace("isB2BUser::","")),c.addClass(l.closest(".errorcontent"),"alert-danger"),c.removeClass(l.closest(".errorcontent"),"alert-warning"),c.removeClass(l.closest(".form-error"),"hidden"));try{f.errorMessage="Login Status | "+q.replace("isB2BUser::",""),u=window.aa.createEvent("FORM_ERROR",f),window.dispatchEvent(u),userInfoLogger("Error while triggering analytics for sign in form.."+f)}catch(C){console.log("Error while triggering analytics FORM_ERROR event")}c.handleErrorClose(l)}else{c.userInfoLogger("User Login Failure");
l.innerHTML=q?eval(q):"Login Failure";c.addClass(l.closest(".errorcontent"),"alert-danger");c.removeClass(l.closest(".errorcontent"),"alert-warning");c.removeClass(l.closest(".form-error"),"hidden");d.reset();-1<q.indexOf("triggerForgotPasswordModal")&&c.handleResetPasswordErrorClick(l);c.handleErrorClose(l);try{f.errorMessage="Login Status | "+q,u=window.aa.createEvent("FORM_ERROR",f),window.dispatchEvent(u),c.userInfoLogger("Error while triggering analytics for sign in form.."+f)}catch(C){console.log("Error while triggering analytics FORM_ERROR event")}}},
function(q){c.userInfoLogger("User Login Failure",q);l.innerHTML="Login Failure";c.removeClass(l.closest(".form-error"),"hidden");c.userInfoLogger("failed to login",q);try{f.errorMessage="Login Failure | Server unavailable";var t=window.aa.createEvent("FORM_ERROR",f);window.dispatchEvent(t);c.userInfoLogger("Error while triggering analytics for sign in form.."+f)}catch(u){console.log("Error while triggering analytics FORM_ERROR event")}})},handleResetPasswordErrorClick:function(a){var b=this,c=document.querySelector(".triggerForgotPasswordModal");
null==c&&(c=a.querySelector("a"));c.addEventListener("click",function(d){d.preventDefault();d=d.target.closest(".commerce-user-info");b.addClass(d.querySelector(".login-error").closest(".form-error"),"hidden");b.$data.forgotPwdSuccess=!1;b.$data.showForgotPwdForm=!0;b.$data.showLoginForm=!1;b.$forceUpdate();initializeFormEventHandlers()},{once:!0})},handleResendVerificationEmailClick:function(a){var b=this,c=null,d=document.querySelector(".loginForm");d&&(c=d.querySelector(".customer-verification-resend-email"));
null==c&&(c=a.querySelector("a"));c.addEventListener("click",function(f){f.preventDefault();f=f.target.closest(".commerce-user-info");b.addClass(f.querySelector(".login-error").closest(".form-error"),"hidden");b.$data.resendVerificationSuccess=!1;b.$data.showLoginForm=!1;b.$data.showResendEmailForm=!0;b.hideB2CSpincoFlashMessage();b.$forceUpdate();initializeFormEventHandlers()},{once:!0})},handleResetPasswordClick:function(a){var b=this,c=document.querySelector(".migrated-customer-reset-password");
null==c&&(c=a.querySelector("a"));c.addEventListener("click",function(d){b.openForgotPasswordPopup(d,"b2c")},{once:!1})},handleErrorClose:function(a){var b=this,c=null,d=document.querySelector(".loginForm");d&&(c=d.querySelector(".customer-verification-resend-email"));null==c&&(c=a.querySelector("a"));a.closest(".form-error").querySelector(".closeAccAlert").addEventListener("click",function(f){f.preventDefault();f=f.target.closest(".form-error");b.addClass(f,"hidden")},{once:!0})},resendEmailVerification:function(a){var b=
this;this.userInfoLogger("CUI: resendEmailVerification");a.preventDefault();a.stopPropagation();if(""==this.$data.loginEmail)return!0;var c=a.currentTarget;c.closest(".commerce-user-info");var d={};d.formRef=c;var f=new FormData(c);f=(new URLSearchParams(f)).toString();var k=c.querySelector(".login-error");k.innerHTML="";this.$data.email=c.querySelector('[name\x3d"email"]').value;fetch(a.currentTarget.action,{method:"POST",body:f,credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(function(h){return h.text()},
function(h){b.$data.resendVerificationSuccess=!1;k.innerHTML="Server Error";b.removeClass(k.closest(".form-error"),"hidden");b.userInfoLogger("failed to resend verify email",h);try{d.errorMessage="Form Error | Server unavailable";var l=window.aa.createEvent("FORM_ERROR",d);window.dispatchEvent(l);b.userInfoLogger("Error while triggering analytics for resend email form.."+d)}catch(p){console.log("Error while triggering analytics FORM_ERROR event")}}).then(function(h){b.userInfoLogger("resendEmailVerification Service response :",
h);if(""==h||null==h){b.$data.resendVerificationSuccess=!1;k.innerHTML="Server Error";b.removeClass(k.closest(".form-error"),"hidden");b.userInfoLogger("failed to resend verify email",h);try{d.errorMessage="Form Error | Server unavailable";var l=window.aa.createEvent("FORM_ERROR",d);window.dispatchEvent(l);b.userInfoLogger("Error while triggering analytics for resend email form.."+d)}catch(p){console.log("Error while triggering analytics FORM_ERROR event")}}else{b.$data.resendVerificationSuccess=
!0;c.reset();b.$data.resendVerificationSuccessMsg=h;b.$forceUpdate();try{l=window.aa.createEvent("FORM_SUBMITTED",d),window.dispatchEvent(l),b.userInfoLogger("Email Verification form successfully submitted to analytics.."+d)}catch(p){console.log("Error while triggering analytics FORM_SUBMITTED event")}}}).catch(function(h){b.$data.resendVerificationSuccess=!1;k.innerHTML="Server Error";b.removeClass(k.closest(".form-error"),"hidden");b.userInfoLogger("failed to resend verify email",h);try{d.errorMessage=
"Form Error | Server unavailable";var l=window.aa.createEvent("FORM_ERROR",d);window.dispatchEvent(l);b.userInfoLogger("Error while triggering analytics for resend email form.."+d)}catch(p){console.log("Error while triggering analytics FORM_ERROR event")}})},validateEmail:function(a){return!/^(([^<>()[\]\.,;:\s@"]+(\.[^<>()[\]\.,;:\s@"]+)*)|(".+"))@(([^<>()[\]\.,;:\s@"]+\.)+[^<>()[\]\.,;:\s@"]{2,})$/i.test(a)||128<a.length?!0:!1},triggerSignInModal:function(){document.querySelector("#sessionTimedoutContainer")&&
document.querySelector("#sessionTimedoutContainer").classList.add("hidden");document.querySelector(".shopAccountLogin a")&&document.querySelector(".shopAccountLogin a").click();document.querySelector(".shopAccountLogin button")&&document.querySelector(".shopAccountLogin button").click();document.querySelector(".hamburger-menu-bar")&&document.querySelector(".hamburger-menu-bar").click();document.querySelector("li#profile button")&&document.querySelector("li#profile button").click()},closeSessionTimedoutModal:function(){document.querySelector("#sessionTimedoutContainer")&&
window.location.reload()},logout:function(a){a.preventDefault();a.stopPropagation();Cookies.remove(this.$data.COMMERCE_CONSTANTS.CHANNEL_COOKIE);Cookies.remove(this.$data.COMMERCE_CONSTANTS.LOGIN_POPUP_COOKIE);this.removeAllSessionVariable();a=a.currentTarget.getAttribute("href");"undefined"==typeof a&&(a="/store/logout");window.location.href=a},userInfoLogger:function(a,b){-1<window.location.search.indexOf("debugUserInfo\x3dtrue")&&console.log("USER INFO: "+a,b?b:"")},loginSelection:function(){var a=
document.querySelector("ul#profile .signin");if(a){var b=document.getElementById("login-selection").value,c=a.querySelector(".b2b_login"),d=a.querySelector(".b2c_login"),f=a.querySelector(".forgetPassModal"),k=a.querySelector(".spinco-flash-msg-b2b");c&&d&&f&&("for-myself"==b?(c.classList.add("hidden"),d.classList.remove("hidden"),document.getElementById("login-selection").querySelectorAll("option")[0].classList.add("hidden"),f.style.display="block",this.showB2CSpincoFlashMessage(),this.hideB2BSpincoFlashMessage()):
"for-a-business"==b&&(c.addEventListener("click",function(h){null!=h.target&&"A"==h.target.tagName&&k&&(k.style.display="none")},{once:!1}),c.classList.remove("hidden"),d.classList.add("hidden"),a.querySelector(".b2b_login \x3e a").classList.remove("bg-grey-light","pointer-events-none","btn-disabled"),a.querySelector(".b2b_login \x3e a").classList.add("bg-sd-red"),document.getElementById("login-selection").querySelectorAll("option")[0].classList.add("hidden"),f.style.display="none",this.hideB2CSpincoFlashMessage(),
this.showB2BSpincoFlashMessage()))}}}});
document.addEventListener("DOMContentLoaded",function(){document.querySelector(".loginPopUpTrigger")&&document.querySelectorAll(".loginPopUpTrigger").forEach(function(a){a.addEventListener("click",function(b){b.preventDefault();b.stopPropagation();b=b.target.closest(".commerce-user-info").querySelector(".loginRedirectPaths").getAttribute("data-redirectpath");var c=document.querySelector('[aem-comp\x3d"StoreCommerceUserInfoApp"]').__vue__;c.isUserLoggedIn?window.location.href=rewritePageURL(b):(c.b2bLoginRedirectPath=
b,c.triggerSignInModal(),document.cookie="storeCookieRedirect\x3d"+rewritePageURL(b)+"; Path\x3d/;")})});document.querySelector(".apply-for-trevipay")&&document.querySelectorAll(".apply-for-trevipay").forEach(function(a){var b=document.querySelector('[aem-comp\x3d"StoreCommerceUserInfoApp"]').__vue__;a.href=b.appyNowTreviPayURL})});
window.addEventListener("load",function(){var a=this;if(0<document.querySelectorAll(".subnav2-0 .sticky-head").length){var b=function(u){u.target.getAttribute("href").startsWith("#")&&(u.preventDefault(),u.stopPropagation());if(991>=document.body.clientWidth&&!document.querySelector("#sticky-nav.sticky-head").classList.contains("mob-subnav-dropdown-open"))u.preventDefault(),u.stopPropagation(),document.querySelector("#sticky-nav.sticky-head").classList.toggle("mob-subnav-dropdown-open");else{if(0!==
this.getAttribute("href").indexOf("#"))return;var C=document.querySelectorAll(".inner-wrap .subnav-item")[0];if(this.attributes.href==C.querySelector("a").attributes.href)document.querySelector(".subnav-link-to-carousel")?991>=window.innerWidth&&setTimeout(function(){var F=document.querySelector(u.target.hash);getOffset(F);scrollToSmoothly(0)},500):document.querySelector(".subnav-link-to-carousel")||setTimeout(function(){var F=document.querySelector(u.target.hash);(F=getOffset(F).top)?scrollToSmoothly(F):
scrollToSmoothly(0)},500);else{var E=document.getElementById("bvReview");c||null==E||"#ratings-and-reviews"!=u.target.hash&&"#disclosures"!=u.target.hash?setTimeout(function(){subNavClickTarget(u)},500):document.querySelector(".rd-subnav-section")?subNavClickTarget(u):(E.setAttribute("data-bv-show",E.getAttribute("bv-show")),E.setAttribute("data-bv-product-id",E.getAttribute("bv-product-id")),E.removeAttribute("bv-show"),E.removeAttribute("bv-product-id"),(new MutationObserver(function(F){!c&&F[0].target.classList.contains("bv-content-list-container")&&
(c=!0,setTimeout(function(){document.querySelector("#sticky-nav.sticky-head").classList.toggle("mob-subnav-dropdown-open");u.target.click()},1E3))})).observe(E,{subtree:!0,childList:!0}),setTimeout(function(){E.firstChild||subNavClickTarget(u)},700))}k++;992>document.body.clientWidth&&this.closest(".sticky-head").classList.toggle("mob-subnav-dropdown-open")}return!1};document.querySelector(".pdp-redesign-subnav")&&PdpRedesignLoad();var c=!1,d=document.querySelector("#sticky-nav div.button a.btn")||
"";d&&!document.querySelector(".pdp-redesign-subnav")&&(d.style.border="1px solid");this.HideandShowHeader();document.querySelectorAll("#sticky-nav \x3e .inner-wrap")[0].insertAdjacentHTML("beforeend",'\x3cdiv class\x3d"slidingDiv"\x3e\x3c/div\x3e');d=document.getElementsByClassName("subnav2-0");var f=document.getElementsByClassName("sticky-head"),k=0;getOffset(d[0]);getOffset(f[0]);var h=d[0].querySelectorAll("a:not(.pdp-buy-btn-link, .reviews-subnavItem.hidden a)"),l=[];for(i=0;i<h.length;i++)0==
h[i].getAttribute("href").indexOf("#")&&(d=document.getElementById(h[i].getAttribute("href").replace("#","")))&&l.push(d);document.querySelectorAll(".subnav2-0 .sticky-head a.link-cta").forEach(function(u){u.addEventListener("click",b)});var p={top:250};window.onscroll=function(){document.querySelector(".pdp-redesign-subnav")?checkPdpSubnavItem():handleNavbar2_0Scroll(l,h,void 0);document.querySelectorAll(".store-product-wtb, .addToCartBtn").length&&setTimeout(function(){null!=document.querySelector(".pdp-buy-btn")&&
(p={top:document.querySelector(".store-product-wtb, .addToCartBtn").getBoundingClientRect().top+window.scrollY},null!=document.querySelector(".pdp-redesign")?ScrollOnPdpRedesign(p):this.pageYOffset>p.top?document.querySelector(".pdp-buy-btn").classList.remove("hidden"):document.querySelector(".pdp-buy-btn").classList.add("hidden"))},200);991>=document.body.clientWidth&&document.querySelectorAll("#sticky-nav.sticky-head .subnav-item").forEach(function(u){u.classList.contains("active-subnav-item")?
u.closest(".inner-wrap").classList.add("carrot-arrow"):u.closest(".inner-wrap").classList.remove("carrot-arrow")});HideandShowHeader()};window.addEventListener("click",function(u){document.querySelector("#sticky-nav.sticky-head")&&992>document.body.clientWidth&&document.querySelector(".sticky-head").classList.contains("mob-subnav-dropdown-open")&&u.target&&!u.target.classList.contains("subnav-item")&&document.querySelector(".sticky-head").classList.remove("mob-subnav-dropdown-open")});document.querySelector(".pdp-redesign-subnav")?
checkPdpSubnavItem():handleNavbar2_0Scroll(l,h,void 0);var q=location.href.split(/[?#]/)[0].split("/");q=q[q.length-1].split(".")[0];document.querySelectorAll(".sticky-head a.link-cta").forEach(function(u){var C=u.getAttribute("href").split(/[?#]/)[0].split("/");C=C[C.length-1].split(".")[0];if(C==q&&991<a.window.innerWidth)return u.classList.add("subnav-active-item"),u.closest(".subnav-item")&&u.closest(".subnav-item").classList.add("active-subnav-item"),992>document.body.clientWidth&&(document.querySelector(".sticky-head").scrollLeft=
u.offsetLeft),!1;document.querySelector(".sticky-head a.link-cta")&&991>=a.window.innerWidth&&C==q&&(u.classList.add("subnav-active-item"),u.closest(".subnav-item")&&u.closest(".subnav-item").classList.add("active-subnav-item"))});document.querySelectorAll(".store-product-wtb, .addToCartBtn").length&&null!=document.querySelector(".subnav2-0 .sticky-head a.pdp-buy-btn-link")&&document.querySelector(".subnav2-0 .sticky-head a.pdp-buy-btn-link").addEventListener("click",function(u){u.preventDefault();
u.stopPropagation();u=document.querySelector(u.target.hash);scrollToSmoothly(u.offsetTop-75,700)});991>=document.body.clientWidth&&(document.querySelector("#sticky-nav.sticky-head").addEventListener("click",function(u){this.closest(".sticky-head").classList.toggle("mob-subnav-dropdown-open")}),document.querySelector(".sticky-head .subnav-active-item")&&(d=document.querySelector(".sticky-head .subnav-active-item").closest(".subnav-item"),document.querySelector(".sticky-head .inner-wrap").prepend(d)));
document.querySelector(".subnav2-0 #sticky-nav").closest("body.brand")&&(d=document.querySelector(".subnav2-0 #sticky-nav"),f=d.closest("section.section").style.backgroundColor,d.style.backgroundColor=f);if(992<=document.body.clientWidth&&(document.getElementById("sticky-nav"),0<document.querySelectorAll("#sticky-nav .inner-wrap .subnav-item").length)){var t=0;document.querySelectorAll("#sticky-nav .inner-wrap .subnav-item").forEach(function(u){var C=u.currentStyle||window.getComputedStyle(u);t+=
u.offsetWidth+parseInt(C.marginLeft.replace(/[^\d.-]/g,""))+parseInt(C.marginRight.replace(/[^\d.-]/g,""))});document.querySelector("#sticky-nav .inner-wrap").style.justifyContent="start"}}});
function ScrollOnPdpRedesign(a){this.pageYOffset>a.top?(document.querySelector(".pdp-buy-btn").closest("section.section").classList.remove("hidden"),document.querySelector(".pdp-buy-btn").classList.remove("hidden"),992<window.innerWidth&&document.querySelector(".rd-subnav-section")&&document.querySelector(".rd-subnav-section").classList.remove("hidden")):(document.querySelector(".pdp-buy-btn").classList.add("hidden"),992<window.innerWidth&&document.querySelector(".pdp-redesign .pdp-redesign-subnav")&&
document.querySelector(".pdp-buy-btn").closest("section.section").classList.add("hidden"))}
function checkPdpSubnavItem(){var a=null,b=document.getElementsByClassName("subnav2-0")[0].querySelectorAll("a:not(.pdp-buy-btn-link, .reviews-subnavItem.hidden a)"),c=[];for(i=0;i<b.length;i++)if(0==b[i].getAttribute("href").indexOf("#")){var d=document.getElementById(b[i].getAttribute("href").replace("#",""));d&&c.push(d)}b=document.querySelectorAll(".subnav-item a");c.forEach(function(f){var k=f.getBoundingClientRect();k.top<=window.innerHeight/2&&k.bottom>=window.innerHeight/2&&(a=f)});a&&(b.forEach(function(f){f.parentElement.classList.remove("active-subnav-item")}),
c=a.getAttribute("id"),(c=document.querySelector('.subnav-item a[href\x3d"#'+c+'"]'))&&c.parentElement.classList.add("active-subnav-item"))}function PdpRedesignLoad(){992>window.innerWidth&&document.querySelector(".rd-subnav-section")&&document.querySelector(".rd-subnav-section").classList.remove("hidden")}var lastScrolledDiv=null,firstCount=0;
function handleNavbar2_0Scroll(a,b,c){a=document.querySelector("#sticky-nav.sticky-head");var d=window.pageYOffset;headerHeight=document.querySelector("header.header").offsetHeight;d>headerHeight?a.classList.add("sticky-stuck"):a.classList.remove("sticky-stuck");a=document.querySelectorAll(".subnav2-0 a:not(.pdp-buy-btn-link, .reviews-subnavItem.hidden a)");var f=[];for(i=0;i<a.length;i++)if(0==a[i].getAttribute("href").indexOf("#")){var k=document.getElementById(a[i].getAttribute("href").replace("#",
""));k&&f.push(k)}a=f.filter(function(l){var p=l,q=l.getAttribute("id");q=document.querySelectorAll("#"+q+".section");if(1<q.length)for(var t=0;t<q.length;t++)0!=q[t].offsetTop&&(p=q[t]);if(d+100>p.offsetTop)return l});if(document.querySelector(".subnav-link-to-carousel"))991>=window.innerWidth&&a.map(function(l){if(l){var p=window.scrollY,q=getOffset(l).top,t=l.offsetHeight;l=l.getAttribute("id");p>=q&&p<q+t?(document.querySelectorAll(".subnav-link-to-carousel .subnav-item").forEach(function(u){u.style.order=
1;u.closest(".subnav-item").classList.remove("active-subnav-item");u.classList.remove("active-section")}),document.querySelector(".sticky-head").querySelector("[href\x3d'#"+l+"']").closest(".subnav-item").style.order=0,document.querySelector(".sticky-head").querySelector("[href\x3d'#"+l+"']").classList.add("active-section"),document.querySelector(".sticky-head").querySelector("[href\x3d'#"+l+"']").closest(".subnav-item").classList.add("active-subnav-item")):0==firstCount&&(document.querySelector(".subnav-link-to-carousel .subnav-item a").classList.add("active-section"),
document.querySelector(".subnav-link-to-carousel .subnav-item a").closest(".subnav-item").classList.add("active-subnav-item"));firstCount++}});else{var h=(a=a[a.length-1])?a.id:"";if("undefined"!=typeof h&&c!==h){c=h;b.forEach(function(l){l.closest(".subnav-item")&&l.getAttribute("href").startsWith("#")&&l.closest(".subnav-item").classList.remove("active-subnav-item");document.querySelector(".sticky-head")&&document.querySelector(".sticky-head").querySelector("[href\x3d'#"+h+"']")&&document.querySelector(".sticky-head").querySelector("[href\x3d'#"+
h+"']").closest(".subnav-item")&&(document.querySelector(".sticky-head").querySelector("[href\x3d'#"+h+"']").closest(".subnav-item").classList.add("active-subnav-item"),l.classList.remove("active-section"),document.querySelector(".sticky-head").querySelector("[href\x3d'#"+h+"']").classList.add("active-section"))});if(b=document.querySelector(".sticky-head")&&document.querySelector(".sticky-head").querySelector("[href\x3d'#"+h+"']")?document.querySelector(".sticky-head").querySelector("[href\x3d'#"+
h+"']").closest("div"):"")lastScrolledDiv=b,document.querySelector("#sticky-nav").scrollLeft=lastScrolledDiv.offsetLeft;"ratings-and-reviews"!==h&&document.querySelector('[href\x3d"#ratings-and-reviews"]')&&document.querySelector('[href\x3d"#ratings-and-reviews"]').closest(".subnav-item").classList.remove("active-subnav-item");document.querySelector(".subnav-link-to-carousel")?991>=window.innerWidth&&executeSlidingBarOnSubnav(b):document.querySelector(".subnav-link-to-carousel")||executeSlidingBarOnSubnav(b)}}}
function executeSlidingBarOnSubnav(a){var b=0,c=0;c=a&&a.querySelector("a")?a.querySelector("a").offsetWidth:a.offsetWidth;var d=a?a.querySelector("a"):"";setTimeout(function(){d&&(b=d.offsetLeft+parseInt(window.getComputedStyle(d).paddingLeft)+document.body.scrollLeft,a.closest("#sticky-nav").querySelector(".slidingDiv").style.cssText="\n\t\t\tleft: "+b+"px;\n\t\t\twidth: "+c+"px;\n\t\t\t")},0)}
function getOffset(a){if(!a.getClientRects().length)return{top:0,left:0};var b=a.getBoundingClientRect();a=a.ownerDocument.defaultView;return{top:b.top+a.pageYOffset,left:b.left+a.pageXOffset}}function getAbsoluteHeight(a){a="string"===typeof a?document.querySelector(a):a;var b=window.getComputedStyle(a);b=parseFloat(b.marginTop)+parseFloat(b.marginBottom);return Math.ceil(a.offsetHeight+b)}
function subNavClickTarget(a){var b=document.querySelector("header.header").getBoundingClientRect().height,c=document.querySelector(".subnav").getBoundingClientRect().height;document.querySelector(".subnav-link-to-carousel")?991>=window.innerWidth&&(a=document.querySelector(a.target.hash),a=getOffset(a),document.querySelector(".wd-header-2-5")?scrollToSmoothly(a.top+20):scrollToSmoothly(a.top-c)):document.querySelector(".subnav-link-to-carousel")||(a=document.querySelector(a.target.hash),a=getOffset(a),
document.querySelector(".wd-header-2-5")?scrollToSmoothly(a.top-50-c):scrollToSmoothly(a.top-b-c))}
document.addEventListener("DOMContentLoaded",function(){try{null!=document.querySelector("#commonUtilLoad")&&"true"==document.querySelector("#commonUtilLoad").getAttribute("data-isWcmModeDisabled")&&null!=document.querySelector('[ng-controller\x3d"storeSearchController"]')&&document.querySelector('[ng-controller\x3d"storeSearchController"]').closest(".search-main").remove(),document.querySelector(".btn-search-SummaryView")&&document.querySelector(".btn-search-SummaryView").addEventListener("click",
function(a){a.stopPropagation();document.querySelector(".wd-header-2-5")&&(domClickEventCalled(a),hideMegaMenu());this.setAttribute("tabindex","-1");document.querySelector(".mMenutoggleWidth")&&(document.querySelector(".mMenutoggleWidth").style.zIndex="11");this.closest("#searchSummaryView").querySelector(".searchSummaryViewInput").classList.add("search-expanded");this.closest("body").classList.add("search-open");document.querySelector(".mm-ocd--open")&&(document.querySelector(".mm-ocd--open").style.zIndex=
1);0<document.getElementsByClassName("searchSummaryViewInput")[0].value.length&&0<document.getElementsByClassName("searchSummaryViewInput")[0].offsetWidth&&document.getElementById("searchSummaryViewForm")&&document.getElementById("searchSummaryViewForm").submit();document.querySelector(".svClearInput")&&(document.querySelector(".svClearInput").style.display="none");this.closest("#searchSummaryView").querySelector(".searchSummaryViewInput").focus()}),document.querySelector(".searchSummaryViewInput")&&
document.querySelector(".searchSummaryViewInput").addEventListener("input",function(a){var b=document.querySelector(".svClearInput"),c;0<(null==(c=a.target.value)?void 0:c.length)&&b&&(b.style.display="block");var d;0==(null==(d=a.target.value)?void 0:d.length)&&b&&(b.style.display="none")}),document.querySelector(".svClearInput")&&document.querySelector(".svClearInput").addEventListener("click",function(a){if(a=document.getElementById("searchTerm"))a.value="";document.querySelector(".svClearInput").classList.add("remove-auto-suggest");
this.closest("#searchSummaryView").querySelector(".searchSummaryViewInput").focus()}),document.querySelector(".search-collapse")&&document.querySelector(".search-collapse").addEventListener("click",function(a){this.closest("#searchSummaryView").querySelector(".searchSummaryViewInput").classList.remove("search-expanded");this.closest("body").classList.remove("search-open");document.querySelector(".mm-ocd--open")&&(document.querySelector(".mm-ocd--open").style.zIndex=130);document.getElementById("searchSummaryView").classList.remove("z-20");
document.getElementById("searchSummaryView").classList.add("z-4");document.querySelector(".svClearInput").removeAttribute("tabindex");document.querySelector(".btn-search-SummaryView").removeAttribute("tabindex");var b;"block"===(null==(b=document.querySelector(".svClearInput"))?void 0:b.style.display)&&(document.querySelector(".svClearInput").style.display="none");if(a=document.getElementById("searchTerm"))a.value="";document.querySelector(".svClearInput").classList.add("remove-auto-suggest")}),document.querySelector(".btn-search-SummaryView")&&
document.querySelector(".btn-search-SummaryView").addEventListener("click",function(a){document.getElementById("searchSummaryView").classList.add("z-20");document.getElementById("searchSummaryView").classList.remove("z-4")})}catch(a){console.log(a)}});
var StoreSearchApp={el:"#store-search-component",data:{suggestions:{},resultPagePath:"",q:"",showSuggestions:!1},mounted:function(){this.resultPagePath=this.$refs.resultPagePath.dataset.resultpagepath},methods:{getSearchSuggestions:function(){var a=this;""==document.querySelector(".searchSummaryViewInput").value?document.querySelector(".svClearInput").setAttribute("tabindex","-1"):document.querySelector(".svClearInput").removeAttribute("tabindex");this.suggestions={};var b=this.$el.querySelector("#searchTerm").value;
if(b&&3<=b.length){c&&clearTimeout(c);var c=this.$refs.autoSuggestUrl.dataset.autosuggesturl;var d=c+(c&&0<=c.indexOf("?")?"\x26":"?")+"q\x3d"+encodeURIComponent(b)+"\x26omitHeader\x3dtrue\x26wt\x3djson\x26distrib\x3dfalse";c=setTimeout(function(){document.querySelector(".svClearInput").classList.contains("remove-auto-suggest")&&(b="",document.querySelector(".svClearInput").classList.remove("remove-auto-suggest"));fetch(d).then(function(f){return f.json()}).then(function(f){3<=b.length&&f.response.docs&&
0<f.response.numFound&&(a.suggestions=f.response.docs,a.showSuggestions=!0)}).catch(function(f){console.error("Response error",f);return!0})},500)}}}};Vue.newInstance("StoreSearchApp",StoreSearchApp);
function customFormSubmitAction(a){form_commonLogger("in customFormSubmitAction...");try{var b=validateForm(a,createFormObjectForAnalytics(a));form_commonLogger("validForm: "+b);if(0==b){Array.prototype.slice.call(a.elements);var c=getDataAttribute("commonUtilLoad","enablerecaptcha"),d=document.querySelector("#"+a.id+' [name\x3d"formName"]').value;if("true"==c){var f=void 0!=d?d.replace(/[^a-z]/gi,""):"",k=getDataAttribute("commonUtilLoad","recaptchasitekey");grecaptcha.ready(function(){grecaptcha.execute(k,
{action:f}).then(function(h){var l=document.createElement("input");l.setAttribute("type","hidden");l.setAttribute("name","g-recaptcha-response");l.setAttribute("value",h);a.appendChild(l);submitForm(a)})})}else submitForm(a)}else form_commonLogger("Form has validation error, show error.")}catch(h){form_commonLogger("error while submitting form: "+h.message)}return!1}
function validateForm(a,b){var c=a.getElementsByTagName("*");a=[];for(var d=0;d<c.length;d++){var f=validateInput(c[d],b);0<f.length&&(form_commonLogger("Validation failed for ",c[d]),form_commonLogger("Validation error ",f),a[a.length]=f)}form_commonLogger("failureArray.length: "+a.length);form_commonLogger("failureArray: ",a);c=document.getElementById("captcha");void 0!=c&&(b=grecaptcha.getResponse(),c=getNextSiblingWithMatchingClass(c,"error-message"),0==b.length&&(invalid=!0,setCaptchaErrorStatus(c,
invalid)));return 0<a.length?a.length:0}
function validateInput(a,b){var c=[];if(!hasClass(a,"validate"))return c;var d=getNextSiblingWithMatchingClass(a,"error-message");hasClass(a,"email")&&!validateEmail(a.value)&&(c[c.length]="email");hasClass(a,"emailwithoutplus")&&!validateEmailWithoutPlus(a.value)&&(c[c.length]="emailwithoutplus");hasClass(a,"url")&&!validateUrl(a.value)&&(c[c.length]="url");hasClass(a,"empty")&&!validateEmpty(a.value)&&(c[c.length]="empty");hasClass(a,"onlyNumbers")&&!validateOnlyNumbers(a.value)&&(c[c.length]="onlyNumbers");
hasClass(a,"optionalOnlyNumbers")&&!validateOptionalOnlyNumbers(a.value)&&(c[c.length]="optionalOnlyNumbers");hasClass(a,"onlyAlphabets")&&!validateOnlyText(a.value)&&(c[c.length]="onlyAlphabets");hasClass(a,"requiredSelection")&&!validateSelection(a)&&(c[c.length]="requiredSelection");hasClass(a,"minFieldLength")&&!validateMinFieldLength(a)&&(c[c.length]="minFieldLength");hasClass(a,"compareFieldValue")&&!compareFieldValue(a)&&(c[c.length]="compareFieldValue");hasClass(a,"age")&&!validateAge()&&
(c[c.length]="age");if(0<c.length&&d){if(addClass(d,"show"),addClass(d.closest(".form-group"),"invalidField"),b)try{b.errorMessage="Client validation Error | "+d.innerText;var f=window.aa.createEvent("FORM_ERROR",b);window.dispatchEvent(f)}catch(k){form_commonLogger("Error while triggering analytics FORM_ERROR event",k)}}else d&&(removeClass(d,"show"),removeClass(d.closest(".form-group"),"invalidField"));return c}
function submitForm(a){form_commonLogger("in submitForm...");var b="",c="",d="",f="",k="";enableDisableMultipleButton(a,["submit","reset"],!0);for(var h=0;h<a.length;h++){var l=a[h];l&&"showServerResponse"==l.name&&(b=l.value);l&&"serverResponseMessage"==l.name&&(c=l.value);l&&"showErrorFromServerResponse"==l.name&&(d=l.value);l&&"serverResponseErrorMessage"==l.name&&(f=l.value);l&&"redirectOnSuccess"==l.name&&(k=l.value)}l=getURLParameterString(a);var p=document.querySelectorAll("input[data-boolean-type\x3dtrue]:not(:checked)");
for(h=0;h<p.length;h++)if(p[h]){var q=p[h].name;l="unsubscribed"!=q?l+("\x26"+q+"\x3dfalse"):l+"\x26unsubscribed\x3dtrue"}fetch(a[0].value,{credentials:"include",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:l}).then(function(t){if(t.ok)return isResponseJson(t)?t.json():t.text();formSubmitErrorCallback(a,t,d,f)}).then(function(t){t&&formSubmitSuccessCallback(a,t,b,c,k)}).catch(function(t){formSubmitErrorCallback(a,t,d,f)})}
function formSubmitSuccessCallback(a,b,c,d,f){form_commonLogger("in formSubmitSuccessCallback...",b);form_commonLogger("formObject",a);form_commonLogger("redirectOnSuccess: "+f);form_commonLogger("showServerResponse: "+c);form_commonLogger("serverResponseMessage: "+d);form_commonLogger("response.status: "+b.status);f&&""!=f?window.location.replace(f):("true"==c&&""!=d?(b=getMessageFromResponse(d,b.success[0].code),addClasses(document.getElementsByClassName("form-error "+a.id)[0],["d-none","hidden"]),
addClasses(document.getElementById(a.id),["d-none","hidden"]),document.getElementsByClassName("form-success "+a.id)[0].innerHTML=b,removeClasses(document.getElementsByClassName("form-success "+a.id)[0],["d-none","hidden"]),removeClass(document.getElementsByTagName("body")[0],"overflow-hidden"),b=document.getElementsByClassName("form-success "+a.id)[0]):(b&&b.success&&(b=updateSuccessMsg(b.success,document.getElementsByClassName("form-success "+a.id)[0].innerHTML),document.getElementsByClassName("form-success "+
a.id)[0].innerHTML=b,b=document.getElementsByClassName("form-success "+a.id)[0],b.focus({preventScroll:!0}),b.scrollIntoView({behavior:"smooth",block:"center"})),addClasses(document.getElementById(a.id),["d-none","hidden"]),addClasses(document.getElementsByClassName("form-error "+a.id)[0],["d-none","hidden"]),removeClasses(document.getElementsByClassName("form-success "+a.id)[0],["d-none","hidden"]),removeClasses(document.getElementsByClassName("form-success "+a.id)[0],["d-none","hidden"]),removeClass(document.getElementsByTagName("body")[0],
"overflow-hidden"),b=document.getElementsByClassName("form-success "+a.id)[0]),b.focus({preventScroll:!0}),b.scrollIntoView({behavior:"smooth",block:"center"}));b={};b.formRef=a;try{delete b.errorMessage;form_commonLogger("analytics form submitted data obj: "+b);var k=window.aa.createEvent("FORM_SUBMITTED",b);window.dispatchEvent(k)}catch(h){form_commonLogger("Error while triggering analytics FORM_SUBMITTED event")}enableDisableMultipleButton(a,["submit","reset"],!1)}
function formSubmitErrorCallback(a,b,c,d){form_commonLogger("in formSubmitErrorCallback...",b);form_commonLogger("formObject",a);form_commonLogger("showErrorFromServerResponse: "+c);form_commonLogger("serverResponseErrorMessage: "+d);form_commonLogger("response.status: "+b.status);enableDisableMultipleButton(a,["submit","reset"],!1);"true"==c?b.text().then(function(k){k=JSON.parse(k);form_commonLogger("respJson: "+JSON.stringify(k));if(k.results&&k.results.code){var h=getMessageFromResponse(d,k.results.code);
""!=h?showPromoCodeErrorMsg(a,h):showPromoCodeErrorMsg(a,k.results.message)}else document.getElementById("service-response-error")&&document.getElementById("service-response-error").remove(),k.errorMessage||(k.errorMessage="Oops! Something went wrong. Please try again later."),document.getElementById(a.id).innerHTML='\x3cdiv id\x3d"service-response-error" class\x3d"text parbase text-red"\x3e\x3cdiv class\x3d" textcolumn form-error"\x3e\x3cdiv role\x3d"alert" class\x3d"mb-8 alert alert-danger py-2 px-4"\x3e '+
k.errorMessage+"\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e",k=document.getElementsByClassName("form-error "+a.id)[0],k.focus({preventScroll:!0}),k.scrollIntoView({behavior:"smooth",block:"center"})}):(removeClasses(document.getElementsByClassName("form-error "+a.id)[0],["d-none","hidden"]),b=document.getElementsByClassName("form-error "+a.id)[0],b.focus({preventScroll:!0}),b.scrollIntoView({behavior:"smooth",block:"center"}),addClasses(document.getElementById(a.id),["d-none","hidden"]),removeClass(document.getElementsByTagName("body")[0],
"overflow-hidden"));b={};b.formRef=a;b.errorMessage="Form Server error";try{form_commonLogger("analytics form submitted data obj: "+b);var f=window.aa.createEvent("FORM_ERROR",b);window.dispatchEvent(f)}catch(k){form_commonLogger("Error while triggering analytics FORM_ERROR event")}}var formInit=!1;window.addEventListener("load",function(a){initializeFormEventHandlers();getDropDownListFromExcel()});
function initializeFormEventHandlers(){setTimeout(function(){allInputEventsHandler();allSelectEventHandler();allTextAreaEventHandler();formInit=!0},1E3)}
function allInputEventsHandler(){document.querySelectorAll("input").forEach(function(a){a.addEventListener("blur",function(f){if(f.target.value)try{f.target.value=f.target.value.trim()}catch(k){}validateInput(f.target,null);""==f.target.value?removeClasses(f.target.parentElement,["filled","focused"]):addClass(f.target.parentElement,"filled");hasClass(f.target,"no-spaces-field")&&(f.target.value=f.target.value.replace(/\s+/g,""))});a.addEventListener("focus",function(f){addClass(f.target.parentElement,
"focused")});a.addEventListener("change",function(f){"file"==f.target.type&&fileUploadHandler(f.target)});if("date"===a.type){var b=new Date,c=b.getMonth()+1,d=b.getDate();b=b.getFullYear();10>c&&(c="0"+c.toString());10>d&&(d="0"+d.toString());c=b+"-"+c+"-"+d;-1<a.className.indexOf("hide-future-date")&&(a.max=c);-1<a.className.indexOf("hide-past-date")&&(a.min=c);a.value=c}})}
function allSelectEventHandler(){document.querySelectorAll("select").forEach(function(a){a.addEventListener("change",function(b){if(a.parentElement.classList.contains("select-dropdown-with-other")){if(a.parentElement.parentElement.querySelector(".input")){var c=a.parentElement.parentElement.querySelector(".input").querySelector("input"),d=a.getAttribute("name");a.parentElement.style.marginBottom=window.getComputedStyle(a.closest(".form-group")).marginBottom;"other"==a.value.toLowerCase()&&a&&c?(a.toggleAttribute("name"),
c.parentElement.classList.remove("hidden"),c.setAttribute("name",d),a.classList.contains("validate")&&(a.classList.contains("empty")||a.classList.contains("requiredSelection"))&&(c.setAttribute("aria-required","true"),c.classList.add("validate"),c.classList.add("empty"),c.parentElement.querySelector("span").classList.add("error-message"))):(c&&a&&(c.toggleAttribute("name"),c.parentElement.classList.add("hidden"),a.setAttribute("name",d)),c&&c.classList.contains("validate")&&c.classList.contains("empty")&&
(c.setAttribute("aria-required","false"),c.classList.remove("validate"),c.classList.remove("empty"),c.parentElement.classList.remove("invalidField"),c.parentElement.querySelector("span").classList.remove("error-message")))}""==b.target.value?removeClass(b.target.parentElement,"filled"):addClass(b.target.parentElement,"filled");validateInput(b.target,null)}})})}
function allTextAreaEventHandler(){document.querySelectorAll("textarea").forEach(function(a){a.addEventListener("blur",function(b){b.target.value=b.target.value.trim();validateInput(b.target,null);""==b.target.value?removeClasses(b.target.parentElement,["filled","focused"]):addClass(b.target.parentElement,"filled");hasClass(b.target,"no-spaces-field")&&(b.target.value=b.target.value.replace(/\s+/g,""))});a.addEventListener("focus",function(b){addClass(b.target.parentElement,"focused")})})}
function getDropDownListFromExcel(){var a=document.querySelectorAll("input.dam_excelpath");a&&a.forEach(function(b){var c=b.value,d=b.nextElementSibling;b=b.previousElementSibling;if(b&&void 0!=b.value)var f=b.value;getJsonFrmExcelSheet(c,"").then(function(k){return k.json()}).then(function(k){k=k[0].data;for(var h=0;h<k.length;++h){var l=k[h].Label,p=k[h].Value;p=void 0==p?l:p;-1==f.indexOf(l)&&(l=new Option(l,p),d.add(l,void 0))}}).catch(function(k){console.log("Error while get data from dam excel path",
k.message)})})}function createFormObjectForAnalytics(a){var b={};b.formRef=a;return b}function getMessageFromResponse(a,b){var c="";a=a.split(",");for(var d=0;d<a.length;d++)if(a[d].startsWith(b)){c=a[d].substring(a[d].indexOf(":")+1);break}return c}function updateSuccessMsg(a,b){for(var c=0;c<a.length;c++)-1!=b.indexOf(a[c].code)&&(b=b.replace(a[c].code,a[c].message));return b}
function showPromoCodeErrorMsg(a,b){form_commonLogger("in showPromoCodeErrorMsg..");removeClasses(document.getElementsByClassName("form-error "+a.id)[0],["d-none","hidden"]);addClasses(document.getElementsByClassName("form-error "+a.id)[0],["font-Roboto","text-red","font-roboto","my-3"]);document.getElementsByClassName("form-error "+a.id)[0].innerText=b;a=getAbsoluteTop(document.querySelector("#"+a.id))-150;window.scrollTo({top:a,behavior:"smooth"})}
function getAbsoluteTop(a){var b=0;do b+=a.offsetTop||0,a=a.offsetParent;while(a);return b}function setCaptchaErrorStatus(a,b){if(b){addClass(a,"show");addClass(a.closest(".form-group"),"invalidField");try{formObjAnalytics.errorMessage="Client validation Error | "+a[0].innerText;var c=window.aa.createEvent("FORM_ERROR",formObjAnalytics);window.dispatchEvent(c)}catch(d){form_commonLogger("Error while triggering analytics FORM_ERROR event",d)}}}
function form_commonLogger(a,b){-1<window.location.search.indexOf("debugForm\x3dtrue")&&(console.log(a),b&&console.log(b))}function getNextSiblingWithMatchingClass(a,b){for(a=a.nextElementSibling;a;){if(hasClass(a,b))return a;a=a.nextElementSibling}return null}function hasClass(a,b){return a.classList?a.classList.contains(b):!!a.className.match(new RegExp("(\\s|^)"+b+"(\\s|$)"))}function addClasses(a,b){a.classList.add.apply(a.classList,$jscomp.arrayFromIterable(b))}
function addClass(a,b){a.classList?a.classList.add(b):hasClass(a,b)||(a.className+=" "+b)}function removeClasses(a,b){a.classList.remove.apply(a.classList,$jscomp.arrayFromIterable(b))}function removeClass(a,b){a.classList?a.classList.remove(b):hasClass(a,b)&&(a.className=a.className.replace(new RegExp("(\\s|^)"+b+"(\\s|$)")," "))}function closestTraverseUpByClass(a,b){return a.className&&!a.className.split(" ").includes(b)?closestTraverseUpByClass(a.parentElement,b):a}
function closestTraverseUpByTagName(a,b){return a.tagName.toUpperCase()!=b.toUpperCase()?closestTraverseUpByTagName(a.parentElement,b):a}
function getURLParameterString(a){var b=new FormData(a);a=getDataAttribute("commonUtilLoad","language")+"_"+getDataAttribute("commonUtilLoad","country");b.set("locale",a);a="";b=$jscomp.makeIterator(b);for(var c=b.next();!c.done;c=b.next()){var d=$jscomp.makeIterator(c.value);c=d.next().value;d=d.next().value;"undefined"!=typeof d&&"object"!=typeof d&&d.includes("://")&&(d=updateHTTPDomainValue(d));"string"===typeof d&&(d=d.replaceAll("\n","\\n"));a+='"'+c+'" : "'+d+'",'}a="{"+a.substring(0,a.length-
1)+"}";var f=JSON.parse(a);return Object.keys(f).map(function(k){return encodeURIComponent(k)+"\x3d"+encodeURIComponent(f[k])}).join("\x26")}function updateHTTPDomainValue(a){a.startsWith("http://")?a=a.replace("http://","http_"):a.startsWith("https://")&&(a=a.replace("https://","https_"));return a}function enableDisableMultipleButton(a,b,c){for(var d=0;d<a.length;d++){var f=a[d];if(Array.isArray(b))for(var k in b)enableDisableSingleButton(f,b[k],c)}}
function enableDisableSingleButton(a,b,c){a&&a.type==b&&(c?addClasses(a,["disabled","bg-grey-2","border-grey-2","cursor-wait"]):removeClasses(a,["disabled","bg-grey-2","border-grey-2","cursor-wait"]),a.disabled=c)}
function getDataAttribute(a,b){a="string"===typeof a?document.getElementById(a):a;switch(b){case "language":return a.dataset.language;case "country":return a.dataset.country;case "targetfolderid":return a.dataset.targetfolderid;case "uploadurl":return a.dataset.uploadurl;case "enablerecaptcha":return a.dataset.enablerecaptcha;case "recaptchasitekey":return a.dataset.recaptchasitekey;case "allowedfilesize":return a.dataset.allowedfilesize;case "allowedfiletypes":return a.dataset.allowedfiletypes;default:return null}}
function isResponseJson(a){return(a=a.headers.get("content-type"))&&-1<a.indexOf("json")?!0:!1}function validateEmail(a){return!/^(([^<>()[\]\.,;:\s@"]+(\.[^<>()[\]\.,;:\s@"]+)*)|(".+"))@(([^<>()[\]\.,;:\s@"]+\.)+[^<>()[\]\.,;:\s@"]{2,})$/i.test(a)||128<a.length?!1:!0}function validateEmailWithoutPlus(a){return!/^[a-zA-Z0-9._%]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(a)||128<a.length?!1:!0}
function validateUrl(a){return/^(http[s]?:\/\/){0,1}(www\.){0,1}[a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,5}[\.]{0,1}/.test(a)?!0:!1}function validateOnlyNumbers(a){return/^-?\d+\.?\d*$/.test(a)?!0:!1}function validateOptionalOnlyNumbers(a){return a?/^-?\d+\.?\d*$/.test(a)?!0:!1:!0}function validateOnlyText(a){return/^[a-zA-Z\s]+$/.test(a)?!0:!1}function validateEmpty(a){a=a.trim();return""==a||null==a?!1:!0}
function validateSelection(a){if("SELECT"===a.tagName){if("-1"===a.value)return!1}else if(0==a.querySelectorAll(":checked").length)return!1;return!0}function compareFieldValue(a){var b=a.getAttribute("data-compare-with");b=document.getElementById(b).value;return""==a.value||null==a.value||a.value!=b?!1:!0}function validateMinFieldLength(a){var b=a.getAttribute("data-min-length");return a.value.trim().length<b?!1:!0}
function validateAge(){var a=document.querySelector("#verify-dob");console.log("dateString value:",a?a.value:'No element with id "verify-dob" found');var b=document.querySelector("button[type\x3d'submit']"),c=parseInt(document.querySelector("#check-Age").defaultValue)||18,d=a?new Date(Date.parse(a.value)):NaN;if(isNaN(d.getTime()))return console.log("Unrecognized date format"),a.closest(".form-group").classList.add("invalidField"),a.closest(".form-group").querySelector(".error-message").style.display=
"block",a.setAttribute("required",!0),a.style.border="2px solid #df001f",b&&(b.disabled=!0),"Unrecognized date format.";var f=new Date,k=f.getFullYear()-d.getFullYear(),h=f.getMonth()-d.getMonth();(0>h||0===h&&f.getDate()<d.getDate())&&k--;console.log("Age:",k);k<c?(a.closest(".form-group").classList.add("invalidField"),a.closest(".form-group").querySelector(".error-message").style.display="block",a.setAttribute("required",!0),a.style.border="2px solid #df001f",b&&(b.disabled=!0)):(a.closest(".form-group").querySelector(".error-message").style.display=
"none",a.setAttribute("required",!1),a.style.border="",b&&(b.disabled=!1));return k>=c}
function fileUploadHandler(a){form_commonLogger("in fileUploadHandler...");if(a&&""!=a.value&&a.files&&0<a.files.length)if(addClass(a.parentElement.querySelector(".upload-error-message-filesize"),"hidden"),addClass(a.parentElement.querySelector(".upload-error-message-filetype"),"hidden"),a.files[0].size>1048576*getDataAttribute(a,"allowedfilesize"))removeClass(a.parentElement.querySelector(".upload-error-message-filesize"),"hidden"),a.files[0].value="";else{var b=a.files[0].name;b=b.substr(b.lastIndexOf("."));
(new RegExp(getDataAttribute(a,"allowedfiletypes"),"i")).test(b)?(b=new FormData,b.set("fileToUploadInSP",a.files[0]),b.set("targetSPFolderId",getDataAttribute(a,"targetfolderid")),form_commonLogger("targetfolderid: "+getDataAttribute(a,"targetfolderid")),form_commonLogger("uploadurl: "+getDataAttribute(a,"uploadurl")),b={method:"POST",body:b},fetch(getDataAttribute(a,"uploadurl"),b).then(function(c){c.ok?fileUploadSuccessHandler(c,a):fileUploadFailureHandler(c,a)}).catch(function(c){fileUploadFailureHandler(c,
a)})):(removeClass(a.parentElement.querySelector(".upload-error-message-filetype"),"hidden"),a.files[0].value="")}}
function fileUploadSuccessHandler(a,b){form_commonLogger("in fileUploadSuccessHandler...");a.text().then(function(c){var d=c;"string"===typeof c&&(d=JSON.parse(c));form_commonLogger("responseJSON: "+JSON.stringify(d));form_commonLogger("box file path: "+d.url);"undefined"!=typeof b.getAttribute("data-hiddenFieldClass")&&"undefined"!=typeof document.getElementsByClassName(b.getAttribute("data-hiddenFieldClass"))[0]&&(document.getElementsByClassName(b.getAttribute("data-hiddenFieldClass"))[0].value=
d.url);b.parentElement.querySelector(".fileUploadFieldSpan").innerHTML=d.fileName;removeClass(b.parentElement.querySelector(".fileUploadFieldSpan"),"text-black-50");addClass(b.parentElement.querySelector(".upload-error-message"),"hidden");removeClass(b.parentElement.querySelector(".field-error-message"),"hidden");addClass(b.parentElement.querySelector(".field-error-message"),"error-message");removeClass(b.parentElement,"invalidField")})}
function fileUploadFailureHandler(a,b){form_commonLogger("in fileUploadFailureHandler...",a);removeClass(b.parentElement.querySelector(".fileUploadFieldSpan"),"text-black-50");removeClass(b.parentElement.querySelector(".upload-error-message"),"hidden");addClass(b.parentElement.querySelector(".field-error-message"),"hidden");removeClass(b.parentElement.querySelector(".field-error-message"),"error-message");addClass(b.parentElement,"invalidField")}
function openPopUp(a){form_commonLogger("in openPopUp...");a=closestTraverseUpByTagName(a,"form");removeClass(a.querySelector(".wd-modal"),"hidden");addClass(document.getElementsByTagName("body")[0],"overflow-hidden")}function closePopUp(a){form_commonLogger("in closePopUp...");addClass(closestTraverseUpByClass(a,"wd-modal"),"hidden");removeClass(document.getElementsByTagName("body")[0],"overflow-hidden")}
document.addEventListener("DOMContentLoaded",function(){function a(b,c,d){var f=document.createElement("option");f.value=c;f.innerHTML=c;f.classList.add(d);b.appendChild(f)}document.querySelectorAll(".dynamic-selection-component-root").forEach(function(b){var c=b.querySelector(".urlExcelPath").value,d=b.querySelector(".level1ColumnID").value,f=b.querySelector(".level2ColumnID").value,k=b.querySelector(".level1SelectRoot"),h=b.querySelector(".emptyLevel2").value,l="";fetch(c+".exceltojson.json").then(function(p){if(p.ok)return p.json();
throw Error("Something went wrong in fetching Excel Data");}).then(function(p){var q=JSON,t=q.parse;var u={};p=$jscomp.makeIterator(p[0].data);for(var C=p.next();!C.done;C=p.next()){var E=C.value;C=E[d];E=E[f];u[C]||(u[C]=[]);f&&E&&u[C].push(E)}u=JSON.stringify(u);l=t.call(q,u);for(var F in l)a(k,F,"dynamicSelection-level1-option")}).catch(function(p){console.log(p)});k.addEventListener("change",function(){var p=b.querySelector(".level2SelectRoot");if(p){p.querySelectorAll(".dynamicSelection-level2-option").forEach(function(F){F.remove()});
p.selectedIndex=0;for(var q in l)if(q===k.value){if("textfield"==h){var t=b.querySelector(".dynamic-selection-level2").querySelector(".level2-select-dropdown"),u=b.querySelector(".dynamic-selection-level2").querySelector(".level2-select-text"),C=t.querySelector(".select-dropdown select"),E=u.querySelector(".form-group input");0>=l[q].length?(t.classList.contains("hidden")||t.classList.toggle("hidden"),u.classList.contains("hidden")&&u.classList.toggle("hidden"),C.classList.contains("validate")&&C.classList.contains("empty")&&
(C.classList.toggle("validate"),E.setAttribute("name",C.getAttribute("name")),C.removeAttribute("name")),!E.classList.contains("validate")&&C.classList.contains("empty")&&E.classList.toggle("validate")):(t.classList.contains("hidden")&&t.classList.toggle("hidden"),u.classList.contains("hidden")||u.classList.toggle("hidden"),!C.classList.contains("validate")&&C.classList.contains("empty")&&(C.classList.toggle("validate"),C.setAttribute("name",E.getAttribute("name")),E.removeAttribute("name")),E.classList.contains("validate")&&
C.classList.contains("empty")&&E.classList.toggle("validate"))}"hideLevel2"==h&&(t=b.querySelector(".dynamic-selection-level2").querySelector(".level2-select-dropdown"),u=t.querySelector(".select-dropdown select"),0>=l[q].length?(t.classList.contains("hidden")||t.classList.toggle("hidden"),u.classList.contains("validate")&&u.classList.contains("empty")&&u.classList.toggle("validate")):(t.classList.contains("hidden")&&t.classList.toggle("hidden"),!u.classList.contains("validate")&&u.classList.contains("empty")&&
u.classList.toggle("validate")));"emptyDropdown"==h&&(t=b.querySelector(".dynamic-selection-level2").querySelector(".level2-select-dropdown").querySelector(".select-dropdown select"),0>=l[q].length?t.classList.contains("validate")&&t.classList.contains("empty")&&t.classList.toggle("validate"):!t.classList.contains("validate")&&t.classList.contains("empty")&&t.classList.toggle("validate"));for(level2 in l[q])a(p,l[q][level2],"dynamicSelection-level2-option")}}})})});
var StoreProductCardApp={el:"#store-product-card-component",mixins:[commerceService],data:function(){return{productID:"",skuID:"",hideBadge:"",viewType:"",productReferenceObject:{},skuReferenceObject:{},customPromotionInfo:{},customPromotions:{},isCatalogPurchasable:!1,showQuickViewModal:!1,slideTransform:"",loading:!1,productDescription:""}},mounted:function(){this.loading=!0;this.productID=this.$refs.productID.dataset.productid;this.skuID=this.$refs.skuID.dataset.skuid;this.hideBadge=this.$refs.hideBadge.dataset.hidebadge;
this.viewType=this.$refs.viewType.dataset.viewtype;this.$refs.productDescription&&(this.productDescription=this.$refs.productDescription.dataset.productdescription);this.isCatalogPurchasable=this.getPurchasableCatalog();this.initializeProductDetails();"store-nav-view"==this.viewType||document.body.hasAttribute("bvJSLoaded")||(this.loadBVJS(),document.body.setAttribute("bvJSLoaded","true"))},updated:function(){},methods:{loadBVJS:function(){var a=document.createElement("script");a.setAttribute("src",
document.getElementById("commerceLoad").getAttribute("data-bv-endpoint-url"));a.setAttribute("type","text/javascript");a.setAttribute("async",!0);document.body.appendChild(a)},initializeProductDetails:function(){var a=this,b=this.getSessionVariable(this.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);b&&(b[this.productID]||b[this.skuID])?(this.productReferenceObject=b[""!=this.productID&&void 0!=this.productID?this.productID:this.skuID],null!=this.skuID&&""!=this.skuID&&(this.skuReferenceObject=b[this.skuID]),
this.productcard_commonLogger("productReferenceObject: ",this.productReferenceObject),"store-banner-view-vue"!=this.viewType&&this.getProductPriceInfo(),this.setProductCardAttributes(),this.updateSkuImage(),this.updateSkuTitle(),this.updatePagePath(),this.initCustomPromotionInfo(this.productID,this.skuID,b),this.attachEventsForModalAfterPrice()):this.getProductReferences().then(function(){var c=a.getSessionVariable(a.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);c&&(c[a.productID]||c[a.skuID])?(a.productReferenceObject=
c[""!=a.productID&&void 0!=a.productID?a.productID:a.skuID],null!=a.skuID&&""!=a.skuID&&(a.skuReferenceObject=c[a.skuID]),a.productcard_commonLogger("productReferenceObject: ",a.productReferenceObject),a.setProductCardAttributes(),"store-banner-view-vue"!=a.viewType&&a.getProductPriceInfo(),a.updateSkuImage(),a.updateSkuTitle(),a.updatePagePath(),a.initCustomPromotionInfo(a.productID,a.skuID,c),a.attachEventsForModalAfterPrice()):a.loading=!1})},setProductCardAttributes:function(){if(this.productReferenceObject.categories&&
this.productReferenceObject.categories["vc-capacity"]){var a=this.productReferenceObject.categories["vc-capacity"].data;this.productReferenceObject.capacity=a[0].title+(1<a.length?"-"+a[a.length-1].title:"")}this.productReferenceObject.categories&&this.productReferenceObject.categories["vc-color"]&&(this.productReferenceObject.color=this.productReferenceObject.categories["vc-color"].data);this.productDescription&&(this.productReferenceObject.tagLine=this.productDescription)},updateSkuImage:function(){null!=
this.skuID&&""!=this.skuID&&null!=this.skuReferenceObject.urlFileReference&&""!=this.skuReferenceObject.urlFileReference&&(this.productReferenceObject.urlFileReference=this.skuReferenceObject.urlFileReference)},updateSkuTitle:function(){null!=this.skuID&&""!=this.skuID&&null!=this.skuReferenceObject.variantTitle&&""!=this.skuReferenceObject.variantTitle&&(this.productReferenceObject.pageTitle=this.skuReferenceObject.variantTitle)},updatePagePath:function(){null!=this.skuID&&""!=this.skuID&&null!=
this.skuReferenceObject.pagePath&&""!=this.skuReferenceObject.pagePath&&(this.productReferenceObject.pagePath=this.skuReferenceObject.pagePath)},getProductPriceInfo:function(){var a=this,b=this.productID,c=this.skuID;if(null!=c&&""!=c){var d=this.getSessionVariable(c);null==d||null==d.prices?this.getProductPrice(c).then(function(l){a.productcard_commonLogger("SKU Info found for: "+c+"response "+l);d=a.getSessionVariable(c);null!=d?(a.productReferenceObject.minPricedSku=c,a.productReferenceObject.minPricedSkuObj=
d,a.$forceUpdate()):a.productcard_commonLogger("SKU Code "+c+"not found in session.");a.loading=!1}).catch(function(l){a.loading=!1;a.productcard_commonLogger("product card - Rejection from commerce service",l)}):(this.productReferenceObject.minPricedSku=c,this.productReferenceObject.minPricedSkuObj=d,this.loading=!1,this.$forceUpdate())}else{var f=this.getSessionVariable(b);if(null==f)this.getBaseProductInfo(b,this.productReferenceObject.skuList).then(function(){f=a.getSessionVariable(b);if(null!=
f){var l=f.minPricedSKU;""!=l&&(a.productReferenceObject.minPricedSku=l,l=a.getSessionProductPricingInfo(l),a.productReferenceObject.minPricedSkuObj=l,a.$forceUpdate())}else a.productcard_commonLogger("Product "+b+"not found in session.");a.loading=!1}).catch(function(){a.loading=!1;a.productcard_commonLogger("error thrown while getting sessionBaseProductInfo :: ",b)});else{var k=f.minPricedSKU;if(""!=k){var h=this.getSessionProductPricingInfo(k);this.productReferenceObject.minPricedSkuObj=h;this.productReferenceObject.minPricedSku=
k;this.$forceUpdate()}this.loading=!1}}},getSessionProductPricingInfo:function(a){a=this.getSessionVariable(a);return null!=a?a:""},rewritePageUrl:function(a){void 0!=a&&0<a.trim().length&&(a=this.rewritePageURL(a),null!=this.skuID&&""!=this.skuID&&(a=a.concat("?sku\x3d"+this.skuID)));return a},isBadgeActive:function(a,b){return this.isBadgeStatusActive(a,b)},initCustomPromotionInfo:function(a,b,c){var d=this;this.productcard_commonLogger("initCustomPromotionInfo");!a&&b&&c[b]&&(a=c[b].productId);
this.customPromotionInfo="";b=c[a];var f=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.CUSTOM_PROMOTIONS);f?(this.customPromotions=f,f=[],b.attBelowResellerButtonPromo&&(f=b.attBelowResellerButtonPromo.split(",")),void 0!=this.customPromotions&&void 0!=this.customPromotions[b.attBelowAddToCartButtonPromo]?this.customPromotionInfo=this.customPromotions[b.attBelowAddToCartButtonPromo]:void 0!=this.customPromotions&&f.length&&void 0!=this.customPromotions[f[0]]&&(this.customPromotionInfo=this.customPromotions[f[0]],
this.customPromotionInfo.isBelowResellerButtonPromo="true"),this.productcard_commonLogger(this.customPromotionInfo)):this.getPromotionsJson().then(function(){var k=c[a],h=d.getSessionVariable(d.$data.COMMERCE_CONSTANTS.CUSTOM_PROMOTIONS);h&&(d.customPromotions=h,h=[],k.attBelowResellerButtonPromo&&(h=k.attBelowResellerButtonPromo.split(",")),void 0!=d.customPromotions&&void 0!=d.customPromotions[k.attBelowAddToCartButtonPromo]?d.customPromotionInfo=d.customPromotions[k.attBelowAddToCartButtonPromo]:
void 0!=d.customPromotions&&h.length&&void 0!=d.customPromotions[h[0]]&&(d.customPromotionInfo=d.customPromotions[h[0]],d.customPromotionInfo.isBelowResellerButtonPromo="true"),d.productcard_commonLogger(d.customPromotionInfo),d.$forceUpdate())})},attachEventsForModalAfterPrice:function(){var a=document.querySelector(".product-card"),b=!1;(new MutationObserver(function(c){b||(initSiteRedesign(),b=!0)})).observe(a,{subtree:!0,childList:!0})},openQuickView:function(a){a=a.currentTarget;a.closest(".heroBannerCarousel")&&
(a.closest(".heroBannerCarousel").classList.add("carousel-quickView-modal"),this.slideTransform=document.querySelector(".carousel-quickView-modal ul.splide__list").style.transform,document.querySelector(".carousel-quickView-modal ul.splide__list").style.position="relative",document.querySelector(".carousel-quickView-modal ul.splide__list").style.left="-"+this.slideTransform.replace(/\D/g,"")+"px");a=a.getAttribute("data-target");document.getElementById(a).classList.remove("hidden");this.showQuickViewModal=
!0;document.querySelector("body").classList.add("overflow-hidden");this.$forceUpdate();try{a={};a.productSkuID="undefined"!=typeof this.productID||""!=this.productID?this.productID:this.skuID;var b=window.aa.createEvent("QUICK_PROD_VIEW",a);window.dispatchEvent(b)}catch(c){console.log("Error while triggering analytics QUICK_PROD_VIEW event",c)}},closeQuickViewModal:function(a){a.currentTarget.closest(".heroBannerCarousel")&&(document.querySelector(".carousel-quickView-modal ul.splide__list").style.transform=
this.slideTransform,document.querySelector(".carousel-quickView-modal ul.splide__list").style.position="",document.querySelector(".carousel-quickView-modal ul.splide__list").style.left="",a.currentTarget.closest(".heroBannerCarousel").classList.remove("carousel-quickView-modal"));this.showQuickViewModal=!1;document.querySelector("body").classList.remove("overflow-hidden");this.$forceUpdate()},productcard_commonLogger:function(a,b){-1<window.location.search.indexOf("debugProductCard\x3dtrue")&&console.log("Product Card :"+
a,null!=b?b:"")},isB2BUser:function(){return this.getCustomerChannel()==this.COMMERCE_CONSTANTS.B2B?!0:!1}}};Vue.newInstance("StoreProductCardApp",StoreProductCardApp);
var StoreProductCardListingApp={el:"#store-product-card-listing-component",mixins:[commerceService],data:function(){return{productReferenceObject:[],productReferences:{},customPromotionInfo:{},customPromotions:{},isCatalogPurchasable:!1,hideBadge:"",totalProductsCount:0,loading:!1,productDescription:""}},mounted:function(){this.loading=!0;this.isCatalogPurchasable=this.getPurchasableCatalog();this.productReferences=this.getSessionVariable(this.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);this.getPromotionsData();
this.hideBadge=this.$refs.hideBadge.dataset.hidebadge;this.$refs.productDescription&&(this.productDescription=this.$refs.productDescription.dataset.productdescription);this.setProductCardList();document.body.hasAttribute("bvJSLoaded")||(this.loadBVJS(),document.body.setAttribute("bvJSLoaded","true"))},updated:function(){initProductCardListingSplide(this.$el)},methods:{loadBVJS:function(){var a=document.createElement("script");a.setAttribute("src",document.getElementById("commerceLoad").getAttribute("data-bv-endpoint-url"));
a.setAttribute("type","text/javascript");a.setAttribute("async",!0);document.body.appendChild(a)},getPromotionsData:function(){var a=this,b=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.CUSTOM_PROMOTIONS);b?this.customPromotions=b:this.getPromotionsJson().then(function(){var c=a.getSessionVariable(a.$data.COMMERCE_CONSTANTS.CUSTOM_PROMOTIONS);c&&(a.customPromotions=c)})},setProductCardAttributes:function(a){if(a.categories&&a.categories["vc-capacity"]){var b=a.categories["vc-capacity"].data;
a.capacity=b[0].title+(1<b.length?"-"+b[b.length-1].title:"")}a.categories&&a.categories["vc-color"]&&(a.color=a.categories["vc-color"].data);this.productDescription&&(a.tagLine=this.productDescription)},setProductCardList:function(){var a=this,b=JSON.parse(this.$refs.productcardfiltersjsonstring.dataset.productcardfiltersjsonstring);this.totalProductsCount=b.length;(new Promise(function(c,d){null==a.productReferences?a.getProductReferences().then(function(){c()}):c()})).then(function(){a.productReferences=
a.getSessionVariable(a.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);if(a.isCatalogPurchasable){var c=b.filter(function(f){return f.productID||f.skuID}).map(function(f){return(f.productID?f.productID+(f.skuID?",":""):"")+(f.skuID?f.skuID:"")}).join(",");(new Promise(function(f,k){a.getProductPrice(c).then(function(h){f()}).catch(function(h){k();console.log("Error in resolving productCards promise")})})).then(function(){for(var f=0;f<b.length;f++)try{a.initializeProductDetails(b[f].productID,b[f].skuID,f)}catch(k){console.log("error while constructing product details object",
k)}}).then(function(){a.loading=!1}).catch(function(f){for(f=0;f<b.length;f++)a.initializeProductDetails(b[f].productID,b[f].skuID,f),f==a.totalProductsCount-1&&(a.loading=!1);console.log("Error in resolving productCards promise")})}else for(var d=0;d<b.length;d++)a.initializeProductDetails(b[d].productID,b[d].skuID,d),d==a.totalProductsCount-1&&(a.loading=!1)})},initializeProductDetails:function(a,b,c){var d=this;if(this.productReferences&&(this.productReferences[a]||this.productReferences[b])){var f=
""!=a&&void 0!=a?a:b;this.productReferences[f].skuid=b;this.setProductCardAttributes(this.productReferences[f]);this.productReferenceObject.push(this.productReferences[f]);this.productcard_commonLogger("productReferenceObject: ",this.productReferenceObject);this.getProductPriceInfo(a,b,this.productReferenceObject.length-1,c);this.updateSkuImage(b,this.productReferenceObject.length-1);this.updateSkuTitle(b,this.productReferenceObject.length-1);this.updatePagePath(b,this.productReferenceObject.length-
1);this.initCustomPromotionInfo(a,b,this.productReferenceObject.length-1);this.attachEventsForModalAfterPrice()}else this.getProductReferences().then(function(){d.productReferences=d.getSessionVariable(d.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);if(d.productReferences&&(d.productReferences[a]||d.productReferences[b])){var k=""!=a&&void 0!=a?a:b;d.productReferences[k].skuid=b;d.setProductCardAttributes(d.productReferences[k]);d.productReferenceObject.push(d.productReferences[k]);d.productcard_commonLogger("productReferenceObject: ",
d.productReferenceObject);d.getProductPriceInfo(a,b,d.productReferenceObject.length-1,c);d.updateSkuImage(b,d.productReferenceObject.length-1);d.updateSkuTitle(b,d.productReferenceObject.length-1);d.updatePagePath(b,d.productReferenceObject.length-1);d.initCustomPromotionInfo(a,b,d.productReferenceObject.length-1);d.attachEventsForModalAfterPrice()}})},updateSkuImage:function(a,b){null!=a&&""!=a&&null!=this.productReferences[a].urlFileReference&&""!=this.productReferences[a].urlFileReference&&(this.productReferenceObject[b].urlFileReference=
this.productReferences[a].urlFileReference)},updateSkuTitle:function(a,b){null!=a&&""!=a&&null!=this.productReferences[a].variantTitle&&""!=this.productReferences[a].variantTitle&&(this.productReferenceObject[b].pageTitle=this.productReferences[a].variantTitle)},updatePagePath:function(a,b){null!=a&&""!=a&&null!=this.productReferences[a].pagePath&&""!=this.productReferences[a].pagePath&&(this.productReferenceObject[b].pagePath=this.productReferences[a].pagePath)},getProductPriceInfo:function(a,b,
c,d){var f=this;if(null!=b&&""!=b){var k=this.getSessionVariable(b);null==k||null==k.prices?this.getProductPrice(b).then(function(q){f.productcard_commonLogger("SKU Info found for: "+b+"response "+q);k=f.getSessionVariable(b);null!=k?(f.productReferenceObject[c].minPricedSkuObj=k,f.productReferenceObject[c].minPricedSku=b,f.$forceUpdate()):f.productcard_commonLogger("SKU Code "+b+"not found in session.");d==f.totalProductsCount-1&&(f.loading=!1)}).catch(function(q){f.productcard_commonLogger("product card - Rejection from commerce service",
q);d==f.totalProductsCount-1&&(f.loading=!1)}):(this.productReferenceObject[c].minPricedSkuObj=k,this.productReferenceObject[c].minPricedSku=b,this.$forceUpdate())}else{var h=this.getSessionVariable(a);if(null==h)this.getBaseProductInfo(a,this.productReferenceObject[c].skuList).then(function(){h=f.getSessionVariable(a);if(null!=h){var q=h.minPricedSKU;if(""!=q){var t=f.getSessionProductPricingInfo(q);f.productReferenceObject[c].minPricedSkuObj=t;f.productReferenceObject[c].minPricedSku=q;f.$forceUpdate()}}else f.productcard_commonLogger("Product "+
a+"not found in session.");d==f.totalProductsCount-1&&(f.loading=!1)}).catch(function(){f.productcard_commonLogger("error thrown while getting sessionBaseProductInfo :: ",a);d==f.totalProductsCount-1&&(f.loading=!1)});else{var l=h.minPricedSKU;if(""!=l){var p=this.getSessionProductPricingInfo(l);this.productReferenceObject[c].minPricedSkuObj=p;this.productReferenceObject[c].minPricedSku=l;this.$forceUpdate()}}}},getSessionProductPricingInfo:function(a){a=this.getSessionVariable(a);return null!=a?
a:""},rewritePageUrl:function(a,b){void 0!=a&&0<a.trim().length&&(a=this.rewritePageURL(a),null!=b&&""!=b&&(a=a.concat("?sku\x3d"+b)));return a},initCustomPromotionInfo:function(a,b,c){var d=this;this.productcard_commonLogger("initCustomPromotionInfo");0<Object.keys(this.customPromotions).length?this.settCustomPromotionInfo(a,b,c):this.getPromotionsJson().then(function(){var f=d.getSessionVariable(d.$data.COMMERCE_CONSTANTS.CUSTOM_PROMOTIONS);f&&(d.customPromotions=f,d.settCustomPromotionInfo(a,b,
c))})},settCustomPromotionInfo:function(a,b,c){this.productcard_commonLogger("settCustomPromotionInfo");!a&&b&&this.productReferences[b]&&(a=this.productReferences[b].productId);if(this.productReferences[a]){b=this.productReferences[a].attBelowAddToCartButtonPromo;a=this.productReferences[a].attBelowResellerButtonPromo;this.productReferenceObject[c].attBelowAddToCartButtonPromo=b;var d=[];a&&(d=a.split(","));void 0!=this.customPromotions&&void 0!=this.customPromotions[b]?this.productReferenceObject[c].cpJson=
this.customPromotions[b]:void 0!=this.customPromotions&&d.length&&void 0!=this.customPromotions[d[0]]&&(this.productReferenceObject[c].cpJson=this.customPromotions[d[0]],this.productReferenceObject[c].cpJson.isBelowResellerButtonPromo="true")}},attachEventsForModalAfterPrice:function(){var a=document.querySelector(".product-listing"),b=!1;(new MutationObserver(function(c){b||(initSiteRedesign(),b=!0)})).observe(a,{subtree:!0,childList:!0})},isB2BUser:function(){return this.getCustomerChannel()==this.COMMERCE_CONSTANTS.B2B?
!0:!1},productcard_commonLogger:function(a,b){-1<window.location.search.indexOf("debugProductCardListing\x3dtrue")&&console.log("Product Card Listing:"+a,null!=b?b:"")}}};Vue.newInstance("StoreProductCardListingApp",StoreProductCardListingApp);var plCarousel;
function initProductCardListingSplide(a){a.querySelectorAll(".heroBannerCarousel.splide").forEach(function(b){if(hasClass(b,"splide"))try{if(hasClass(b,"wd-product-listing-carousel")){var c=b.querySelector("ul.splide__list").childElementCount;plCarousel=new Splide(b,{preloadPages:1,perPage:4,wheel:!1,height:"auto",pagination:!1,arrows:4<c?!0:!1,type:"scroll",autoplay:!1,gap:16,direction:"rtl"===document.querySelector("html").getAttribute("dir")?"rtl":"ltr",dragMinThreshold:{mouse:4,touch:10},breakpoints:{2560:{perPage:4,
arrows:4<c?!0:!1,gap:16},1920:{perPage:4,arrows:4<c?!0:!1,gap:16},1464:{perPage:3,arrows:3<c?!0:!1,gap:16},992:{perPage:2,arrows:2<c?!0:!1,gap:16},768:{perPage:1,arrows:1<c?!0:!1},576:{perPage:1,arrows:1<c?!0:!1}}});var d=document.querySelector(".wd-product-listing-carousel .splide__list");(new MutationObserver(function(f){plCarousel.refresh();slidNavshow(b)})).observe(d,{childList:!0});plCarousel.mount();slidNavshow(b);window.addEventListener("resize",function(f){slidNavshow(b)},!0);plCarousel.on("moved",
function(){slidNavshow(b)})}}catch(f){console.log("error while init carousel",f)}})}
function slidNavshow(a){a.querySelector(".splide__slider .splide__arrows")?(a.querySelector(".splide__slider ul.splide__list").classList.remove("justify-center"),a.getElementsByClassName("firstSlide")[0].classList.contains("is-visible")?(a.getElementsByClassName("splide__track")[0].classList.remove("leftSpace"),a.getElementsByClassName("splide__track")[0].classList.add("rightSpace")):a.getElementsByClassName("lastSlide")[0].classList.contains("is-visible")&&(a.getElementsByClassName("splide__track")[0].classList.remove("rightSpace"),
a.getElementsByClassName("splide__track")[0].classList.add("leftSpace"))):(a.getElementsByClassName("splide__track")[0].classList.remove("leftSpace"),a.getElementsByClassName("splide__track")[0].classList.remove("rightSpace"),a.querySelector(".splide__slider ul.splide__list").classList.add("justify-center"))}
document.addEventListener("DOMContentLoaded",function(a){function b(k,h){a:{var l=document.cookie.split("; ");for(var p=0;p<l.length;p++){var q=l[p].split("\x3d");if("Channel"==q[0]){l=q[1];break a}}l=null}if(l&&"B2B"==l&&0<document.getElementsByClassName(h).length){if(c(k),k=document.getElementsByClassName(h),null!=k&&"undefined"!=typeof k)for(h=0;h<k.length;h++)k[h].classList.remove("hidden")}else c(h)}function c(k){for(k=document.getElementsByClassName(k);0<k.length;)k[0].parentNode.removeChild(k[0])}
a=!1;document.body.classList.contains("aem-AuthorLayer-Edit")&&(a=!0);if(a){var d=document.getElementsByClassName("b2c-container");a=document.getElementsByClassName("b2b-container");if(null!=d&&"undefined"!=typeof d)for(var f=0;f<d.length;f++)d[f].classList.remove("hidden");if(null!=a&&"undefined"!=typeof a)for(d=0;d<a.length;d++)a[d].classList.remove("hidden")}else b("b2c-container","b2b-container")});
var EditorialListingApp={el:"#editorial-listing-component",mixins:[],data:function(){return{}},mounted:function(){},methods:{storeTabViewBtn:function(a,b){if(b){a=a.currentTarget;for(var c=a.closest(".store-tabview").getElementsByClassName("tabview-contain"),d=0;d<c.length;d++)c[d].querySelector("button").classList.remove("pointer-events-none","border-b-4","border-blue","sm:bg-transparent","text-blue"),c[d].querySelector("button").classList.add("border-b-4","border-blue","text-grey-5","border-none"),
c[d].querySelector("button").setAttribute("aria-expanded","false"),c[d].classList.remove("active");a.classList.remove("border-b-4","border-blue","text-grey-5","border-none");a.classList.add("pointer-events-none","border-b-4","border-blue","sm:bg-transparent","text-blue");a.setAttribute("aria-expanded","true");c=a.closest(".store-tabview").getElementsByClassName("tabview-box");for(d=0;d<c.length;d++)c[d].classList.add("hidden");a.closest(".store-tabview").querySelector(b).classList.remove("hidden");
a.closest(".store-tabview").querySelector(b).focus();a.parentElement.classList.add("active");(b=a.closest(".store-tabview").querySelector(b).querySelectorAll(".store-form"))&&0<b.length&&!recaptchaScriptLoaded&&loadRecaptchaScript()}}}};Vue.newInstance("EditorialListingApp",EditorialListingApp);
function initializeTabView(){function a(f){var k=f.querySelectorAll(".randomize");k=Array.from(k);for(var h,l=k.length;0!=l;){h=Math.floor(Math.random()*l);l--;var p=k[l];k[l]=k[h];k[h]=p}k.forEach(function(q){f.querySelector("section.section").appendChild(q);q.classList.remove("hidden")})}for(var b=document.querySelectorAll(".tabview-element"),c=0;c<b.length;c++)b[c].addEventListener("click",function(f){for(var k=f.target.dataset.tabcontent,h=f.target.closest(".store-tabview").getElementsByClassName("tabview-contain"),
l=0;l<h.length;l++)h[l].querySelector("button").classList.remove("pointer-events-none","border-b-4","border-blue","sm:bg-transparent","text-blue"),h[l].querySelector("button").classList.add("border-b-4","border-blue","text-grey-5","border-none"),h[l].querySelector("button").setAttribute("aria-expanded","false"),h[l].classList.remove("active");f.target.classList.remove("border-b-4","border-blue","text-grey-5","border-none");f.target.classList.add("pointer-events-none","border-b-4","border-blue","sm:bg-transparent",
"text-blue");f.target.setAttribute("aria-expanded","true");h=f.target.closest(".store-tabview").getElementsByClassName("tabview-box");for(l=0;l<h.length;l++)h[l].classList.add("hidden");f.target.closest(".store-tabview").querySelector(k).classList.remove("hidden");f.target.closest(".store-tabview").querySelector(k).focus();f.target.parentElement.classList.add("active");(f=f.target.closest(".store-tabview").querySelector(k).querySelectorAll(".store-form"))&&0<f.length&&!recaptchaScriptLoaded&&loadRecaptchaScript()});
b=document.querySelectorAll(".tabviewV2-element");for(c=0;c<b.length;c++)b[c].addEventListener("click",function(f){var k=f.target.dataset.tabcontent;f.target.getAttribute("id");for(var h=f.target.closest(".store-tabview").querySelectorAll(".tabviewV2-element"),l=0;l<h.length;l++)h[l].classList.remove("pointer-events-none","bg-grey-1"),h[l].classList.add("bg-transparent"),h[l].setAttribute("aria-expanded","false"),h[l].closest(".tabview-contain").classList.remove("active"),h[l].closest(".tabview-contain").classList.remove("bg-grey-1");
f.target.classList.remove("bg-transparent");f.target.classList.add("pointer-events-none","bg-grey-1");f.target.setAttribute("aria-expanded","true");f.target.closest(".tabview-contain").classList.add("bg-grey-1","activeTab");h=document.querySelectorAll(".tabview-box");for(l=0;l<h.length;l++)h[l].classList.contains("sm:block")&&h[l].classList.remove("sm:block");h=f.target.closest(".store-tabview").querySelectorAll(".tabview-box");for(l=0;l<h.length;l++)h[l].classList.add("hidden");f.target.closest(".store-tabview").querySelector(k).classList.remove("hidden");
document.querySelector(".store-tabview "+k+" ");(f=document.querySelector(".store-tabview "+k+" ")||"")&&null!=f.closest(".randomizeContainer")&&a(f)});if(992>window.innerWidth)for(b=document.querySelectorAll(".mobile-view-tab"),c=0;c<b.length;c++)b[c].addEventListener("click",function(f){for(var k=f.target.closest(".tab-parent").querySelectorAll(".tabview-contain"),h=f.target.closest(".tabview-contain"),l=0;l<k.length;l++)if(k[l]!=h){k[l].classList.contains("active")&&k[l].classList.remove("active");
var p=k[l].closest(".tab-parent").querySelector(".tabview-box");p.classList.contains("hidden")||p.classList.add("hidden")}h=f.target.closest(".tabview-contain");h.classList.toggle("active");h.closest(".tab-parent").querySelector(".tabview-box").classList.toggle("hidden");h.closest(".tab-parent").querySelector(".mob-tab").classList.toggle("mob-tab-active")});b=document.querySelectorAll(".accordion-unique-element");for(c=0;c<b.length;c++)b[c].addEventListener("click",function(f){for(var k=f.target.closest(".accordion-element").querySelectorAll(".accordion-contain"),
h=f.target.closest(".accordion-contain"),l=0;l<k.length;l++)if(k[l]!=h){k[l].classList.contains("active")&&k[l].classList.remove("active");k[l].style.height="auto";var p=k[l].querySelector(".accordion-box");p.classList.contains("hidden")||p.classList.add("hidden")}h=f.target.closest(".accordion-contain");h.classList.toggle("active");h.querySelector(".accordion-box").classList.toggle("hidden");992>window.innerWidth&&f.target.scrollIntoView({behavior:"auto",block:"center",inline:"center"});h.querySelector(".accordion-box").classList.contains("hidden")?
f.target.closest(".accordion-contain").style.height="auto":(k=h.offsetHeight,h=h.querySelector(".accordion-box").offsetHeight,h=k+h+"px",f.target.closest(".accordion-contain").style.height=h)});b=document.querySelectorAll(".accordion-svg-unique-element");for(c={$jscomp$loop$prop$z$137$280:0};c.$jscomp$loop$prop$z$137$280<b.length;c={$jscomp$loop$prop$z$137$280:c.$jscomp$loop$prop$z$137$280},c.$jscomp$loop$prop$z$137$280++)b[c.$jscomp$loop$prop$z$137$280].addEventListener("click",function(f){return function(k){for(var h=
k.target.closest(".accordion-svg-element").querySelectorAll(".accordionTile-contain"),l=k.target.closest(".accordionTile-contain"),p=0;p<h.length;p++)if(h[p]!=l){h[p].style.height="auto";var q=h[p].querySelector(".detail-block");q.classList.contains("selected-block")&&q.classList.remove("selected-block");q=h[p].querySelector(".accordionTile-box");q.classList.contains("hidden")||q.classList.add("hidden")}l=k.target.closest(".accordionTile-contain");l.querySelector(".detail-block").classList.toggle("selected-block");
l.querySelector(".accordionTile-box").classList.toggle("hidden");l.querySelector(".accordionTile-box").classList.contains("hidden")?(l.style.height="auto",l.querySelector(".detail-block").setAttribute("aria-expanded","false")):(h=k.target.closest(".tile-height").offsetHeight,p=l.querySelector(".accordionTile-box").offsetHeight,h=h+p+"px",k.target.closest(".accordionTile-contain").style.height=h,l.querySelector(".detail-block").setAttribute("aria-expanded","true"));window.location.hash=k.target.getAttribute("id");
992>window.innerWidth&&(l=document.querySelectorAll(".accordion-svg-unique-element")[f.$jscomp$loop$prop$z$137$280].getBoundingClientRect().top,scrollToSmoothly(l+(window.pageYOffset||document.documentElement.scrollTop)-90,100));l=k.target.closest(".accordionTile-contain").querySelector(".accordionTile-box-inner");l=window.getComputedStyle(l).backgroundColor;k.target.closest(".accordionTile-contain").querySelector(".detail-block.selected-block svg.el-arrow-t").style.fill=l}}(c));b=document.querySelectorAll(".editorial-list-dropdown");
for(c=0;c<b.length;c++){var d=b[c];null!=d&&d.addEventListener("change",function(f){f=f.currentTarget;f.parentElement.querySelectorAll(".editorial-dropdown-content-wrap").forEach(function(k){k.classList.add("hidden")});f="#".concat(f.options[f.selectedIndex].value);document.querySelector(f).classList.remove("hidden")})}document.querySelectorAll(".randomizeContainer .tabview-box")&&0<document.querySelectorAll(".randomizeContainer .tabview-box").length&&document.querySelectorAll(".randomizeContainer .tabview-box").forEach(function(f){a(f)})}
document.addEventListener("DOMContentLoaded",function(){initializeTabView()});var resultPagePathEle=document.getElementById("resultPagePath"),searchSummaryViewFormEle=document.getElementById("searchSummaryViewForm"),storeSummaryViewVanilla=document.querySelector(".store-summary-view-vanilla");
if(resultPagePathEle&&searchSummaryViewFormEle&&storeSummaryViewVanilla){var defaultValues=function(){document.getElementById("searchTerm").value="";uiEle.innerHTML=""},getSearchSuggestions=function(){""==document.querySelector(".searchSummaryViewInput").value?svClearInputEle.setAttribute("tabindex","-1"):svClearInputEle.removeAttribute("tabindex");var a=document.getElementById("searchTerm").value;if(a&&3<=a.length){b&&clearTimeout(b);var b=document.getElementById("autoSuggestUrl").dataset.autosuggesturl;
var c=b+(b&&0<=b.indexOf("?")?"\x26":"?")+"q\x3d"+encodeURIComponent(a)+"\x26omitHeader\x3dtrue\x26wt\x3djson\x26distrib\x3dfalse";b=setTimeout(function(){svClearInputEle.classList.contains("remove-auto-suggest")&&svClearInputEle.classList.remove("remove-auto-suggest");fetch(c).then(function(d){return d.json()}).then(function(d){d=d.response;d.docs&&0<d.numFound&&(uiEle.innerHTML="",d.docs.forEach(function(f){return uiEle.innerHTML+='\x3cli role\x3d"listitem" class\x3d"ui-menu-item p-4 pl-12 pr-12 hover:bg-grey-1 cursor-pointer"\x3e\x3ca href\x3d'+
f.url+' target\x3d"_self"\x3e'+f.title["0"].split("|")[0]+"\x3c/a\x3e\x3c/li\x3e"}))}).catch(function(d){console.error("Response error",d);return!0})},500)}},resultPagePath=resultPagePathEle.dataset.resultpagepath,uiEle=document.getElementById("ui-id-1");searchSummaryViewFormEle.setAttribute("action",rewritePageURL(resultPagePath));var svClearInputEle=document.querySelector(".svClearInput")}
document.addEventListener("DOMContentLoaded",function(){function a(){var f=document.querySelectorAll(".accordianText-trigger-jquery");0<f.length&&f.forEach(function(k){k.addEventListener("click",function(h){h.preventDefault();k.closest(".accordion-content")&&(h=k.closest(".accordion-content").querySelector(".accordianText-content"))&&(250==h.clientHeight?k.querySelector(".more")&&(k.querySelector(".more").classList.add("hidden"),k.querySelector(".less").classList.remove("hidden"),h=k.closest(".accordion-content").querySelector(".accordianText-content").querySelector("div:first-child").clientHeight,
k.closest(".accordion-content").querySelector(".accordianText-content").animate([{height:h}],{duration:400}),k.closest(".accordion-content").querySelector(".accordianText-content").style.height=h+"px"):k.querySelector(".more")&&(k.querySelector(".more").classList.remove("hidden"),k.querySelector(".less").classList.add("hidden"),k.closest(".accordion-content").querySelector(".accordianText-content").animate([{height:250}],{duration:400}),k.closest(".accordion-content").querySelector(".accordianText-content").style.height=
"250px"))})})}var b=document.querySelectorAll(".accordion-text .accordion-title"),c=document.querySelectorAll(".accordion-text .accordion-text-v1");if(0<window.location.hash.length){var d=window.location.hash;try{document.querySelector(""+d)&&(document.querySelector(d+" .accordion-title").setAttribute("aria-expanded",!0),document.querySelector(d+' svg[aria-label\x3d"Expand Section"]').classList.add("hidden"),document.querySelector(d+' svg[aria-label\x3d"Collapse Section"]').classList.remove("hidden"),
document.querySelector(d+" .accordion-content")?document.querySelector(d+" .accordion-content").classList.remove("hidden"):document.querySelector(""+d).nextElementSibling.classList.contains("accordion-content")&&document.querySelector(""+d).nextElementSibling.classList.remove("hidden"))}catch(f){console.log("Error selecting element with hash value")}}0<b.length&&b.forEach(function(f){f.addEventListener("click",function(){var k=f.getAttribute("aria-expanded"),h=this.nextElementSibling;f.closest(".accordion-box").querySelector(".accordion-content").classList.toggle("hidden");
"true"==k?(f.setAttribute("aria-expanded","false"),f.closest(".accordion-box")&&f.closest(".accordion-box").querySelector(".accordion-content")&&(h.style.maxHeight="0")):(f.setAttribute("aria-expanded","true"),f.closest(".accordion-box")&&f.closest(".accordion-box").querySelector(".accordion-content")&&(h.style.maxHeight=h.scrollHeight+"px"));f.querySelectorAll("svg").forEach(function(l){l.classList.toggle("hidden")})})});0<c.length&&c.forEach(function(f){null==f.closest(".product-banner")&&250<f.querySelector(".accordion-content").clientHeight&&
f.querySelector(".accordion-content .accordianText-content")&&(f.querySelector(".accordion-content .accordianText-content").style.height="250px",f.querySelector(".accordion-content").insertAdjacentHTML("beforeend",'\x3csection class\x3d"accordianText-trigger accordianText-trigger-jquery relative w-full border-b border-grey flex items-center justify-center"\x3e\x3ci class\x3d"accordianText-down-arrow"\x3e\x3c/i\x3e\x3cbutton aria-expanded\x3d"false" class\x3d"toggleMoreLess absolute -pin-t-10 text-center cursor-pointer -mt-3"\x3e\x3cimg alt\x3d""  class\x3d"more cursor-pointer w-12 h-12 z-1 relative" src\x3d"/content/dam/sandisk/en-us/portal-assets/icons/moreAccView.svg"\x3e\x3cimg alt\x3d""  class\x3d"hidden less cursor-pointer w-12 h-12 z-1 relative" src\x3d"/content/dam/sandisk/en-us/portal-assets/icons/lessAccView.svg"\x3e\x3ci class\x3d"absolute w-8 h-4 bg-white -ml-10 z-0 mt-4"\x3e\x3c/i\x3e\x3c/button\x3e\x3c/section\x3e'),
a())})});var isStartEventTriggered=!1;function getVimeoVideoData(){var a=document.querySelector(".analytics-Vimeo-Iframe");if(!a)return null;var b=a.getAttribute("src"),c=(new URL(b)).pathname.split("/").pop();a=a.getAttribute("title")||c;return{videoSource:b,videoId:c,videoTitle:a}}function triggerVimeoEvent(a){var b=getVimeoVideoData();if(b)try{var c=window.aa.createEvent(a,b);window.dispatchEvent(c)}catch(d){console.error("Error while triggering analytics "+a+" event",d)}}
function trackVimeoCompPlay(){triggerVimeoEvent("TRACK_VIMEO_PLAY")}function trackVimeoCompPause(){triggerVimeoEvent("TRACK_VIMEO_PAUSE")}function trackVimeoCompMute(){triggerVimeoEvent("TRACK_VIMEO_MUTE")}function trackVimeoCompUnmute(){triggerVimeoEvent("TRACK_VIMEO_UNMUTE")}function trackVimeoCompStart(){triggerVimeoEvent("TRACK_VIMEO_START")}function trackVimeoCompFirstQuartile(){triggerVimeoEvent("TRACK_VIMEO_FIRST_QUARTILE")}
function trackVimeoCompMidpoint(){triggerVimeoEvent("TRACK_VIMEO_MIDPOINT")}function trackVimeoCompThirdQuartile(){triggerVimeoEvent("TRACK_VIMEO_THIRD_QUARTILE")}function trackVimeoCompComplete(){triggerVimeoEvent("TRACK_VIMEO_COMPLETE")}
function addEventToVideo(){var a=document.querySelectorAll(".videoAnchorOverlay button.videoAnchorOverlayCTA");0<(null==a?void 0:a.length)&&a.forEach(function(b){b.addEventListener("click",function(c){var d=!0;c=b.getAttribute("data-videoRandom");var f=b.getAttribute("data-videoURL"),k=b.closest(".videoAnchorOverlay"),h=null;k&&k.querySelector(".damVideo")&&(d=!1,h=k.querySelector("video.damVideo"));if(d){if(k=k.querySelector("iframe"),d="",k&&k.getAttribute("title")&&(d=k.getAttribute("title")),
c&&f){k={};k.modalID=c;k.videoURL=f;var l;0<(null==(l=d)?void 0:l.length)&&(k.title=d);try{var p=window.aa.createEvent("VIDEO",k);window.dispatchEvent(p)}catch(t){console.log("Error while triggering analytics VIDEO event")}}}else if(!d&&h){var q={25:!1,50:!1,75:!1,100:!1};h.addEventListener("play",function(){try{h.getAttribute("title"),trackVimeoCompStart(),q={25:!1,50:!1,75:!1,100:!1}}catch(t){console.log("Error while creating event for analytics on play video"+t)}});h.addEventListener("pause",function(){try{h.getAttribute("title"),
trackVimeoCompPause()}catch(t){console.log("Error while creating event for analytics on play video"+t)}});h.addEventListener("timeupdate",function(){if(h.duration){var t=Math.ceil(h.currentTime/h.duration*100);25<=t&&!q[25]&&(q[25]=!0,trackVimeoCompFirstQuartile());50<=t&&!q[50]&&(q[50]=!0,trackVimeoCompMidpoint());75<=t&&!q[75]&&(q[75]=!0,trackVimeoCompThirdQuartile());98<=t&&!q[100]&&(q[100]=!0,trackVimeoCompComplete())}});h.addEventListener("ended",function(){q[100]||trackVimeoCompComplete()})}})});
a=document.querySelectorAll(".inlineVideo");0<(null==a?void 0:a.length)&&a.forEach(function(b){var c=b.querySelector("iframe");b=c.getAttribute("src");if(c&&b){c=c.getAttribute("title");var d={};d.title=0<(null==c?void 0:c.length)?c:"Video";d.videoURL=b;try{var f=window.aa.createEvent("VIDEO",d);window.dispatchEvent(f)}catch(k){console.log("Error while triggering analytics VIDEO event")}}});a=document.querySelectorAll(".sbgv-video-contain");0<(null==a?void 0:a.length)&&a.forEach(function(b){var c=
b.querySelector("button");c&&c.addEventListener("click",function(){if(c.classList.contains("sbgv-is-active"))try{var d=c.closest(".sbgv-video-contain"),f;d&&(f=d.querySelector("video"));f&&f.getAttribute("title");trackVimeoCompPause()}catch(l){console.log("Error while creating event for analytics on play video"+l)}else try{var k=c.closest(".sbgv-video-contain"),h;k&&(h=k.querySelector("video"));h&&h.getAttribute("title");trackVimeoCompPlay()}catch(l){console.log("Error while creating event for analytics on play video"+
l)}})})}
function initializeVideo(){for(var a=document.querySelectorAll(".click-video"),b={$jscomp$loop$prop$i$155$282:0};b.$jscomp$loop$prop$i$155$282<a.length;b={$jscomp$loop$prop$i$155$282:b.$jscomp$loop$prop$i$155$282},b.$jscomp$loop$prop$i$155$282++)try{a[b.$jscomp$loop$prop$i$155$282].addEventListener("click",function(d){return function(f){f=a[d.$jscomp$loop$prop$i$155$282].getAttribute("data-target");var k=a[d.$jscomp$loop$prop$i$155$282].closest(".parent-element").querySelector(f);k.classList.remove("hidden");k=
k.querySelector("iframe");var h=a[d.$jscomp$loop$prop$i$155$282].getAttribute("data-videosrc");k.setAttribute("src",h);a[d.$jscomp$loop$prop$i$155$282].closest("body").classList.add("overflow-hidden");k.classList.remove("hidden");k={};k.modalID=f;k.videoURL=a[d.$jscomp$loop$prop$i$155$282].closest(".parent-element").querySelector(f).querySelector("iframe").setAttribute("src",a[d.$jscomp$loop$prop$i$155$282].getAttribute("data-videosrc"));try{var l=window.aa.createEvent("VIDEO",k);window.dispatchEvent(l)}catch(p){console.log("Error while triggering analytics VIDEO event")}}}(b))}catch(d){console.log(d.message)}b=
document.querySelectorAll(".videoVanillamodule");for(var c=0;c<b.length;c++)b[c].addEventListener("click",function(d){d.target.closest(".wd-modal").classList.add("hidden");d.target.closest(".wd-modal").querySelector("iframe").setAttribute("src","");d.target.closest("body").classList.remove("overflow-hidden")});b=document.querySelectorAll(".videoVanilla");b.length&&b.forEach(function(d){d.addEventListener("click",function(){var f=d.getAttribute("data-videoRandom"),k=d.getAttribute("data-videoURL");
f="#".concat(f);WdOpenModal(f,k)})});applyVideoAspects()}function WdOpenModal(a,b){if(a&&b){try{({}).videoUrl=document.querySelector(a).querySelector("iframe").setAttribute("src",b),trackVimeoCompPlay()}catch(c){console.log("Error while creating event for analytics on play video"+c)}document.querySelector(a).querySelector("iframe").setAttribute("src",b);document.querySelector("body").classList.add("overflow-hidden");document.querySelector(a).classList.remove("hidden")}}
var globalModalVideoInstance=null;
function fnVimeoProgressBar(a,b){var c={25:!1,50:!1,75:!1,100:!1},d,f=null==(d=a.element)?void 0:d.getAttribute("data-autoplay");console.log(f);var k=!1;!k&&f&&(trackVimeoCompStart(),k=!0);try{a.off("timeupdate"),a.on("timeupdate",function(h){a.getDuration().then(function(l){l=Math.ceil(h.seconds/l*100);b&&(b.style.width=l+"%");25<=l&&!c[25]&&(c[25]=!0,trackVimeoCompFirstQuartile());50<=l&&!c[50]&&(c[50]=!0,trackVimeoCompMidpoint());75<=l&&!c[75]&&(c[75]=!0,trackVimeoCompThirdQuartile());98<l&&!c[100]&&
(c[100]=!0,trackVimeoCompComplete())})}),a.off("play"),a.on("play",function(){globalModalVideoInstance=a.element;k||f||(trackVimeoCompStart(),k=!0);a.off("timeupdate");a.on("timeupdate",function(h){a.getDuration().then(function(l){l=Math.ceil(h.seconds/l*100);b&&(b.style.width=l+"%");25<=l&&!c[25]&&(c[25]=!0,trackVimeoCompFirstQuartile());50<=l&&!c[50]&&(c[50]=!0,trackVimeoCompMidpoint());75<=l&&!c[75]&&(c[75]=!0,trackVimeoCompThirdQuartile());98<l&&!c[100]&&(c[100]=!0,trackVimeoCompComplete())})})}),
a.off("pause"),a.on("pause",function(){trackVimeoCompPause()}),a.off("ended"),a.on("ended",function(){c[100]||(c[100]=!0,trackVimeoCompComplete())})}catch(h){console.log(h)}}
function videoplaypause(a,b){var c=b.closest(".videoHtml"),d=c.querySelector(".sbgv_toggle_play"),f=c.querySelector(".sbgv_toggle_pause"),k=c.querySelector(".sbgv_toggle_mute"),h=c.querySelector(".sbgv_toggle_unmute"),l=c.querySelector("iframe");c.querySelector("#progress-bar");c=new Vimeo.Player(l.getAttribute("id"));data={};if("sbgv_toggle_play"==a){data={method:"play"};d.style.display="none";f.style.display="block";l.contentWindow.postMessage(JSON.stringify(data),"*");try{l.getAttribute("title"),
"true"!=b.getAttribute("aria-modalpausebtn")&&trackVimeoCompPlay()}catch(p){console.log("Error while creating event for analytics on play video"+p)}}else if("sbgv_toggle_pause"==a){data={method:"pause"};d.style.display="block";f.style.display="none";l.contentWindow.postMessage(JSON.stringify(data),"*");try{l.getAttribute("title"),"true"!=b.getAttribute("aria-modalplaybtn")&&trackVimeoCompPause()}catch(p){console.log("Error while creating event for analytics on play video"+p)}}"sbgv_toggle_mute"==
a?(k.style.display="none",h.style.display="block",c.setVolume(0),trackVimeoCompMute()):"sbgv_toggle_unmute"==a&&(a=document.querySelectorAll(".videoHtml.videoContainer iframe"),0<(null==a?void 0:a.length)&&(null==a||a.forEach(function(p){if(p){var q=p.querySelector(".sbgv_toggle_unmute"),t=p.querySelector(".sbgv_toggle_mute");(new Vimeo.Player(p.id)).setVolume(0);t&&(t.style.display="none");q&&(q.style.display="block")}})),h.style.display="none",k.style.display="block",c.setVolume(1),trackVimeoCompUnmute())}
function videofull(a,b){var c=b.closest(".videoHtml"),d=new Vimeo.Player(c.id);d.requestFullscreen().then(function(){console.log("Video is now in full screen");trackVimeoCompStart();c.setAttribute("data-fullscreen-start","true");var f=c.querySelector("#progress-bar");f&&fnVimeoProgressBar(d,f);document.addEventListener("fullscreenchange",function h(){if(!document.fullscreenElement){console.log("Video exited fullscreen");c.setAttribute("data-fullscreen-start","false");d.off("timeupdate");d.off("play");
d.off("pause");d.off("ended");var l=c.querySelector("#progress-bar");l&&fnVimeoProgressBar(d,l);document.removeEventListener("fullscreenchange",h)}})}).catch(function(f){console.log("Error trying to enter full screen: ",f)})}
function videorestart(a){var b=null==a?void 0:a.currentTarget.closest(".videoHtml").querySelector("iframe");a=null==a?void 0:a.currentTarget.closest(".videoHtml").querySelector(".sbgv_video_controls");var c=null==a?void 0:a.querySelector(".sbgv_toggle_play"),d=null==a?void 0:a.querySelector(".sbgv_toggle_pause"),f=new Vimeo.Player(b.id);f.setCurrentTime(0).then(function(){"none"===c.style.display&&(f.play(),c.style.display="none",d.style.display="block")}).catch(function(k){console.error("Error restarting the video:",
k)})}
document.addEventListener("DOMContentLoaded",function(){initializeVideo();addEventToVideo();var a=document.querySelectorAll(".hero-banner-modal-btn"),b=document.querySelectorAll(".wd-modal-video-close");a.forEach(function(c){c.addEventListener("click",function(d){d=document.querySelectorAll(".hero-banner-iframe-container");0<(null==d?void 0:d.length)&&d.forEach(function(f){var k=null==f?void 0:f.querySelector("iframe"),h=k.getAttribute("src");(new Vimeo.Player(k)).getPaused().then(function(l){!l&&k&&
h.includes("autoplay\x3d1")&&(data={method:"pause"},k.contentWindow.postMessage(JSON.stringify(data),"*"),f.querySelector(".sbgv_toggle_pause")&&"block"===f.querySelector(".sbgv_toggle_pause").style.display&&(f.querySelector(".sbgv_toggle_pause").style.display="none"),f.querySelector(".sbgv_toggle_play")&&"none"===f.querySelector(".sbgv_toggle_play").style.display&&(f.querySelector(".sbgv_toggle_play").style.display="block"))}).catch(function(l){console.error("Error checking playback state:",l)})})})});
b.forEach(function(c){c.addEventListener("click",function(d){d=c.closest(".hero-banner-modal");d.querySelector("iframe");var f=d.querySelector(".sbgv_toggle_play"),k=d.querySelector(".sbgv_toggle_pause"),h=d.querySelector(".sbgv_toggle_mute"),l=d.querySelector(".sbgv_toggle_unmute"),p;(null==(p=d.querySelector("iframe"))?0:p.getAttribute("data-autoplay"))?(f&&(f.style.display="none"),k&&(k.style.display="block")):(f&&(f.style.display="block"),k&&(k.style.display="none"));h&&(h.style.display="block");
l&&(l.style.display="none");p=document.querySelectorAll(".hero-banner-iframe-container");0<(null==p?void 0:p.length)&&p.forEach(function(q){var t=null==q?void 0:q.querySelector("iframe"),u=t.getAttribute("src");(new Vimeo.Player(t)).getPaused().then(function(C){C?t&&u.includes("autoplay\x3d1")&&(data={method:"play"},t.contentWindow.postMessage(JSON.stringify(data),"*"),q.querySelector(".sbgv_toggle_pause")&&"none"===q.querySelector(".sbgv_toggle_pause").style.display&&(q.querySelector(".sbgv_toggle_pause").style.display=
"block"),q.querySelector(".sbgv_toggle_play")&&"block"===q.querySelector(".sbgv_toggle_play").style.display&&(q.querySelector(".sbgv_toggle_play").style.display="none")):console.log("Video is playing")}).catch(function(C){console.error("Error checking playback state:",C)})})})})});window.addEventListener("resize",function(){applyVideoAspects()});
function initializeMobileVideoComponent(){if(1024>window.innerWidth){var a=document.querySelectorAll(".video-iframe");0<(null==a?void 0:a.length)&&a.forEach(function(b){var c=b.getAttribute("data-mobilePortraitVideoURL"),d=b.getAttribute("data-mobileLandscapeVideoURL"),f=isInLandscape();f&&d&&(b.src=d);!f&&c&&(b.src=c)})}else a=document.querySelectorAll(".video-iframe"),0<(null==a?void 0:a.length)&&a.forEach(function(b){var c=b.getAttribute("data-desktopVideoURL");0<(null==c?void 0:c.length)&&(b.src=
c)})}function applyVideoAspects(){var a=isInLandscape();1024>window.innerWidth&&(a?applyLandscapeVideoAspects():applyPortraitVideoAspects())}
function applyLandscapeVideoAspects(){var a=document.querySelectorAll(".dynamic-aspects"),b=document.querySelectorAll(".video-iframe");0<(null==a?void 0:a.length)&&a.forEach(function(c){c.classList.contains("aspect-4by5")&&(c.classList.remove("aspect-4by5"),c.classList.add("aspect-16by9"),initializeMobileVideoComponent())});0<(null==b?void 0:b.length)&&b.forEach(function(c){c.classList.contains("aspect-4by5")&&c.classList&&(c.classList.remove("aspect-4by5"),c.classList.add("aspect-16by9"))})}
function applyPortraitVideoAspects(){var a=document.querySelectorAll(".dynamic-aspects"),b=document.querySelectorAll(".video-iframe");0<(null==a?void 0:a.length)&&a.forEach(function(c){var d=c.querySelector("iframe").getAttribute("data-mobileportraitvideourl"),f=c.querySelector("iframe").getAttribute("data-desktopvideourl");c.classList.contains("aspect-16by9")&&d!=f&&(c.classList.remove("aspect-16by9"),c.classList.add("aspect-4by5"),initializeMobileVideoComponent())});0<(null==b?void 0:b.length)&&
b.forEach(function(c){var d=c.getAttribute("data-mobileportraitvideourl"),f=c.getAttribute("data-desktopvideourl");c.classList.contains("aspect-16by9")&&d!=f&&(c.classList.remove("aspect-16by9"),c.classList.add("aspect-4by5"))})}function isInLandscape(){return window.innerWidth>window.innerHeight?!0:!1}
document.addEventListener("DOMContentLoaded",function(){function a(p){return p&&0<p.trim().length?rewritePageURL(p):""}for(var b=document.querySelectorAll(".tableComp"),c=0;c<b.length;c++){var d=b[c].querySelectorAll(".table-images"),f=b[c].querySelectorAll(".table-icons");if(0<d.length){var k=b[c].querySelector("tr");k=k.children;for(f=0;f<k.length;f++){var h=d[f];if(h&&null!=h.dataset.authoredImageSrc){var l='\x3cpicture\x3e\x3csource srcset\x3d"'+h.dataset.authoredImageSrc+'.wdthumb.319.319.webp"           type\x3d"image/webp"\x3e\x3csource srcset\x3d"'+
h.dataset.authoredImageSrc+'.wdthumb.319.319.jpg" type\x3d"image/jpeg"\x3e\x3csource srcset\x3d"'+h.dataset.authoredImageSrc+'$.wdthumb.319.319.png" type\x3d"image/png"\x3e\x3cimg style\x3d"display: block" src\x3d"'+h.dataset.authoredImageSrc+'.thumb.319.319.png"\x3e\x3c/picture\x3e';l=null!=h.dataset.authoredImageHref?'\x3cdiv class\x3d"th-img-thumb"\x3e\x3ca href\x3d"'+a(h.dataset.authoredImageHref)+'" class\x3d"hover:underline"\x3e'+l+"\x3c/a\x3e\x3c/div\x3e":'\x3cdiv class\x3d"th-img-thumb"\x3e'+
l+"\x3c/div\x3e";k[f].insertAdjacentHTML("afterbegin",l)}}}else if(0<f.length)for(k=b[c].querySelector("tr"),k=k.children,d=0;d<k.length;d++)if(h=f[d])h=h.dataset.authoredIconsHref?'\x3ca href\x3d"'+a(h.dataset.authoredIconsHref)+'" class\x3d"hover:underline"\x3eNaN':h.dataset.authoredIconsSrc,k[d].insertAdjacentHTML("afterbegin",h)}});
var sbpMixins=[commerceService,StoreProductCart],StoreBundlePromotion=Vue.newInstance("bundlePromotion",{mixins:sbpMixins,data:{},methods:{addToCart:function(a){var b=this;a.preventDefault();a.stopPropagation();var c=a.currentTarget,d=document.querySelectorAll(".wd-modal")||"",f=JSON.parse(c.getAttribute("data-request-json")),k=document.querySelector(".cartwrapper");document.querySelector("#sticky-nav")&&768<window.screen.width&&this.scrollToTop(1E3);0<d.length&&d.forEach(function(l){l.classList.contains("cartwrapper")||
setTimeout(function(){l.classList.add("hidden")},200)});this.removeClass(k,"hidden");this.addClass(k,"updateCartData");this.addClass(k,"addToCartButton");d=k.querySelector(".cartShowInProgress");this.removeClass(d,"hidden");d=document.querySelector("#openCartModal");var h=null;d&&(h=d.querySelector(".wd-modal-close"));h&&!h.matches(":focus")&&setTimeout(function(){h.focus();document.body.classList.contains("disabledOutine")&&document.body.classList.remove("disabledOutine")},5E3);768>window.screen.width&&
this.scrollToTop(600);this.addMultipleProductToCart(f).then(function(l){b.sbp_commonLogger("returned from adding product to cart, now update cart");StoreProductCart[0].showMiniCart(a);c.getAttribute("data-already-click")?b.triggerAnalyticsBundleAddToCartEvent(f):(c.setAttribute("data-already-click","true"),b.checkAndtriggerBundleAnalyticsCartOpenEvent(f))})},triggerAnalyticsBundleAddToCartEvent:function(a){var b={},c=this.getSessionVariable(this.COMMERCE_CONSTANTS.CART_DETAILS);this.sbp_commonLogger("sessionCartDetails",
c);null!=c&&"undefined"!=typeof c.cartId&&(b.cartID=c.cartId,a&&a.cartEntries&&0<a.cartEntries.length&&(b.productQuantity=a.cartEntries[0].quantity));try{this.sbp_commonLogger("analytics ADD_TO_CART event data obj :",b);var d=window.aa.createEvent("ADD_TO_CART",b);window.dispatchEvent(d)}catch(f){console.log("Error while triggering analytics ADD_TO_CART event",f)}},checkAndtriggerBundleAnalyticsCartOpenEvent:function(a){var b={},c=this.getSessionVariable(this.COMMERCE_CONSTANTS.CART_DETAILS);this.sbp_commonLogger("sessionCartDetails",
c);try{var d="";if(a&&a.cartEntries&&0<a.cartEntries.length){var f=a.cartEntries[0];d=f.product.code;b.productQuantity=f.quantity}b.cartID=c.cartId;b.productName=[];b.productName.push(c.cartEntries[0].pageTitle);b.productSkuName=[];c.cartEntries.forEach(function(h){h.sku==d&&b.productSkuName.push(h.name)});b.productID=[];b.productID.push(c.cartEntries[0].pagePath.substring(c.cartEntries[0].pagePath.lastIndexOf("/")+1));b.productSkuID=[];b.productSkuID.push(d);b.productUnitPrice=[];b.productUnitPrice.push(c.cartEntries[0].prices.list.amount.toFixed(2).toString());
b.productSalePrice=[];b.productSalePrice.push(c.cartEntries[0].prices.sale.amount.toFixed(2).toString());b.productDiscount=[];b.productDiscount.push((c.cartEntries[0].prices.list.amount-c.cartEntries[0].prices.sale.amount).toFixed(2));this.sbp_commonLogger("analytics SC_FIRST event data obj :",b);var k=window.aa.createEvent("SC_FIRST",b);window.dispatchEvent(k)}catch(h){console.log("Error while triggering analytics SC_FIRST event",h)}},sbp_commonLogger:function(a,b){-1<window.location.search.indexOf("debugSBP\x3dtrue")&&
console.log(a,null!=b?b:"")}}});function initializeImgGallery(a,b){var c=new Splide(a.querySelector("#main-carousel"),{type:"fade",lazyload:"nearby",rewind:!0,pagination:!1,start:b,preloadPages:1,arrows:!0,perMove:1,heightRatio:.6});a=new Splide(a.querySelector("#thumbnail-carousel"),{start:b,fixedWidth:70,fixedHeight:70,pagination:!1,lazyload:"nearby",isNavigation:!0,perPage:4,gap:1,arrows:!1,breakpoints:{600:{fixedWidth:60,fixedHeight:44}}});c.sync(a);c.mount();a.mount()}
document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".store-carousel")&&document.querySelectorAll(".store-carousel").forEach(function(a){var b=a.dataset.pauseonhover,c=a.dataset.itemsperslide;(new Splide("#image-carousel",{arrows:!1,pagination:!0,autoplay:a.dataset.autorotate,speed:parseInt(a.dataset.autorotatespeed),perPage:parseInt(c),pauseOnHover:b})).mount()});document.querySelector(".img-gallery-anchor")&&document.querySelectorAll(".img-gallery-anchor").forEach(function(){(new Splide("#anchor-carousel",
{pagination:!1,lazyload:"nearby",isNavigation:!0,perPage:4,arrows:!1,breakpoints:{600:{fixedWidth:60,fixedHeight:44}}})).mount()})});var getThumbnailId;
document.querySelectorAll(".imageGallery .wd-modal-btn").forEach(function(a){a.addEventListener("click",function(b){var c=a.closest(".imageGallery"),d=a.getAttribute("data-target");getThumbnailId=a.getAttribute("id");var f=a.getAttribute("data-index"),k=c.querySelectorAll(d);d=c.querySelector(d);"viewAll"==f&&(f=0);0<k.length?(d.classList.remove("hidden"),d.classList.add("flex"),setAttributes(d,{"aria-hidden":"false","aria-labelledby":getThumbnailId})):(c.querySelector(".wd-image-gallery").classList.remove("hidden"),
c.querySelector(".wd-image-gallery").classList.add("flex"),setAttributes(c.querySelector(".wd-image-gallery"),{"aria-hidden":"false","aria-labelledby":getThumbnailId}));document.querySelector("body").classList.add("overflow-hidden");b.preventDefault();initializeImgGallery(c,f)})});
document.querySelector(".image-gallery .modal-body .wd-modal-close")&&document.querySelectorAll(".image-gallery .modal-body .wd-modal-close").forEach(function(a){a.addEventListener("click",function(b){b.stopPropagation();b.target.closest(".wd-modal").classList.remove("flex");b.target.closest(".wd-modal").classList.add("hidden");setAttributes(b.target.closest(".wd-modal"),{"aria-hidden":"true"});document.querySelector("body").classList.remove("overflow-hidden")})});
function initializeFullImgGallery(a){(new Splide("#main-carousel",{type:"fade",lazyload:"nearby",rewind:!0,pagination:!1,start:a,preloadPages:1,arrows:!0,perMove:1})).mount();var b=document.querySelectorAll("#main-carousel .splide__list li").length;document.querySelectorAll("#main-carousel .totalCount").forEach(function(c){c.innerText=b})}
document.querySelectorAll(".full-img-gallery .wd-modal-btn").forEach(function(a){a.addEventListener("click",function(b){var c=a.closest(".full-img-gallery"),d=a.getAttribute("data-target"),f=a.getAttribute("id");c.querySelector(".wd-image-gallery").setAttribute("id",d.replace("#",""));d=a.getAttribute("data-index");c.querySelector(".wd-image-gallery").classList.remove("hidden");c.querySelector(".wd-image-gallery").classList.add("flex");setAttributes(c.querySelector(".wd-image-gallery"),{"aria-hidden":"false",
"aria-labelledby":f});document.querySelector("body").classList.add("overflow-hidden");b.preventDefault();initializeFullImgGallery(d)})});function setAttributes(a,b){for(var c in b)a.setAttribute(c,b[c])}
document.addEventListener("DOMContentLoaded",function(){var a=function(c){var d=document.querySelector(".georedirect");if(d){var f=d.querySelector("#disableGeoRedirectProperty").val(),k=d.querySelector("#defaultRedirectUrl").val(),h=d.querySelector("#isEditMode").val();if("true"!=f&&"true"!=h){f={};d=JSON.parse(d.querySelector("#geoRedirectObj").val());h="results"in d[0]?!0:!1;if("undefined"!=typeof d&&0==h)for(h=0;h<d.length;h++)f[d[h].country.toLowerCase()]=d[h].link;d=window.location.search?window.location.search:
"";h=window.location.hash?window.location.hash:"";f.hasOwnProperty(c.country.iso_code.toLowerCase())?f[c.country.iso_code.toLowerCase()].startsWith("http")?window.location.href=f[c.country.iso_code.toLowerCase()]+d+h:window.location.href=window.location.origin+f[c.country.iso_code.toLowerCase()]+d+h:"undefined"==typeof k&&c.country.iso_code||""==k||(k.startsWith("http")?window.location.href=k+d+h:window.location.href=window.location.origin+k+d+h)}}},b=function(c){console.log("geoip error - "+c)};
"undefined"!=typeof geoip2&&geoip2.country(a,b)});
var MultilingualStoreApp={el:"#store-default-view-vue",data:{listOfAvailableLocale:[],language:[],brandType:{},selectedBrandVal:"",selectedCountryVal:"",responsedata:"",localeTitle:{}},mounted:function(){var a=this;this.listOfAvailableLocale=[].concat($jscomp.arrayFromIterable(document.querySelectorAll(".mss-lang"))).map(function(h){return h.getAttribute("data-mss-lang-key").substring(0,5)});if(this.responsedata=document.querySelector(".responsedata")){this.language=this.responsedata.getAttribute("data-key").split(",").filter(function(h){if(-1<
a.listOfAvailableLocale.indexOf(h))return h});this.localeTitle=JSON.parse(this.responsedata.getAttribute("data-locale")).languagemapping;this.brandType=JSON.parse(this.responsedata.getAttribute("data-brand"));var b=window.location.pathname.replace(".html",""),c=new URLSearchParams(window.location.search);b=c.has("locale")?c.get("locale").trim():b.substring(b.indexOf(".")+1);var d=c="";if(-1<b.indexOf(".")){c=b.split(".")[0];d=b.split(".")[1];c&&this.brandType[c]&&(this.selectedBrandVal=c);var f=d&&
this.languageTitle(d)?this.checkLocaleInDependentLocaleMapping(d):this.checkLocaleInDependentLocaleMapping(this.responsedata.getAttribute("data-currentkey"))}else this.brandType[b]?(this.selectedBrandVal=b,f=this.checkLocaleInDependentLocaleMapping(this.responsedata.getAttribute("data-currentkey"))):f=this.languageTitle(b)?this.checkLocaleInDependentLocaleMapping(b):this.checkLocaleInDependentLocaleMapping(this.responsedata.getAttribute("data-currentkey"));this.language.forEach(function(h){h==f&&
(a.selectedCountryVal=f)});this.selectedCountryVal||(this.selectedCountryVal=this.language[0]);if(!this.selectedBrandVal)for(var k in this.brandType){this.selectedBrandVal=k;break}this.showSelectedContent()}},methods:{checkLocaleInDependentLocaleMapping:function(a){var b=a,c=this.responsedata.getAttribute("data-dependentLocaleMapping");null!=c&&""!=c&&c.split(",").forEach(function(d){-1<d.indexOf(a)&&(b=d.split(":")[1])});return b},countryChange:function(){this.showSelectedContent()},brandChange:function(){var a=
this;this.showSelectedContent();this.language=this.responsedata.getAttribute("data-key").split(",").filter(function(b){if(a.listOfAvailableLocale.includes(b)&&a.brandType[a.selectedBrandVal].children.includes(b))return b});this.language.includes(this.selectedCountryVal)||(this.selectedCountryVal=this.language[0])},showSelectedContent:function(){document.querySelectorAll("div.mss-lang").forEach(function(b){b.classList&&(b=b.classList,b.add("hidden"),b.remove("active"))});var a=document.querySelector("div[data-mss-lang-key\x3d'"+
this.selectedCountryVal+"-"+this.selectedBrandVal+"']");a&&a.classList&&(a=a.classList,a.remove("hidden"),a.add("active"))},languageTitle:function(a){for(var b=0;b<this.localeTitle.length;b++)if(this.localeTitle[b].locale===a)return this.localeTitle[b].text}}};Vue.newInstance("MultilingualStoreApp",MultilingualStoreApp);
document.addEventListener("DOMContentLoaded",function(){var a=[].concat($jscomp.arrayFromIterable(document.querySelectorAll(".mss-lang"))).map(function(t){return t.getAttribute("data-mss-lang-key").substring(0,5)}),b=document.querySelector(".responsedata");if(b){var c=b.getAttribute("data-key").split(",").filter(function(t){if(-1<a.indexOf(t))return t}),d=JSON.parse(b.getAttribute("data-locale")).languagemapping,f=function(t){for(var u=0;u<d.length;u++)if(d[u].locale===t)return d[u].text},k=document.getElementById("selectCountryList");
if(k){var h=function(){document.querySelectorAll("div.mss-lang").forEach(function(u){u=u.classList;u.add("hidden");u.remove("active")});var t=document.querySelector("div[data-mss-lang-key\x3d'"+k.value+"']").classList;t.remove("hidden");t.add("active")};c.forEach(function(t){return k.innerHTML+="\x3coption value\x3d"+t+"\x3e"+f(t)+"\x3c/option\x3e"});var l=window.location.pathname.replace(".html",""),p=new URLSearchParams(window.location.search);l=p.has("locale")?p.get("locale").trim():l.substring(l.indexOf(".")+
1);var q=l&&f(l)?l:b.getAttribute("data-currentkey");c.forEach(function(t){t==q&&(k.value=q)});k.value||(k.value=c[0]);h();k.addEventListener("change",function(){h()})}}});
var commonSupportApp=Vue.newInstance("common-support",{el:"#common-support-component",mixins:[commerceService],data:function(){return{deferredPromisesGetProductCategories:[],deferredPromisesGetProductPrice:[],getProductCategoriesCallInProgress:!1,selectedProductCategory:"select-productCategory",selectedProductName:"select-productName",supportProductNames:[],getProductNamesCallInProgress:!1,getProductListCallInProgress:!1,productNameMap:new Map,productListMap:new Map,commonSupportBasePath:document.getElementById("commonUtilLoad").getAttribute("data-oracleServiceCloudHost"),
supportProductCategories:null,supportProductList:null,deferredPromisesGetProductList:[],multipleProductsRedirectPath:"",emptyMultiProductResponse:!1,INVALIDATION_TIMEOUT:"supportInvalidationTimeout",PREFIX:"support_",EMPTY_JSON:"{}",serialNumber:"",noProductOrSerialNumSelected:!1,PRODUCT_CATEGORY:"productCategory",PRODUCT_NAME:"productName",PRODUCT_LIST:"productList",locale:document.getElementById("commonUtilLoad").getAttribute("data-locale"),country:document.getElementById("commonUtilLoad").getAttribute("data-country"),
language:document.getElementById("commonUtilLoad").getAttribute("data-language"),commonSupportView:""}},mounted:function(){this.commonSupportView=this.$refs.commonSupportView.dataset.commonsupportview;this.initializeSupportComp()},methods:{initializeSupportComp:function(){var a=this;if("default"==this.commonSupportView)this.cms_commonLogger("in commonSupportDefaultView watch..."),this.multipleProductsRedirectPath=this.$refs.multipleProductsRedirectPath.dataset.multipleproductsredirectpath,this.resetErrors(),
(this.supportProductCategories=this.getSupportSessionVariable(this.PRODUCT_CATEGORY))||this.getProductCategories(this.commonSupportBasePath+"?q\x3dproduct_catalog\x26interface\x3d"+this.getLocale().toLowerCase()).then(function(){a.supportProductCategories=a.getSupportSessionVariable(a.PRODUCT_CATEGORY);a.cms_commonLogger("supportProductCategories",a.supportProductCategories)}).catch(function(c){a.cms_commonLogger("Issue in getting product categories ",c)});else if("multi"==this.commonSupportView){this.cms_commonLogger("in commonSupportMultiProductView watch...");
this.resetErrors();var b=this.getURLParam(this.PRODUCT_NAME);this.supportProductList=this.getSupportSessionVariable(this.PRODUCT_LIST+"_"+b);null==this.supportProductList&&(this.cms_commonLogger("calling get support product list. . ."),this.getProductList(this.commonSupportBasePath+"?q\x3dproduct_list\x26lang\x3d"+this.getLocale().toLowerCase()+"\x26p_id\x3d"+b,b).then(function(){a.supportProductList=a.getSupportSessionVariable(a.PRODUCT_LIST+"_"+b);null==a.supportProductList&&(a.emptyMultiProductResponse=
!0)}).catch(function(c){a.cms_commonLogger("Issue in getting product list ",c)}))}},initialize:function(){var a=this;this.cms_commonLogger("in initialize...");return new Promise(function(b,c){c=a.getSupportSessionVariable(a.INVALIDATION_TIMEOUT);var d=(new Date).getTime();null===c?(a.cms_commonLogger("invalidationTimeout doesn't exist in session storage"),c=d+6E4*a.getInvalidationTimeout(),a.setSupportSessionVariable(a.INVALIDATION_TIMEOUT,c),a.cms_commonLogger("invalidationTimeout set as: "+c)):
(a.cms_commonLogger("invalidationTimeout exists in session storage"),a.cms_commonLogger("invalidationTimeout: "+c),a.cms_commonLogger("currentTimeInMilliseconds: "+d),c<d?(a.cms_commonLogger("out of session"),a.removeAllSupportSessionVariable(),a.cms_commonLogger("empty session storage")):a.cms_commonLogger("within session"));b()})},getProductCategories:function(a){var b=this;this.cms_commonLogger("in getProductCategories...");return new Promise(function(c,d){b.deferredPromisesGetProductCategories.push({resolve:c,
reject:d});b.getProductCategoriesCallInProgress?b.cms_commonLogger("get user call in progress"):(b.getProductCategoriesCallInProgress=!0,b.getProductCategoriesWS(a).then(function(){b.getProductCategoriesCallInProgress=!1;b.cms_commonLogger("resolve all deferred promises in getProductCategories: "+b.deferredPromisesGetProductCategories.length);for(var f=0;f<b.deferredPromisesGetProductCategories.length;f++)b.deferredPromisesGetProductCategories[f].resolve();b.deferredPromisesGetProductCategories=[]}).catch(function(f){b.getProductCategoriesCallInProgress=
!1;b.cms_commonLogger("reject all deferred promises in getProductCategories: "+deferredPromisesGetUser.length);for(var k=0;k<b.deferredPromisesGetProductCategories.length;k++)b.deferredPromisesGetProductCategories[k].reject(f);b.this.deferredPromisesGetProductCategories=[]}))})},getInvalidationTimeout:function(){this.cms_commonLogger("invalidationTimeout: 15");return 15},getProductCategoriesWS:function(a){var b=this;this.cms_commonLogger("in getProductCategoriesWS...");return new Promise(function(c,
d){b.initialize("from getProductCategoriesWS").then(function(){b.cms_commonLogger("calling get Product Category For Support");null==b.getSupportSessionVariable(b.PRODUCT_CATEGORY)?(b.cms_commonLogger("product categories not found in session"),fetch(a).then(function(f){return f.json()}).then(function(f){b.cms_commonLogger("product category response received");b.cms_commonLogger(f);f&&void 0==f.Error?(b.cms_commonLogger("product categories returned from service, storing in session."),b.setSupportSessionVariable(b.PRODUCT_CATEGORY,
f)):b.cms_commonLogger("product categories not returned from service.");c()}).catch(function(f){b.cms_commonLogger("failed to get Product Categories from service");b.cms_commonLogger(f);d("failed to get Product Categories from service")})):(b.cms_commonLogger("product categories found in session"),c())})})},populateProductName:function(){var a=this;this.cms_commonLogger("in populateProductName method");this.resetErrors();this.selectedProductName="select-productName";this.supportProductNames=this.getSupportSessionVariable(this.PRODUCT_NAME+
"_"+this.selectedProductCategory);this.cms_commonLogger("supportProductNames",this.supportProductNames);null==this.supportProductNames&&(this.cms_commonLogger("calling get support product names. . ."),this.getProductNames(this.commonSupportBasePath+"?q\x3dproduct_catalog\x26lang\x3d"+this.getLocale().toLowerCase()+"\x26p_id\x3d"+this.selectedProductCategory,this.selectedProductCategory).then(function(){a.supportProductNames=a.getSupportSessionVariable(a.PRODUCT_NAME+"_"+a.selectedProductCategory);
a.cms_commonLogger("supportProductNames",a.supportProductNames);null==a.supportProductNames&&(a.selectedProductName="select-productName",a.noProductOrSerialNumSelected=!0)},function(b){a.cms_commonLogger("Issue in getting product name ",b)}))},getProductNames:function(a,b){var c=this;this.cms_commonLogger("in getProductNames...");this.cms_commonLogger("inputProductCategoryId: "+b);var d=[];return new Promise(function(f,k){c.productNameMap.has(b)?(c.getProductNamesCallInProgress=!0,d=c.productNameMap.get(b),
d.push({resolve:f,reject:k})):(d=[],d.push({resolve:f,reject:k}),c.productNameMap.set(b,c.deferredPromisesGetProductNames),c.getProductNamesCallInProgress=!1,c.cms_commonLogger("is not there in map, then add it."));c.cms_commonLogger("objects in product price map",c.productNameMap);c.getProductNamesCallInProgress?c.cms_commonLogger("getProductNames call in progress"):(c.getProductNamesCallInProgress=!0,c.getProductNamesWS(a,b).then(function(){c.getProductNamesCallInProgress=!1;c.cms_commonLogger("resolve all deferred promises in getProductNames: "+
d.length);for(var h=0;h<d.length;h++)d[h].resolve();d=[]}).catch(function(h){c.getProductNamesCallInProgress=!1;c.cms_commonLogger("reject all deferred promises in getProductNames: "+deferredPromisesGetUser.length);for(var l=0;l<d.length;l++)d[l].reject(h);d=[]}))})},getProductNamesWS:function(a,b){var c=this;this.cms_commonLogger("in getProductNamesWS...");return new Promise(function(d,f){c.initialize("from getProductNamesWS").then(function(){c.cms_commonLogger("calling get Product Name For Support");
null==c.getSupportSessionVariable(c.PRODUCT_NAME+"_"+b)?(c.cms_commonLogger("product names not found in session"),fetch(a).then(function(k){c.cms_commonLogger("product name response received",k.data);if(k.headers.get("content-type").includes("application/json"))return k.json();throw Error("Get Product Name response object is not of type JSON");}).then(function(k){!k||"object"!==typeof k||"Error"in k?c.cms_commonLogger("product name not returned from service."):(c.cms_commonLogger("product names returned from service, storing in session."),
c.setSupportSessionVariable(c.PRODUCT_NAME+"_"+b,k));d()}).catch(function(k){c.createErrorObject(deferred,"failed to get Product name from service",k);f()})):(c.cms_commonLogger("product name found in session"),d())})})},getProductListAndRedirect:function(){var a=this;this.cms_commonLogger("in getProductListAndRedirect method");this.serialNumber&&0<=this.serialNumber.length?fetch(this.commonSupportBasePath+"?q\x3dproduct_search\x26lang\x3d"+this.getLocale().toLowerCase()+"\x26s_string\x3d"+this.serialNumber).then(function(b){a.cms_commonLogger("product search response received",
b);a.isResponseTypeJson(b)?b.json().then(function(c){c?(a.cms_commonLogger("product search returned from service, redirecting to support page."),window.location.href=c[0].p_link):(a.cms_commonLogger("product list not returned from service."),a.noProductOrSerialNumSelected=!0)}).catch(function(c){a.createErrorObject(b,"Failed to parse response object as JSON",null);a.noProductOrSerialNumSelected=!0;a.$forceUpdate()}):(a.createErrorObject(b,"Get Product Search response object is not of type JSON",null),
a.noProductOrSerialNumSelected=!0,a.$forceUpdate())}).catch(function(b){a.noProductOrSerialNumSelected=!0;a.$forceUpdate();a.createErrorObject(response,"Failed to get Product Search from service",b)}):"select-productCategory"!=this.selectedProductCategory&&"select-productName"!=this.selectedProductName?(this.getProductListWS(this.commonSupportBasePath+"?q\x3dproduct_list\x26lang\x3d"+this.getLocale().toLowerCase()+"\x26p_id\x3d"+this.selectedProductName,this.selectedProductName).then(function(){a.selectedProductName?
a.supportProductList=a.getSupportSessionVariable(a.PRODUCT_LIST+"_"+a.selectedProductName):a.noProductOrSerialNumSelected=!0}).catch(function(b){console.error("An error occurred while fetching the support product list:",b)}),null==this.supportProductList?(this.cms_commonLogger("calling get support product list. . ."),this.getProductListWS(this.commonSupportBasePath+"?q\x3dproduct_list\x26lang\x3d"+this.getLocale().toLowerCase()+"\x26p_id\x3d"+this.selectedProductName,this.selectedProductName).then(function(){null!=
a.getProductListWS&&a.supportProductList&&(a.cms_commonLogger("supportProductList"+a.supportProductList),a.supportProductList=a.getSupportSessionVariable(a.PRODUCT_LIST+"_"+a.selectedProductName),a.redirectToSupportProduct())}).catch(function(b){console.error("An error occurred while fetching the support product list:",b)})):this.supportProductList?this.redirectToSupportProduct():this.noProductOrSerialNumSelected=!0):(this.noProductOrSerialNumSelected=!0,this.cms_commonLogger("Inside getProductListAndRedirect "+
this.noProductOrSerialNumSelected))},redirectToSupportProduct:function(){if(!this.supportProductList||0===this.supportProductList.length)this.noProductOrSerialNumSelected=!0,this.cms_commonLogger("Inside reditrectSupport"+this.noProductOrSerialNumSelected);else if(1===this.supportProductList.length)window.location.href=this.supportProductList[0].p_link;else if(1<this.supportProductList.length&&null!=this.multipleProductsRedirectPath){var a=this.rewritePageURL(this.multipleProductsRedirectPath),b=
(new URLSearchParams({productName:this.selectedProductName})).toString();window.location.href=a+"?"+b}},getProductList:function(a,b){var c=this;this.cms_commonLogger("in getProductList...");this.cms_commonLogger("productNameId: "+b);if(this.productListMap.get(b))return this.cms_commonLogger("is already there in map, then add to promise"),new Promise(function(d){c.productListMap.get(b).push(d)});this.cms_commonLogger("is not there in map, then add it.");this.productListMap.set(b,[]);return new Promise(function(d){c.productListMap.get(b).push(d);
c.getProductListCallInProgress||(c.getProductListCallInProgress=!0,c.getProductListWS(a,b).then(function(){c.getProductListCallInProgress=!1;c.cms_commonLogger("resolve all deferred promises in getProductList: "+c.productListMap.get(b).length);var f=c.productListMap.get(b);c.productListMap.set(b,[]);for(var k=0;k<f.length;k++)f[k]()}).catch(function(f){c.getProductListCallInProgress=!1;c.cms_commonLogger("reject all deferred promises in getProductList: "+c.productListMap.get(b).length);c.productListMap.set(b,
[])}))})},getProductListWS:function(a,b){var c=this;this.cms_commonLogger("in getProductListWS...");this.cms_commonLogger("calling get Product List For Support");if(null==this.getSupportSessionVariable(this.PRODUCT_LIST+b)||this.selectedProductName)return this.cms_commonLogger("product list not found in session"),fetch(a).then(function(d){return d.json()}).then(function(d){c.setSupportSessionVariable(c.PRODUCT_LIST+"_"+b,d)}).catch(function(d){console.error(d)});this.cms_commonLogger("product list found in session");
return Promise.resolve()},getPrefix:function(){return this.PREFIX+this.getLocale().toLowerCase()+"_"},createErrorObject:function(a,b,c){var d={};d.status=c?c.status:-1;d.statusText=c?c.statusText:"this is not a service response error but custom processing error";d.responseText=b+(c?", serviceResponseText: "+c.responseText:"");if(a&&"function"===typeof a.reject)return a.reject(d),a.promise;console.warn("Deferred object does not have a 'reject' method")},getSupportSessionVariable:function(a){try{return a=
this.getPrefix()+a.trim(),null==sessionStorage.getItem(a)||""==sessionStorage.getItem(a)?null:JSON.parse(sessionStorage.getItem(a))}catch(b){return null}},setSupportSessionVariable:function(a,b){sessionStorage.setItem(this.getPrefix()+a.trim(),JSON.stringify(b))},removeSupportSessionVariable:function(a){sessionStorage.removeItem(a)},removeAllSupportSessionVariable:function(){this.cs_commonLogger("remove all support keys from session storage");for(var a=sessionStorage.length;a--;){var b=sessionStorage.key(a).trim();
0==b.indexOf(this.getPrefix())?(this.removeSupportSessionVariable(b),this.cs_commonLogger("remove key: "+b)):this.cs_commonLogger("keep key: "+b)}},resetErrors:function(){this.noProductOrSerialNumSelected=!1},dismissAlert:function(){this.noProductOrSerialNumSelected=!1},getLocale:function(){return this.isNotBlank(this.getDataLocale())?this.getDataLocale():this.getLanguage()+"-"+this.getCountry()},getDataLocale:function(){return this.locale},getCountry:function(){return this.country},getLanguage:function(){return this.language},
rewriteUrl:function(a){void 0!=a&&0<a.trim().length&&(a=this.rewritePageURL(a));return a},cms_commonLogger:function(a,b){-1<window.location.search.indexOf("debugCMS\x3dtrue")&&console.log("CMS : "+a,null!=b?b:"")}}}),supportSearchController=Vue.newInstance("supportSearchController",{el:"#support-search-component",mixins:[commerceService],data:{knowledgeBaseSearchResponse:{},currentSelectedCategory:"",knowledgeBaseResp:[],communityResp:[],productDocumentationResp:[],productDocumentationNumFound:0,
searchResp:[],currentPage:0,selectedDocType:[],searchParams:{},selectedFilters:"",searchKeyword:"",filterById:"\x26fq\x3did:*/content/dam/asset-library*",sortByDate:"\x26sort\x3ddocumentTypeDate%20desc",filterBySubDocumentType:"\x26fq\x3d-filterSubDocumentType:%22%22",commonSupportBasePath:"",isNotSearchResultPage:!0,commonSupportCommunitySearchBasePath:"",commonSupportCommunitySiteBasePath:"",commonSupportSandiskCommunitySearchBasePath:"",commonSupportSandiskCommunitySiteBasePath:"",searchResultEndPoint:"",
facetQueryEndPoint:"",lastModifiedIndicator:"",resultPagePath:"",row:"",kbResultSize:"",q:"",docTypeFilter:[],noData:!1,noKnowledgeBaseData:!1,noCommunitySearchData:!1,noProductDocumentationData:!1,emptySearch:!1,paginationObj:{},showPaginationDotsAtStart:!1,showPaginationDotsAtEnd:!0,paginationStartCounter:2,paginationEndCounter:4},mounted:function(){this.activateSearchSupportComponent()},methods:{activateSearchSupportComponent:function(){var a=this;this.isNotSearchResultPage=JSON.parse(this.$refs.isNotSearchResultPage.dataset.isnotsearchresultpage);
this.commonSupportCommunitySearchBasePath=this.$refs.commonSupportCommunitySearchBasePath.dataset.commonsupportcommunitysearchbasepath;this.commonSupportCommunitySiteBasePath=this.$refs.commonSupportCommunitySiteBasePath.dataset.commonsupportcommunitysitebasepath;this.commonSupportSandiskCommunitySearchBasePath=this.$refs.commonSupportSandiskCommunitySearchBasePath.dataset.commonsupportsandiskcommunitysearchbasepath;this.commonSupportSandiskCommunitySiteBasePath=this.$refs.commonSupportSandiskCommunitySiteBasePath.dataset.commonsupportsandiskcommunitysitebasepath;
this.searchResultEndPoint=this.$refs.searchResultEndPoint.dataset.searchresultendpoint;this.facetQueryEndPoint=this.$refs.facetQueryEndPoint.dataset.facetqueryendpoint;this.lastModifiedIndicator=this.$refs.lastModifiedIndicator.dataset.lastmodifiedindicator;this.resultPagePath=this.$refs.resultPagePath.dataset.resultpagepath;this.row=this.$refs.row.dataset.row;this.kbResultSize=this.$refs.kbResultSize.dataset.kbresultsize;this.commonSupportBasePath=this.getOracleServiceCloudHost();var b=new URLSearchParams(window.location.search);
b.has("q")&&(this.q=b.get("q"));setTimeout(function(){!a.q||void 0==a.isNotSearchResultPage&&a.isNotSearchResultPage?a.noData=!0:a.getResults()},1)},resetResponse:function(){this.knowledgeBaseResp=[];this.communityResp=[];this.productDocumentationResp=[];this.productDocumentationNumFound=0;this.searchResp=[];this.docTypeFilter=[];this.selectedDocType=[]},resetErrors:function(){this.noProductDocumentationData=this.noCommunitySearchData=this.noKnowledgeBaseData=this.noData=!1},rewritePageURLSupport:function(a){return void 0!=
a&&0<a.trim().length?this.rewritePageURL(a):a},isObject:function(a){return void 0!==a&&null!==a&&a.constructor==Object},submitQuery:function(a,b){a.preventDefault();b&&(this.q=b.replace(/<\/?[^>]+(>|$)/g,""));this.q&&(void 0==this.isNotSearchResultPage||this.isNotSearchResultPage?(a=window.location.origin+this.rewritePageURLSupport(this.resultPagePath)+"?q\x3d"+this.q,window.location.href=a):(void 0==this.q||""==this.q?(this.updateSearchQueryString(""),this.emptySearch=!0):this.updateSearchQueryString(this.q),
this.searchParams={},this.currentPage=0,this.getResults()))},getResults:function(){var a=this;this.resetResponse();this.resetErrors();this.row=this.row?parseInt(this.row):10;this.q&&Promise.all([this.updateKnowledgeBaseSearch(),this.updateCommunitySearch(),this.updateSandiskCommunitySearch(),this.getDocumentTypeFilter(),this.updateProductDocumentation("pageLoad")]).then(function(){a.updateResponseFromCombinedCall()})},updateKnowledgeBaseSearch:function(){var a=this;this.kbResultSize=this.kbResultSize&&
""!=this.kbResultSize?parseInt(this.kbResultSize):100;var b=this.commonSupportBasePath+"?q\x3danswer\x26lang\x3d"+this.getLocale().toLowerCase()+"\x26k_wds\x3d"+this.q+"\x26ans_count\x3d"+this.kbResultSize;return new Promise(function(c,d){fetch(b,{}).then(function(f){if(a.isResponseTypeJson(f))return f.json();a.support_commonLogger("knowledge base articles returned are not in json format.");a.noKnowledgeBaseData=!0;c()}).then(function(f){null!=f&&0<f.length&&void 0==f.Error?(a.support_commonLogger("knowledge base search returned data from service."),
a.knowledgeBaseResp=f):(a.support_commonLogger("knowledge base search did not return data from service."),a.noKnowledgeBaseData=!0);c()}).catch(function(f){a.support_commonLogger("failed to get data from knowledge base search",f);a.noKnowledgeBaseData=!0;c()})})},updateCommunitySearch:function(){var a=this,b=this.commonSupportCommunitySearchBasePath+"?term\x3d"+this.q+"\x26include_blurbs\x3dtrue";return new Promise(function(c,d){fetch(b,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}}).then(function(f){if(a.isResponseTypeJson(f))return f.json();
a.support_commonLogger("Get WD Community Search response object is not of type JSON",f);a.noCommunitySearchData=0==a.communityResp.length?!0:!1;c()}).then(function(f){f.posts&&0<f.posts.length&&void 0==f.Error?(a.support_commonLogger("Got WD Community search data."),f.posts.forEach(function(k){a.noCommunitySearchData=!1;var h={};h.description=k.blurb;f.topics.forEach(function(l){k.topic_id==l.id&&(h.title=l.fancy_title,h.link=a.commonSupportCommunitySiteBasePath+l.id,a.communityResp.push(h))})})):
(a.support_commonLogger("WD Community Search not returned from service."),a.noCommunitySearchData=0==a.communityResp.length?!0:!1);c()}).catch(function(f){a.support_commonLogger("failed to get data from community search",f);a.noCommunitySearchData=0==a.communityResp.length?!0:!1;c()})})},updateSandiskCommunitySearch:function(){var a=this,b=this.commonSupportSandiskCommunitySearchBasePath+"?term\x3d"+this.q+"\x26include_blurbs\x3dtrue";return new Promise(function(c,d){fetch(b,{method:"GET",headers:{"Content-Type":"application/json",
Accept:"application/json"}}).then(function(f){if(a.isResponseTypeJson(f))return f.json();a.support_commonLogger("Sandisk Community search response received",f);a.noCommunitySearchData=0==a.communityResp.length?!0:!1;c()}).then(function(f){f.posts&&0<f.posts.length&&void 0==f.Error?(a.support_commonLogger("Got Sandisk Community search response."),f.posts.forEach(function(k){a.noCommunitySearchData=!1;var h={};h.description=k.blurb;f.topics.forEach(function(l){k.topic_id==l.id&&(h.title=l.fancy_title,
h.link=a.commonSupportSandiskCommunitySiteBasePath+l.id,a.communityResp.push(h))})})):(a.support_commonLogger("Sandisk Community search response not returned from service."),a.noCommunitySearchData=0==a.communityResp.length?!0:!1);c()}).catch(function(f){a.support_commonLogger("failed to get data from Sandisk Community search",f);a.noCommunitySearchData=0==a.communityResp.length?!0:!1;c()})})},getSelectedFilters:function(a){this.support_commonLogger("in getSelectedFilters..");a="";for(var b in this.selectedDocType)this.selectedDocType[b]&&
(a=""!=a?a+"%20OR%20":"",a+="%22"+this.selectedDocType[b]+"%22");this.selectedFilters=""!=a?"\x26fq\x3dfilterSubDocumentType:("+a+")":"";this.searchParams.start=this.currentPage=0;this.updateProductDocumentation()},getDocumentTypeFilter:function(){var a=this;this.support_commonLogger("in getDocumentTypeFilter..");var b=this.createURLWithQueryString(this.facetQueryEndPoint)+"\x26facet.field\x3dfilterSubDocumentType";return new Promise(function(c,d){fetch(b,{method:"GET",headers:{Accept:"application/json",
"Content-Type":"application/json"}}).then(function(f){return f.json()}).then(function(f){f&&f.response&&f.response.numFound&&0<f.response.numFound&&(a.support_commonLogger("product Document Type Filter returned from service"),a.docTypeFilter=f.facet_counts.facet_fields.filterSubDocumentType);c()}).catch(function(f){a.support_commonLogger("Get Product Document Type Filter failed",f);c()})})},updateProductDocumentation:function(a){var b=this;this.support_commonLogger("in getSearchResults..");var c=
this.createURLWithQueryString(this.searchResultEndPoint)+this.sortByDate+this.filterBySubDocumentType;this.support_commonLogger("product documentation url: "+c);return new Promise(function(d,f){fetch(c,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(function(k){return k.json()}).then(function(k){k&&k.response&&k.response.numFound&&0<k.response.numFound?(b.support_commonLogger("product search returned from service, redirecting to support page."),b.productDocumentationResp=
k.response.docs,b.productDocumentationNumFound=k.response.numFound,"pageLoad"!=a&&b.updateResponseObject()):(b.support_commonLogger("product list not returned from service."),b.noProductDocumentationData=!0);d()}).catch(function(k){b.noProductDocumentationData=!0;b.support_commonLogger("Get Product Documentation Search failed",k);d()})})},updateResponseFromCombinedCall:function(){this.support_commonLogger("Inside updateResponseFromCombinedCall");0==this.knowledgeBaseResp.length&&0==this.communityResp.length&&
0==this.productDocumentationNumFound?this.noData=!0:(0==this.knowledgeBaseResp.length?(this.noKnowledgeBaseData=!0,this.currentSelectedCategory="productDocumentation"):this.currentSelectedCategory="knowledgeBase",0==this.knowledgeBaseResp.length&&0==this.productDocumentationNumFound&&(this.currentSelectedCategory="community"),0==this.productDocumentationNumFound&&(this.noProductDocumentationData=!0),0==this.communityResp.length&&(this.noCommunitySearchData=!0));this.trackSupportSearch(this.q,this.knowledgeBaseResp.length+
this.productDocumentationNumFound+this.communityResp.length);this.$forceUpdate();this.updateResponseObject()},updateResponseObject:function(){this.searchResp=[];var a=0;if("knowledgeBase"==this.currentSelectedCategory)if(this.numFound=this.knowledgeBaseResp.length,a=0==this.knowledgeBaseResp.length/this.row%1?Math.floor(this.knowledgeBaseResp.length/this.row):Math.floor(this.knowledgeBaseResp.length/this.row)+1,this.currentPage<=a&&this.currentPage*this.row+this.row<this.numFound)for(var b=this.currentPage*
this.row;b<this.currentPage*this.row+this.row;b++)this.searchResp.push(this.knowledgeBaseResp[b]);else for(b=this.currentPage*this.row;b<this.numFound;b++)this.searchResp.push(this.knowledgeBaseResp[b]);else if("community"==this.currentSelectedCategory)if(this.numFound=this.communityResp.length,a=0==this.communityResp.length/this.row%1?Math.floor(this.communityResp.length/this.row):Math.floor(this.communityResp.length/this.row)+1,this.currentPage<=a&&this.currentPage*this.row+this.row<this.numFound)for(b=
this.currentPage*this.row;b<this.currentPage*this.row+this.row;b++)this.searchResp.push(this.communityResp[b]);else for(b=this.currentPage*this.row;b<this.numFound;b++)this.searchResp.push(this.communityResp[b]);else"productDocumentation"==this.currentSelectedCategory&&(this.numFound=this.productDocumentationNumFound,a=0==this.productDocumentationNumFound/this.row%1?Math.floor(this.productDocumentationNumFound/this.row):Math.floor(this.productDocumentationNumFound/this.row)+1,this.searchResp=this.productDocumentationResp);
this.paginationObj.totalPages=a;this.updatePagination();this.$forceUpdate()},createURLWithQueryString:function(a){var b=a+(-1<a.indexOf("?")?"\x26":"?")+"q\x3d"+encodeURIComponent(void 0!=this.q&&""!=this.q?this.q:"*:*");this.searchParams.wt="json";for(key in this.searchParams)"[object Array]"===Object.prototype.toString.call(this.searchParams[key])?searchParams[key].forEach(function(c){b+="\x26"+key+"\x3d"+c}):b+="\x26"+key+"\x3d"+this.searchParams[key];return b+this.selectedFilters+this.filterById},
updateSearchQueryString:function(a){if("URLSearchParams"in window){var b=new URLSearchParams(window.location.search);b.set("q",a);history.pushState(null,"",window.location.pathname+"?"+b.toString())}},changeCategory:function(a){this.currentPage=0;this.currentSelectedCategory=a;this.searchParams.rows=this.row;this.searchParams.start=this.currentPage*this.row;"productDocumentation"==this.currentSelectedCategory?this.updateProductDocumentation():this.updateResponseObject()},getDateObj:function(a){return this.getFormattedDate(new Date(a),
"MMM DD, yyyy")},checkIfAssetIsNew:function(a){var b=parseInt(this.lastModifiedIndicator);b=new Date((new Date).getTime()-864E5*b);return(new Date(a)).getTime()>b.getTime()},openProductFilterMobile:function(){document.querySelector(".filter-overlay").style.display="";this.addClass(document.querySelector("body"),"overflow-hidden");this.removeClass(document.querySelector(".left-filter"),"hidden");var a=window.innerHeight,b=Math.abs(document.querySelector(".fliter_header").offsetWidth),c=Math.abs(document.querySelector(".filter_btn_height").offsetWidth);
document.querySelector(".filterItemWrap").style.height=a-b-c},closeProductFilterMobile:function(){document.querySelector(".filter-overlay").removeAttribute("style");this.removeClass(document.querySelector("body"),"overflow-hidden");this.addClass(document.querySelector(".left-filter"),"hidden");document.querySelector(".filterItemWrap").removeAttribute("style")},getURL:function(a){return window.location.pathname+"?page\x3d"+(0==a?1:a)},gotoPage:function(a,b){a.preventDefault();scrollToSmoothly(0,500);
this.currentPage=b;this.searchParams.rows=this.row;this.searchParams.start=this.currentPage*this.row;"productDocumentation"==this.currentSelectedCategory?this.updateProductDocumentation():this.updateResponseObject()},nextPage:function(a){a.preventDefault();scrollToSmoothly(0,500);this.currentPage+=1;this.searchParams.rows=this.row;this.searchParams.start=this.currentPage*this.row;"productDocumentation"==this.currentSelectedCategory?this.updateProductDocumentation():this.updateResponseObject()},previousPage:function(a){a.preventDefault();
scrollToSmoothly(0,500);--this.currentPage;this.searchParams.rows=this.row;this.searchParams.start=this.currentPage*this.row;"productDocumentation"==this.currentSelectedCategory?this.updateProductDocumentation():this.updateResponseObject()},showPaginationDots:function(){5==this.paginationObj.totalPages?this.showPaginationDotsAtEnd=this.showPaginationDotsAtStart=!1:(this.showPaginationDotsAtStart=4<this.currentPage+1&&6!=this.paginationObj.totalPages?!0:!1,this.showPaginationDotsAtEnd=this.currentPage+
4>=this.paginationObj.totalPages?!1:!0)},updatePagination:function(){this.showPaginationDots();5==this.paginationObj.totalPages||4==this.paginationObj.totalPages?(this.paginationStartCounter=2,this.paginationEndCounter=4):4>this.currentPage+1&&this.currentPage+4!=this.paginationObj.totalPages?(this.paginationStartCounter=2,this.paginationEndCounter=4<this.paginationObj.totalPages?4:this.paginationObj.totalPages):4==this.currentPage+1&&this.currentPage+4!=this.paginationObj.totalPages?(this.paginationStartCounter=
2,this.paginationEndCounter=this.currentPage+1==this.paginationObj.totalPages?this.paginationObj.totalPages:5):4<this.currentPage+1&&this.currentPage+4!=this.paginationObj.totalPages&&this.currentPage+4<this.paginationObj.totalPages?(this.paginationStartCounter=this.currentPage,this.paginationEndCounter=this.currentPage+2):4<this.currentPage+1&&this.currentPage+4==this.paginationObj.totalPages?(this.paginationStartCounter=this.currentPage,this.paginationEndCounter=this.paginationObj.totalPages-1):
this.currentPage+4>this.paginationObj.totalPages?(this.paginationStartCounter=this.paginationObj.totalPages-4,this.paginationEndCounter=this.paginationObj.totalPages-1):this.currentPage+4==this.paginationObj.totalPages&&(this.paginationStartCounter=2,this.paginationEndCounter=this.paginationObj.totalPages-1)},trackSupportSearch:function(a,b){var c={};c.q=a;c.searchTermsCount=b;c.filterBy=[];try{var d=window.aa.createEvent("SUPPORT_SEARCH",c);window.dispatchEvent(d)}catch(f){this.support_commonLogger("Error while triggering analytics Search event.")}},
support_commonLogger:function(a){-1<window.location.search.indexOf("debugSupportSearch\x3dtrue")&&console.log(a)},support_searchLogger:function(a,b){-1<window.location.search.indexOf("debugSupportSearch\x3dtrue")&&console.log(a,null!=b?b:"")}}}),ProductCompareTray={el:"#product-compare-tray",mixins:[compareTrayService],data:{},mounted:function(){window.location.href.includes("/product-compare")?this.attachMessageTrayReceiver():(this.attachTrayDataReceiver(),this.loadCompareTray())},methods:{attachTrayDataReceiver:function(){var a=
this;EventBus.$on("trayDataReceiver",function(b,c){"compareTrayArray"==c?a.compareTrayArray=b:"compareCount"==c?a.compareCount=b:"alertMessage"==c?a.alertMessage=b:"variantCategoryOptions"==c?a.variantCategoryOptions=b:"modalTitle"==c?a.modalTitle=b:"primaryImage"==c?a.primaryImage=b:"skuMapping"==c?a.skuMapping=b:"comparePageLink"==c&&(a.comparePageLink=b);a.$forceUpdate()})},attachMessageTrayReceiver:function(){var a=this;EventBus.$on("trayDataReceiver",function(b,c){"alertMessage"==c&&(a.alertMessage=
b);a.$forceUpdate()})}}};Vue.newInstance("ProductCompareTray",ProductCompareTray);
var resourceLibraryApp=Vue.newInstance("res-library",{el:"#res-library-component",mixins:[commerceService],data:function(){return{selectedDocType:{},selectedCategory:{},selectedIndustryType:{},searchParams:{},selectedFilters:"",filterById:"\x26fq\x3did:*/content/dam/asset-library*",sortByDate:"\x26sort\x3ddocumentTypeDate%20desc",filterBySubDocumentType:"\x26fq\x3d-filterSubDocumentType:%22%22",product:"",lastModifiedIndicator:document.getElementById("lastModifiedIndicator").getAttribute("lastModifiedIndicator"),tagTitleMap:[],
showTagsInfo:document.getElementById("showTagsInfo").getAttribute("showTagsInfo"),searchResultEndPoint:document.getElementById("searchResultEndPoint").getAttribute("searchResultEndPoint"),q:"",row:0,numFound:0,searchResults:[],loading:!0,numberOfPages:0,industryTypeFilter:[],docTypeFilter:[],categoryFilter:[],productFilter:[],queryproduct:"",showProductFilters:!1,selectedProductType:{},pageNumberSelected:1,tagTitle:"",domainInfo:document.getElementById("domainInfo").getAttribute("domainInfo"),productServiceUrl:document.getElementById("productServiceUrl").getAttribute("productServiceUrl"),
start:0,checkboxSelected:!1,searchKeyword:"",selectMostRecentCategory:!0,facetQueryEndPoint:document.getElementById("facetQueryEndPoint").getAttribute("facetQueryEndPoint"),paginationObj:{},showPaginationDotsAtStart:!1,showPaginationDotsAtEnd:!0,paginationStartCounter:2,paginationEndCounter:4,currentPage:0}},mounted:function(){this.facetQueryEndPointt()},methods:{facetQueryEndPointt:function(){var a=this;this.rl_commonLogger("in watch..");this.start=0;this.row=document.getElementById("rowl").getAttribute("row");
this.rl_commonLogger("row",this.row);new URLSearchParams(window.location.href);this.searchParams=new URLSearchParams(window.location.search);this.queryproduct=this.searchParams.get("product");void 0!==this.queryproduct&&""!==this.queryproduct&&null!==this.queryproduct?(this.product=this.queryproduct,this.rl_commonLogger("product: "+this.product),fetch(this.productServiceUrl).then(function(b){return b.json()}).then(function(b){a.tagTitleMap=b;a.rl_commonLogger("tagTitleMap",a.tagTitleMap);b=a.tagTitleMap.filter(function(c){return c.tagId.includes(a.product)});
a.tagTitle=b&&b[0]?b[0].title:"";a.rl_commonLogger("tagTitle: "+a.tagTitle);a.$set(a.selectedProductType,a.tagTitle,!0);a.getCategoryFilter();a.getDocumentTypeFilter();a.getIndustryFilter();a.getSelectedFilters()}).catch(function(b){console.error("Response error",b);return!0})):(this.getSearchResults(),this.getCategoryFilter(),this.getProductFilter(),this.getDocumentTypeFilter(),this.getIndustryFilter())},createURLWithQueryString:function(a){var b=this;if("string"!==typeof a)throw Error("url must be a string");
a+=a.includes("?")?"\x26":"?";this.searchParams={q:void 0!==this.q&&""!==this.q?this.q:"*:*",wt:"json",rows:this.row,start:this.start};var c=Object.keys(this.searchParams).map(function(d){return Array.isArray(b.searchParams[d])?b.searchParams[d].map(function(f){return d+"\x3d"+encodeURIComponent(f)}).join("\x26"):d+"\x3d"+encodeURIComponent(b.searchParams[d])}).join("\x26");return a+c+this.selectedFilters+this.filterById},getSearchResults:function(){var a=this;this.rl_commonLogger("in getSearchResults..");
var b=this.createURLWithQueryString(this.searchResultEndPoint)+this.sortByDate+this.filterBySubDocumentType;this.rl_commonLogger("url: "+b);fetch(b).then(function(c){return c.json()}).then(function(c){a.numFound=c.response.numFound;a.searchResults=c.response.docs;a.numberOfPages=Math.ceil(a.numFound/a.row);a.paginationObj.totalPages=a.numberOfPages;a.updatePagination()}).catch(function(c){a.rl_commonLogger("error:",c)})},getCategoryFilter:function(){var a=this;this.rl_commonLogger("in getCategoryFilter..");
var b=this.createURLWithQueryString(this.facetQueryEndPoint)+"\x26facet.field\x3dfilterProductCategoryType";fetch(b).then(function(c){if(!c.ok)throw Error("Network response was not ok");return c.json()}).then(function(c){a.categoryFilter=c.facet_counts.facet_fields.filterProductCategoryType}).catch(function(c){console.error("Error fetching category filter:",c)})},getProductFilter:function(){var a=this;this.rl_commonLogger("in getProductFilter..");var b=this.createURLWithQueryString(this.facetQueryEndPoint)+
"\x26facet.field\x3dfilterProductType";fetch(b).then(function(c){return c.json()}).then(function(c){a.productFilter=c.facet_counts.facet_fields.filterProductType;a.loading=!1}).catch(function(c){console.error(c);a.error="Failed to fetch product filter";a.loading=!1})},getDocumentTypeFilter:function(){var a=this;this.rl_commonLogger("in getDocumentTypeFilter..");var b=this.createURLWithQueryString(this.facetQueryEndPoint)+"\x26facet.field\x3dfilterSubDocumentType";fetch(b).then(function(c){return c.json()}).then(function(c){a.docTypeFilter=
c.facet_counts.facet_fields.filterSubDocumentType;a.loading=!1}).catch(function(c){console.error(c);a.error="Failed to fetch document type filter";a.loading=!1})},getIndustryFilter:function(){var a=this;this.rl_commonLogger("in getIndustryFilter..");var b=this.createURLWithQueryString(this.facetQueryEndPoint)+"\x26facet.field\x3dfilterIndustryType";fetch(b).then(function(c){return c.json()}).then(function(c){a.industryTypeFilter=c.facet_counts.facet_fields.filterIndustryType;a.loading=!1}).catch(function(c){console.error(c);
a.error="Error fetching industry filter";a.loading=!1})},getSelectedFilters:function(a){this.resetPageNumberSelected();this.rl_commonLogger("in getSelectedFilters..");this.showProductFilters=!1;this.selectMostRecentCategory=!0;a="";for(var b in this.selectedDocType)this.selectedDocType[b]&&(a=""!==a?a+"%20OR%20":"",a+="%22"+b+"%22");a=""!==a?"\x26fq\x3dfilterSubDocumentType:("+a+")":"";b="";for(var c in this.selectedCategory)this.selectedCategory[c]&&(b=""!==b?b+"%20OR%20":"",b+="%22"+c+"%22",this.showProductFilters=
!0,this.selectMostRecentCategory=!1,this.rl_commonLogger("selectedCategory",this.selectedCategory));b=""!==b?"\x26fq\x3dfilterProductCategoryType:("+b+")":"";c="";for(var d in this.selectedIndustryType)this.selectedIndustryType[d]&&(c=""!==c?c+"%20OR%20":"",c+="%22"+d+"%22"),c=""!==c?"\x26fq\x3dfilterIndustryType:("+c+")":"";d="";if(this.showProductFilters||this.product){for(var f in this.selectedProductType)this.selectedProductType[f]&&(d=""!==d?d+"%20OR%20":"",d+="%22"+f+"%22",this.showProductFilters=
!0);d=""!==d?"\x26fq\x3dfilterProductType:("+d+")":""}else this.selectedProductType={};this.rl_commonLogger("productFacetURL: "+d);""===d&&(new URLSearchParams(window.location.href),this.searchParams=new URLSearchParams(window.location.search),this.queryproduct=this.searchParams.get("product"))&&(this.queryproduct=null);this.selectedFilters=a+c+b+d;this.searchParams.start=this.start;this.getSearchResults();this.getProductFilter();this.currentPage=0;this.gotoPage(event,0)},showSelectedFiltersAsTags:function(){return""!==
this.selectedFilters||""!==this.searchKeyword},removeFilter:function(a){a in this.selectedCategory?(Vue.delete(this.selectedCategory,a),this.getSelectedFilters()):a in this.selectedProductType?(Vue.delete(this.selectedProductType,a),this.getSelectedFilters()):a in this.selectedDocType?(Vue.delete(this.selectedDocType,a),this.getSelectedFilters()):a in this.selectedIndustryType&&(Vue.delete(this.selectedIndustryType,a),this.getSelectedFilters())},openProductFilterMobile:function(){this.addClass(document.querySelector("body"),
"overflow-hidden");this.removeClass(document.querySelector(".left-filter"),"hidden")},closeProductFilterMobile:function(){this.removeClass(document.querySelector("body"),"overflow-hidden");this.addClass(document.querySelector(".left-filter"),"hidden")},submitQuery:function(a){a.preventDefault();this.searchKeyword=void 0===this.q||""===this.q?"":this.q;this.start=0;this.searchParams={};this.selectedDocType={};this.selectedCategory={};this.selectedIndustryType={};this.selectedProductType={};this.selectedFilters=
"";this.selectMostRecentCategory=!0;this.showProductFilters=!1;this.getSearchResults();this.getCategoryFilter();this.getDocumentTypeFilter();this.getIndustryFilter();this.currentPage=0;this.gotoPage(a,0)},checkIfAssetIsNew:function(a){var b=parseInt(this.lastModifiedIndicator);b=new Date((new Date).getTime()-864E5*b);return this.getDateObj(a)>b.getTime()},getDateObj:function(a){return new Date(a)},getDateObject:function(a){return(new Date(a)).toLocaleDateString("en-US",{month:"short",day:"numeric",
year:"numeric"})},getTagsInfoAfterFormatting:function(a){if(a){a=a.split(",");for(var b="",c=0;c<a.length;c++)if(""!==a[c]&&1<a[c].split("~").length){var d=a[c].split("~")[0];this.tagTitle=a[c].split("~")[1];if(d.startsWith("language:")||d.startsWith("studio:document-type"))b+=this.tagTitle+", "}return b.substring(0,b.length-2)}},resetPageNumberSelected:function(){this.start=0;this.pageNumberSelected=1;this.currentPage=0},getURL:function(a){return window.location.pathname+"?page\x3d"+(0==a?1:a)},
showPaginationDots:function(){5==this.paginationObj.totalPages?this.showPaginationDotsAtEnd=this.showPaginationDotsAtStart=!1:(this.showPaginationDotsAtStart=4<this.currentPage+1&&6!=this.paginationObj.totalPages?!0:!1,this.showPaginationDotsAtEnd=this.currentPage+4>=this.paginationObj.totalPages?!1:!0)},updatePagination:function(){this.showPaginationDots();5==this.paginationObj.totalPages||4==this.paginationObj.totalPages?(this.paginationStartCounter=2,this.paginationEndCounter=4):4>this.currentPage+
1&&this.currentPage+4!=this.paginationObj.totalPages?(this.paginationStartCounter=2,this.paginationEndCounter=4<this.paginationObj.totalPages?4:this.paginationObj.totalPages):4==this.currentPage+1&&this.currentPage+4!=this.paginationObj.totalPages?(this.paginationStartCounter=2,this.paginationEndCounter=this.currentPage+1==this.paginationObj.totalPages?this.paginationObj.totalPages:5):4<this.currentPage+1&&this.currentPage+4!=this.paginationObj.totalPages&&this.currentPage+4<this.paginationObj.totalPages?
(this.paginationStartCounter=this.currentPage,this.paginationEndCounter=this.currentPage+2):4<this.currentPage+1&&this.currentPage+4==this.paginationObj.totalPages?(this.paginationStartCounter=this.currentPage,this.paginationEndCounter=this.paginationObj.totalPages-1):this.currentPage+4>this.paginationObj.totalPages?(this.paginationStartCounter=this.paginationObj.totalPages-4,this.paginationEndCounter=this.paginationObj.totalPages-1):this.currentPage+4==this.paginationObj.totalPages&&(this.paginationStartCounter=
2,this.paginationEndCounter=this.paginationObj.totalPages-1)},gotoPage:function(a,b){a.preventDefault();scrollToSmoothly(0,500);this.pageNumberSelected=this.currentPage=b+1;this.searchParams.rows=this.row;this.start=(this.pageNumberSelected-1)*this.row;this.searchParams.start=this.start;this.getSearchResults();this.currentPage=b},previousPage:function(a){a.preventDefault();scrollToSmoothly(0,500);0<this.start&&(this.start=0<this.start-this.row?this.start-this.row:0,this.searchParams.rows=this.row,
this.searchParams.start=this.start,this.getSearchResults(),this.pageNumberSelected=parseInt(this.pageNumberSelected)-1+"",this.currentPage=this.pageNumberSelected-1,this.updatePagination())},nextPage:function(a){a.preventDefault();scrollToSmoothly(0,500);+this.start+ +this.row<this.numFound&&(this.start=+this.start+ +this.row,this.searchParams.rows=this.row,this.searchParams.start=this.start,this.getSearchResults(),this.pageNumberSelected=parseInt(this.pageNumberSelected)+1+"",this.currentPage=this.pageNumberSelected-
1,this.updatePagination())},rl_commonLogger:function(a){-1<window.location.search.indexOf("debugCMS\x3dtrue")&&console.log(a)}}}),productCompatibilityApp=Vue.newInstance("prod-compat",{el:"#product-compatibility-component",mixins:[commerceService],data:function(){return{isPartner:!1,isWCMModeDisabled:!1,internalRedirectURL:"",categories:[],selectedCategory:"",allProducts:"all-products",selectedProduct:"",urlHasSelectors:"",selectors:"",compatibilityResults:[],excelData:[],productList:[],uniqueCategoriesArray:[],
filteredProductList:[],filteredIdentifierList:[],selectedCategoryList:[],productName:"",productDescription:"",showDropdownSection:!0,identifierList:[],compatibilityFound:[],productCompatibletested:"",productCompatibilityName:"",matchedProduct:"",matchedProducts:[]}},mounted:function(){this.init()},methods:{uniqueCategories:function(){var a=this,b=this.productList.map(function(c){return c["product-category"]});this.filteredProductList=[].concat($jscomp.arrayFromIterable(new Set(b)));this.identifierList=
this.productList.map(function(c){return{identifier:c["product-identifier"],name:c["product-name"],category:c["product-category"]}});this.filteredIdentifierList=[].concat($jscomp.arrayFromIterable(new Set(this.identifierList)));this.selectedCategory=document.getElementById("categories-dropdown").value;this.pc_commonLogger("cat"+this.selectedCategory);b=this.productList.filter(function(c){return c["product-category"]==a.selectedCategory}).map(function(c){return c["product-name"]});this.selectedCategoryList=
[].concat($jscomp.arrayFromIterable(new Set(b)));this.filteredProducts()},filteredProducts:function(){return"all-categories"==this.selectedCategory?this.filteredIdentifierList:this.filteredIdentifierList=this.selectedCategoryList},filteredCompatibleProduct:function(){return this.productList.filter(function(a){return a.partnerProductIdentifier==item.partnerProductIdentifier})},init:function(){var a=this,b=this.$refs.urlSelectors.dataset.urlselectors;b&&(this.urlHasSelectors=!0,this.selectors=b.split(","));
b=this.$refs.excelPath.dataset.excelpath;var c="";c=this.getPlatformCommerceURL()+b+".exceltojson.json";this.pc_commonLogger("ServletUrl"+c);this.isPartner="true"==this.$refs.isPartner.dataset.ispartner?!0:!1;fetch(c).then(function(d){return d.json()}).then(function(d){a.excelData=d;a.isPartner?(a.productList=a.excelData[1].data,a.partnerProductList=a.excelData[0].data):(a.productList=a.excelData[0].data,a.partnerProductList=a.excelData[1].data);a.uniqueCategories();a.pc_commonLogger(a.filteredProductList);
a.pc_commonLogger("Identifier List"+a.filteredIdentifierList);a.productCompatibility=a.excelData[2].data;a.productCompatibility.forEach(function(f){f.productIdentifier=f["product-identifier"];f.partnerProductIdentifier=f["partner-product-identifier"]});a.productList.forEach(function(f){f.partnerProductIdentifier=f["product-identifier"]});setTimeout(function(){a.urlHasSelectors&&(document.querySelector("#product-dropdown").value=a.selectors[0],a.onProductChange(),document.querySelector("#dropdown-section").classList.add("hidden"))},
500)})},selectedProductName:function(){var a=this;this.pc_commonLogger("Selected Product:",this.selectedProduct);var b=null;(b=this.productList.find(function(c){return c["product-identifier"]==a.selectedProduct}))?(this.productName=b["product-name"],this.productDescription=b["product-description"],this.pc_commonLogger("desc"+this.productDescription),this.pc_commonLogger("Product Name:",this.productName)):this.pc_commonLogger("Selected product not found in the partner product list.")},filteredCompatibility:function(){var a=
this;return this.isPartner?this.productCompatibility.filter(function(b){return b["partner-product-identifier"]==a.selectedProduct}):this.productCompatibility.filter(function(b){return b["product-identifier"]==a.selectedProduct})},filteredCompatibilityWithDetails:function(){var a=this;return this.isPartner?this.productCompatibility.filter(function(b){return b["partner-product-identifier"]==a.selectedProduct}).forEach(function(b){a.matchedProduct=a.partnerProductList.find(function(c){return c["product-identifier"]==
b["product-identifier"]});a.matchedProduct&&(a.matchedProduct["tested-by"]=b["tested-by"],a.matchedProducts.push({"product-identifier":b["product-identifier"],"tested-by":b["tested-by"],"product-name":a.matchedProduct["product-name"],"product-page-url":a.matchedProduct["product-page-url"]}))}):this.productCompatibility.filter(function(b){return b["product-identifier"]==a.selectedProduct}).forEach(function(b){a.matchedProduct=a.partnerProductList.find(function(c){return c["product-identifier"]==b["partner-product-identifier"]});
a.matchedProduct&&(a.matchedProduct["tested-by"]=b["tested-by"],a.matchedProducts.push({"product-identifier":b["product-identifier"],"tested-by":b["tested-by"],"product-name":a.matchedProduct["product-name"],"product-page-url":a.matchedProduct["product-page-url"]}))})},onCategoryChange:function(){var a=this;this.selectedCategory=document.getElementById("categories-dropdown").value;var b=this.identifierList.filter(function(c){return c.category==a.selectedCategory}).map(function(c){return{identifier:c.identifier,
name:c.name}});this.selectedCategoryList=[].concat($jscomp.arrayFromIterable(new Set(b)));this.filteredProducts();document.getElementById("compatible-list").style.display="none";document.getElementById("product-dropdown").value=this.allProducts},onProductChange:function(){this.showDropdownSection=!1;this.selectedProduct=document.getElementById("product-dropdown").value;this.filteredCompatibility();this.filteredCompatibilityWithDetails();this.selectedProductName();document.getElementById("compatible-list").style.display=
"block"},resetDefaultOptions:function(){this.showDropdownSection=!0;document.getElementById("compatible-list").style.display="none";this.matchedProducts=[]},downloadDoc:function(){document.title=document.querySelector(".compatibilityProductTitle").textContent;window.print()},pc_commonLogger:function(a,b){-1<window.location.search.indexOf("debugCMS\x3dtrue")&&console.log("PC : "+a,null!=b?b:"")}}}),StoreProductCardListingQueryApp={el:"#store-product-card-listing-component",mixins:[commerceService],
data:function(){return{productReferenceObject:[],productReferences:{},customPromotionInfo:{},customPromotions:{},isCatalogPurchasable:!1,hideBadge:"",totalProductsCount:0,customQuery:"",resultSize:4,filtersArray:[],productsArray:[],totalResults:0,currentQuery:":relevance",sortBySelection:"relevance",currentPage:0,userEmailId:"",loading:!1,observor:null,options:{type:Object,default:{root:null,threshold:"0"}},allProductsLoaded:!1}},mounted:function(){var a=this;this.loading=!0;this.isCatalogPurchasable=
this.getPurchasableCatalog();this.productReferences=this.getSessionVariable(this.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);this.customQuery=this.$refs.customQuery.dataset.customquery;this.resultSize=this.$refs.resultSize.dataset.resultsize?parseInt(this.$refs.resultSize.dataset.resultsize):this.resultSize;this.getPromotionsData();this.hideBadge=this.$refs.hideBadge.dataset.hidebadge;var b=Object.keys(this.$refs).filter(function(c){if(-1<c.indexOf("filteridvalue"))return c});this.productcard_commonLogger("filterKeys",
b);b.forEach(function(c){a.currentQuery+=":"+a.$refs[c].dataset.filteridvalue});this.getUserID();this.getProductsFromHybris()},updated:function(){var a=this;this.observor=new IntersectionObserver(function(b){a.handleIntersect(b[0])},this.options);this.observor.observe(this.$refs.trigger);initProductCardListingSplide(this.$el)},beforeDestroy:function(){this.observer.disconnect()},methods:{getPromotionsData:function(){var a=this,b=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.CUSTOM_PROMOTIONS);
b?this.customPromotions=b:this.getPromotionsJson().then(function(){var c=a.getSessionVariable(a.$data.COMMERCE_CONSTANTS.CUSTOM_PROMOTIONS);c&&(a.customPromotions=c)})},handleIntersect:function(a){a.isIntersecting&&!this.loading&&0<this.productReferenceObject.length&&(this.currentPage++,this.loading=!0,this.getProductsFromHybris())},getProductsFromHybris:function(){var a=this,b="pageSize\x3d"+this.resultSize+"\x26query\x3d"+this.currentQuery+"\x26customQuery\x3d"+this.customQuery+"\x26sort\x3d"+this.sortBySelection+
"\x26currentPage\x3d"+this.currentPage;b+=void 0!=this.userEmailId&&""!=this.userEmailId?"\x26customerId\x3d"+encodeURIComponent(this.userEmailId):"";this.productcard_commonLogger(b);this.getCategoryListing(b).then(function(c){a.productcard_commonLogger("getCategoryListing response: ",c);if(0==c.pagination.totalResults)a.allProductsLoaded=!0;else if(c.pagination.currentPage>=c.pagination.totalPages&&0==c.products.length)a.allProductsLoaded=!0;else{a.totalResults=c.pagination.totalResults;var d=-1;
(new Promise(function(f,k){c.products.forEach(function(h,l,p){h=c.products[l].code;p=c.products[l].listOfSkuId;a.productcard_commonLogger("productCode:: "+h+" skuList:: "+p);null==a.getSessionVariable(h)?a.getBaseProductInfoForCLP(h,p,c.products[l]).then(function(){d++;d===c.products.length-1&&f()}):(d++,d===c.products.length-1&&f())})})).then(function(){a.productsArray=c.products;a.productcard_commonLogger("productsArray : ",a.productsArray);for(var f=0;f<a.productsArray.length;f++)a.initializeProductDetails(a.productsArray[f].code,
"",f);(new Promise(function(k,h){null==a.productReferences?a.getProductReferences().then(function(){k()}):k()})).then(function(){a.productReferences=a.getSessionVariable(a.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);a.loading=!1})}).catch(function(f){console.log("Error in categoryProducts:")})}}).catch(function(){a.loading=!1})},initializeProductDetails:function(a,b,c){var d=this;if(this.productReferences&&(this.productReferences[a]||this.productReferences[b])){var f=""!=a&&void 0!=a?a:b;this.productReferences[f].skuid=
b;this.productReferenceObject.push(this.productReferences[f]);this.productcard_commonLogger("productReferenceObject: ",this.productReferenceObject);this.getProductPriceInfo(a,b,this.productReferenceObject.length-1);this.updateSkuImage(b,c);this.updateSkuTitle(b,c);this.updatePagePath(b,c);this.initCustomPromotionInfo(a,b,this.productReferenceObject.length-1)}else this.getProductReferences().then(function(){d.productReferences=d.getSessionVariable(d.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);if(d.productReferences&&
(d.productReferences[a]||d.productReferences[b])){var k=""!=a&&void 0!=a?a:b;d.productReferences[k].skuid=b;d.productReferenceObject.push(d.productReferences[k]);d.productcard_commonLogger("productReferenceObject: ",d.productReferenceObject);d.getProductPriceInfo(a,b,d.productReferenceObject.length-1);d.updateSkuImage(b,c);d.updateSkuTitle(b,c);d.updatePagePath(b,c);d.initCustomPromotionInfo(a,b,d.productReferenceObject.length-1)}})},updateSkuImage:function(a,b){null!=a&&""!=a&&null!=this.productReferences[a].urlFileReference&&
""!=this.productReferences[a].urlFileReference&&(this.productReferenceObject[b].urlFileReference=this.productReferences[a].urlFileReference)},updateSkuTitle:function(a,b){null!=a&&""!=a&&null!=this.productReferences[a].variantTitle&&""!=this.productReferences[a].variantTitle&&(this.productReferenceObject[b].pageTitle=this.productReferences[a].variantTitle)},updatePagePath:function(a,b){null!=a&&""!=a&&null!=this.productReferences[a].pagePath&&""!=this.productReferences[a].pagePath&&(this.productReferenceObject[b].pagePath=
this.productReferences[a].pagePath)},getProductPriceInfo:function(a,b,c){var d=this;if(null!=b&&""!=b){var f=this.getSessionVariable(b);null==f||null==f.prices?this.getProductPrice(b).then(function(l){d.productcard_commonLogger("SKU Info found for: "+b+"response "+l);f=d.getSessionVariable(b);null!=f?d.productReferenceObject[c].minPricedSkuObj=f:d.productcard_commonLogger("SKU Code "+b+"not found in session.")}).catch(function(l){d.productcard_commonLogger("product card - Rejection from commerce service",
l)}):this.productReferenceObject[c].minPricedSkuObj=f}else{var k=this.getSessionVariable(a);if(null==k)this.getBaseProductInfo(a,this.productReferenceObject[c].skuList).then(function(){k=d.getSessionVariable(a);if(null!=k){var l=k.minPricedSKU;""!=l&&(l=d.getSessionProductPricingInfo(l),d.productReferenceObject[c].minPricedSkuObj=l)}else d.productcard_commonLogger("Product "+a+"not found in session.")}).catch(function(){d.productcard_commonLogger("error thrown while getting sessionBaseProductInfo :: ",
a)});else{var h=k.minPricedSKU;""!=h&&(h=this.getSessionProductPricingInfo(h),this.productReferenceObject[c].minPricedSkuObj=h)}}},getSessionProductPricingInfo:function(a){a=this.getSessionVariable(a);return null!=a?a:""},rewritePageUrl:function(a,b){void 0!=a&&0<a.trim().length&&(a=this.rewritePageURL(a),null!=b&&""!=b&&(a=a.concat("?sku\x3d"+b)));return a},initCustomPromotionInfo:function(a,b,c){var d=this;this.productcard_commonLogger("initCustomPromotionInfo");0<Object.keys(this.customPromotions).length?
this.settCustomPromotionInfo(a,b,c):this.getPromotionsJson().then(function(){var f=d.getSessionVariable(d.$data.COMMERCE_CONSTANTS.CUSTOM_PROMOTIONS);f&&(d.customPromotions=f,d.settCustomPromotionInfo(a,b,c))})},settCustomPromotionInfo:function(a,b,c){this.productcard_commonLogger("initCustomPromotionInfo");!a&&b&&this.productReferences[b]&&(a=this.productReferences[b].productId);if(this.productReferences[a]){b=this.productReferences[a].attBelowAddToCartButtonPromo;a=this.productReferences[a].attBelowResellerButtonPromo;
this.productReferenceObject[c].attBelowAddToCartButtonPromo=b;var d=[];a&&(d=a.split(","));void 0!=this.customPromotions&&void 0!=this.customPromotions[b]?this.productReferenceObject[c].cpJson=this.customPromotions[b]:void 0!=this.customPromotions&&d.length&&void 0!=this.customPromotions[d[0]]&&(this.productReferenceObject[c].cpJson=this.customPromotions[d[0]])}},attachEventsForModalAfterPrice:function(){var a=document.querySelector(".product-listing-v2"),b=!1;(new MutationObserver(function(c){b||
(initSiteRedesign(),b=!0)})).observe(a,{subtree:!0,childList:!0})},isB2BUser:function(){return this.getCustomerChannel()==this.COMMERCE_CONSTANTS.B2B?!0:!1},getUserID:function(){var a=this,b=this.getSessionVariable(this.COMMERCE_CONSTANTS.USER_DETAILS);this.isCatalogPurchasable?(this.productcard_commonLogger("getUserID : Catalog is Purchasable."),null==b?this.getUser().then(function(c){b=a.getSessionVariable(a.COMMERCE_CONSTANTS.USER_DETAILS);null==b||"undefined"==typeof b.uid?(a.productcard_commonLogger("getUserID : User is not logged in."),
a.userEmailId=""):(a.productcard_commonLogger("getUserID : user logged in."),a.userEmailId=b.uid)}).catch(function(c){a.productcard_commonLogger("getUserID : in error")}):(this.productcard_commonLogger("getUserID : user is logged in."),this.userEmailId=b.uid)):(this.productcard_commonLogger("getUserID : Catalog is not Purchasable."),this.userEmailId="")},productcard_commonLogger:function(a,b){-1<window.location.search.indexOf("debugCommerce\x3dtrue")&&console.log("Product Card Listing V2:"+a,null!=
b?b:"")}}};Vue.newInstance("StoreProductCardListingQueryApp",StoreProductCardListingQueryApp);
function initProductCardListingSplide(a){a.querySelectorAll(".heroBannerCarousel.splide").forEach(function(b){if(hasClass(b,"splide"))try{if(hasClass(b,"wd-product-listing-carousel")){var c=b.querySelector("ul.splide__list").childElementCount;plCarousel=new Splide(b,{preloadPages:1,perPage:4,wheel:!1,height:"auto",pagination:!1,arrows:4<c?!0:!1,type:"scroll",autoplay:!1,gap:16,direction:"rtl"===document.querySelector("html").getAttribute("dir")?"rtl":"ltr",dragMinThreshold:{mouse:4,touch:10},breakpoints:{2560:{perPage:4,
arrows:4<c?!0:!1,gap:16},1920:{perPage:4,arrows:4<c?!0:!1,gap:16},1464:{perPage:3,arrows:3<c?!0:!1,gap:16},992:{perPage:2,arrows:2<c?!0:!1,gap:16},768:{perPage:1,arrows:1<c?!0:!1},576:{perPage:1,arrows:1<c?!0:!1}}});var d=document.querySelector(".wd-product-listing-carousel .splide__list"),f=new MutationObserver(function(k){plCarousel.refresh();slidNavshow(b)});f.observe(d,{childList:!0});plCarousel.mount();slidNavshow(b);window.addEventListener("resize",function(k){slidNavshow(b)},!0);plCarousel.on("moved",
function(){slidNavshow(b)})}}catch(k){console.log("error while init carousel",k)}})}
function slidNavshow(a){a.querySelector(".splide__slider .splide__arrows")?(a.querySelector(".splide__slider ul.splide__list").classList.remove("justify-center"),a.getElementsByClassName("firstSlide")[0].classList.contains("is-visible")?(a.getElementsByClassName("splide__track")[0].classList.remove("leftSpace"),a.getElementsByClassName("splide__track")[0].classList.add("rightSpace")):a.getElementsByClassName("lastSlide")[0].classList.contains("is-visible")&&(a.getElementsByClassName("splide__track")[0].classList.remove("rightSpace"),
a.getElementsByClassName("splide__track")[0].classList.add("leftSpace"))):(a.getElementsByClassName("splide__track")[0].classList.remove("leftSpace"),a.getElementsByClassName("splide__track")[0].classList.remove("rightSpace"),a.querySelector(".splide__slider ul.splide__list").classList.add("justify-center"))}
if(null!=document.querySelector(".storeContentListImageDesc")){var storeContentListImageDesc=document.getElementsByClassName("storeContentListImageDesc");if(storeContentListImageDesc&&0<storeContentListImageDesc.length)for(i=0;i<storeContentListImageDesc.length;i++){var tempDiv=document.createElement("div");tempDiv.setAttribute("id","contentListTemporaryDiv");tempDiv.innerHTML=storeContentListImageDesc[i].getAttribute("data-desc");storeContentListImageDesc[i].innerHTML=tempDiv.innerHTML.substring(0,
200)+"...";storeContentListImageDesc[i].removeAttribute("data-desc");storeContentListImageDesc[i].removeAttribute("style")}}
var PredictiveSearchApp={el:"#searchSummaryView",mixins:[commerceService],data:{COMPARE_CONSTANTS:{Recent_Searches_COOKIE:"recentSearches"},products:[],allResults:[],categories:[],q:"",textLength:3,productsFound:0,recentSearchesArray:[],explore:[],support:[],supportFound:0,exploreMapArray:[],exploreFound:0,supportMapArray:[],featuredProducts:[],showGreyBar:!1,productReferences:{},showPopularSearches:!1,errorCodesArray:[],greyBarNotLoaded:!0},mounted:function(){var a=this;this.textLength=this.$refs.textLength.dataset.textlength;
(this.productReferences=this.getSessionVariable(this.COMMERCE_CONSTANTS.PRODUCT_REFERENCES))||this.getProductReferences().then(function(){a.productReferences=a.getSessionVariable(a.COMMERCE_CONSTANTS.PRODUCT_REFERENCES)});document.querySelector(".predictiveSearch").getAttribute("data-explore-mapping")&&(this.exploreMapArray=document.querySelector(".predictiveSearch").getAttribute("data-explore-mapping").split(","));document.querySelector(".predictiveSearch").getAttribute("data-support-mapping")&&
(this.supportMapArray=document.querySelector(".predictiveSearch").getAttribute("data-support-mapping").split(","));document.querySelector(".predictiveSearch").getAttribute("data-errorcodes")&&(this.errorCodesArray=document.querySelector(".predictiveSearch").getAttribute("data-errorcodes").split(","));document.addEventListener("keydown",function(b){"Enter"===b.key&&"predictiveSearchTerm"==b.target.id&&a.submitQuery(b,a.q)});window.addEventListener("click",function(b){b=b.target;if(b.classList.contains("predictive-search-class"))try{var c=
document.querySelector("#predictiveSearchTerm").value,d={};d.linkName=b.textContent;d.searchTerm=c?c:a.q;d.linkUrl=b.parentNode.href?b.parentNode.href:b.href;console.log(d);var f=window.aa.createEvent("INT_PREDICTIVE_SEARCH",d);window.dispatchEvent(f);a.search_commonLoggerObj("Predictive search details are submitted to analytics",d)}catch(k){a.search_commonLoggerObj("Error while firing Analytics call for Predictive search click",k)}})},methods:{showDefaultScreen:function(a){var b=this;this.greyBarNotLoaded&&
this.getGreyBar();a&&0===a.detail||document.querySelector(".predictive-search-result-form")&&document.querySelector(".predictive-search-result-form .search-collapse").click();this.q?this.submitQuery(a,this.q):setTimeout(function(){""==b.q&&(document.querySelector("#predictiveSearchContainer .skeleton-group").classList.remove("hidden"),b.defaultSuggestions())},2E3)},submitQuery:function(a,b){a.preventDefault();a.stopPropagation();b&&(this.q=b);if(this.q=this.q.trim()){this.addSearchTermToCookie(this.q);
b=this.getLocale().toLowerCase();a=document.getElementById("searchSummaryView").getAttribute("data-search-page");"en-us"!=b&&(a="/"+b+a);try{var c=document.querySelector("#predictiveSearchTerm").value;b={};b.linkName=this.q;b.searchTerm=c?c:this.q;b.linkUrl=a;var d=window.aa.createEvent("INT_PREDICTIVE_SEARCH",b);window.dispatchEvent(d);this.search_commonLoggerObj("Predictive search details are submitted to analytics",b)}catch(f){this.search_commonLoggerObj("Error while firing Analytics call for Predictive search click",
f)}this.q=this.q.replace(/<\/?[^>]+(>|$)/g,"");window.location.href=window.location.origin+this.rewritePageURLSupport(a)+"?q\x3d"+encodeURIComponent(this.q)}},rewritePageURLSupport:function(a){return void 0!=a&&0<a.trim().length?this.rewritePageURL(a):a},updateUrl:function(a,b){a.preventDefault();a.stopPropagation();if(this.q=this.q.trim()){this.addSearchTermToCookie(this.q);var c=this.getLocale().toLowerCase(),d=a.target.getAttribute("data-url");"en-us"!=c&&(d="/"+c+d);try{var f=document.querySelector("#predictiveSearchTerm").value;
c={};c.linkName=a.target.previousElementSibling.innerHTML+" View All";c.searchTerm=f?f:this.q;c.linkUrl=d;var k=window.aa.createEvent("INT_PREDICTIVE_SEARCH",c);window.dispatchEvent(k);this.search_commonLoggerObj("Predictive search details are submitted to analytics",c)}catch(h){this.search_commonLoggerObj("Error while firing Analytics call for Predictive search click",h)}this.q=this.q.replace(/<\/?[^>]+(>|$)/g,"");a="";b&&(a="\x26type\x3d"+b);window.location.href=d+"?q\x3d"+encodeURIComponent(this.q)+
a}},defaultSuggestions:function(){this.showRecentSeraches();this.showPopularSeraches();this.getFeaturedProducts()},productClicked:function(a){try{var b=document.querySelector(".search-product"+a),c=document.querySelector("#predictiveSearchTerm").value;a={};a.linkName=b.nextElementSibling.textContent.split("\n")[0];a.searchTerm=c?c:this.q;a.linkUrl=b.parentNode.href?b.parentNode.href:b.href;var d=window.aa.createEvent("INT_PREDICTIVE_SEARCH",a);window.dispatchEvent(d);this.search_commonLoggerObj("Predictive search details are submitted to analytics",
a)}catch(f){this.search_commonLoggerObj("Error while firing Analytics call for Predictive search click",f)}},getFieldsParams:function(){return document.getElementById("searchSummaryView").getAttribute("data-fields-params")},getFeaturedProducts:function(){var a=this,b=this.getServiceCommerceURL()+"/"+this.getCommerceServiceSite()+"/products/featured-products"+this.getFieldsParams()+this.getCommerceLang();this.search_commonLoggerObj("featuredEndPoint",b);fetch(b).then(function(c){if(c.ok)return c.json();
throw Error(c.status+"-"+c.statusText);}).then(function(c){if(c.hasOwnProperty("products")){c=c.products;a.featuredProducts=6<c.length?c.slice(0,6):c;a.showGreyBar=!0;c=window.location.href;var d="https://www-uat.sandisk.com/";if(c.includes("www.sandisk.com")||c.includes("author-p156201-e1699816.adobeaemcloud.com")||c.includes("preview.sandisk.com"))d="https://www.sandisk.com/";a.featuredProducts.forEach(function(f){f.pagePath&&(f.pagePath.includes("en-us")?f.pagePath=f.pagePath.replace("/content/sandisk/en-us/",
d):f.pagePath=f.pagePath.replace("/content/sandisk/",d))});a.getProductsMinPrice(a.featuredProducts,"code")}}).catch(function(c){a.search_commonLoggerObj("error: ",c);a.resetValues();a.allResults={};var d={event:"Featured products Hybris API call initiated"};d.reason="Failed to get Hybris response of Featured products - "+c;a.sendMailSearchError(d)})},sendMailSearchError:function(a){var b=this,c=!1,d=a.reason;this.errorCodesArray.forEach(function(l){if(d&&d.includes(l)){var p=b.getLocale().toLowerCase()+
"_"+l+"_search_error";Cookies.get(p)?(c=!1,console.log(p+" cookie exists so error mail not sent")):(c=!0,Cookies.set(p,JSON.stringify({errorCode:l}),{secure:!0,path:"/",expires:1}))}});if(c){var f=document.getElementById("searchSummaryView").getAttribute("data-emailSubject")+" - Stage",k=this.getPlatformCommerceURL();k.includes("www.sandisk.com")&&(f=document.getElementById("searchSummaryView").getAttribute("data-emailSubject")+" - Production");var h=new URLSearchParams(Object.entries({currentPagePath:window.location.href,
emailTemplatePath:document.getElementById("searchSummaryView").getAttribute("data-emailTemplatePath"),emailSubject:f,reason:a.reason,event:a.event,domain:k}));document.getElementById("searchSummaryView").getAttribute("data-emailTo").split(",").forEach(function(l){return h.append("emailTo",l)});fetch("/bin/sd/formemail",{credentials:"include",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:h}).then(function(l){if(l.ok)return b.isResponseJson(l)?l.json():l.text();throw Error(l.status+
"-"+l.statusText);}).then(function(l){console.log(l)}).catch(function(l){console.log("failed to send email: "+l)})}},isResponseJson:function(a){return(a=a.headers.get("content-type"))&&-1<a.indexOf("json")?!0:!1},getSessionProductPricingInfo:function(a){a=this.getSessionVariable(a);return null!=a?a:""},removeExtension:function(a){var b=window.location.href;if(b.includes("www.westerndigital.com")||b.includes("www-uat.sandisk.com")||b.includes("preview-shop.westerndigital.com")||b.includes("www.sandisk.com")||
b.includes("preview.sandisk.com"))a=a.split(".html")[0];return a},showPopularSeraches:function(){var a=this;if(document.querySelector(".predictiveSearch").getAttribute("data-popular-xf")){var b=document.querySelector(".predictiveSearch").getAttribute("data-popular-xf")+".html",c=document.querySelector("#commonUtilLoad").getAttribute("data-locale").toLowerCase();"en-us"!=c&&(b=b.split("/master.html")[0]+"/"+c+".html");b=this.removeExtension(b);fetch(b,{headers:{Accept:"text/html"}}).then(function(d){return d.text()}).then(function(d){d=
d.match(/<body[^>]*>([^]*)<\/body/m)[1];var f=document.createElement("div");f.innerHTML=d;d=f.getElementsByClassName("textcolumn");document.getElementById("popularSearches").innerHTML=d[0].innerHTML;a.showPopularSearches=!0;a.showGreyBar=!0;document.querySelector("#predictiveSearchContainer .skeleton-group").classList.add("hidden");document.querySelector(".searchHistoryView").classList.remove("hidden")}).catch(function(d){console.log(d)})}},getGreyBar:function(){var a=this;if(document.querySelector(".predictiveSearch").getAttribute("data-grey-xf")){var b=
document.querySelector(".predictiveSearch").getAttribute("data-grey-xf")+".html",c=document.querySelector("#commonUtilLoad").getAttribute("data-locale").toLowerCase();"en-us"!=c&&(b=b.split("/master.html")[0]+"/"+c+".html");b=this.removeExtension(b);fetch(b,{headers:{Accept:"text/html"}}).then(function(d){return d.text()}).then(function(d){d=d.match(/<body[^>]*>([^]*)<\/body/m)[1];var f=document.createElement("div");f.innerHTML=d;d=f.getElementsByClassName("textcolumn");document.getElementById("greyBar").innerHTML=
d[0].innerHTML;document.querySelector("#predictiveSearchContainer .skeleton-group").classList.add("hidden");document.querySelector(".searchHistoryView").classList.remove("hidden");a.greyBarNotLoaded=!1}).catch(function(d){a.greyBarNotLoaded=!1;console.log(d)})}},showRecentSeraches:function(){var a=this.getSearchesCookie();a&&(this.recentSearchesArray=JSON.parse(a).recentSearches,this.showGreyBar=!0,document.querySelector("#predictiveSearchContainer .skeleton-group").classList.add("hidden"),document.querySelector(".searchHistoryView").classList.remove("hidden"))},
addSearchTermToCookie:function(a){var b=this.getSearchesCookie();b?(b=JSON.parse(b).recentSearches,-1==b.indexOf(a)&&(5>b.length?b.unshift(a):(b.unshift(a),b.pop()),this.addItemtoCookie(b))):this.setSearchesCookie({recentSearches:[a]})},addItemtoCookie:function(a){this.setSearchesCookie({recentSearches:a})},getSearchesCookie:function(){return Cookies.get(this.getLocale().toLowerCase()+"_"+this.$data.COMPARE_CONSTANTS.Recent_Searches_COOKIE)},setSearchesCookie:function(a){Cookies.set(this.getLocale().toLowerCase()+
"_"+this.$data.COMPARE_CONSTANTS.Recent_Searches_COOKIE,JSON.stringify(a),{secure:!0,path:"/",expires:365})},clearRecentCookie:function(a){Cookies.remove(this.getLocale().toLowerCase()+"_"+this.$data.COMPARE_CONSTANTS.Recent_Searches_COOKIE);this.recentSearchesArray=[];a.stopPropagation()},resetValues:function(){this.products=[];this.explore=[];this.support=[];this.exploreFound=this.supportFound=0;this.showGreyBar=!1;this.categories=[];this.allResults={};this.featuredProducts=[];this.productsFound=
0;this.recentSearchesArray=[];this.showPopularSearches=!1;document.querySelector(".searchHistoryView").classList.add("hidden")},autoSuggest:function(){var a=this;if(this.q&&this.q.trim().length>=this.textLength){b&&clearTimeout(b);var b=this.q.trim();b=b.replace(/[+&&||!(){}[\]^"~*?:/]/g,"\\$\x26");document.querySelector("#predictiveSearchContainer .skeleton-group").classList.remove("hidden");var c=this.getDomain()+"tools/api/globalsearchgroups?q\x3d"+encodeURIComponent(b)+"\x26locale\x3d"+this.getLocale().toLowerCase()+
"\x26fl\x3did,url,productCategoryPagePath_s,productCategoryTitle_s,breadcrumbSubCategoryPagePath_s,breadcrumbSubCategoryTitle_s,title,primaryImage,baseProductId_s\x26groupBy\x3dgrpDocumentType\x26groupLimit\x3d10\x26documentType\x3dProducts,Support%20Products,Software%20Downloads,Knowledge%20Base,Community,documents\x26channel\x3d"+this.getCustomerChannel();b=setTimeout(function(){a.resetValues();fetch(c).then(function(d){if(d.ok)return d.json();throw Error(d.status+"-"+d.statusText);}).then(function(d){if(a.q&&
a.q.trim().length>=a.textLength&&d.grouped_docs){a.resetValues();a.allResults=d.grouped_docs;a.search_commonLoggerObj("allResults: ",a.allResults);var f=[];a.allResults.hasOwnProperty("Products")&&(a.products=a.allResults.Products.slice(0,4),a.getProductsMinPrice(a.products,"baseProductId_s"));a.exploreMapArray.forEach(function(h){a.allResults.hasOwnProperty(h)&&(f=f.concat(a.allResults[h]))});var k=[];a.products.forEach(function(h){if(h.hasOwnProperty("productCategoryPagePath_s")&&h.hasOwnProperty("productCategoryTitle_s")){var l=
{};l.url=h.productCategoryPagePath_s;l.title=h.productCategoryTitle_s;k.push(l)}h.hasOwnProperty("breadcrumbSubCategoryPagePath_s")&&h.hasOwnProperty("breadcrumbSubCategoryTitle_s")&&(l={},l.url=h.breadcrumbSubCategoryPagePath_s,l.title=h.breadcrumbSubCategoryTitle_s,k.push(l))});d=new Set(k.map(JSON.stringify));d=Array.from(d).map(JSON.parse);a.categories=5<d.length?d.slice(0,5):d;a.categories.forEach(function(h){h&&h.url&&(h.url.startsWith("/content/sandisk/en-us")?h.url=h.url.replace("/content/sandisk/en-us",
""):h.url=h.url.replace("/content/sandisk",""))});a.supportMapArray.forEach(function(h){a.allResults.hasOwnProperty(h)&&a.support.push(a.allResults[h][0])});f.sort(function(h,l){h=h.score;l=l.score;return h>l?-1:h<l?1:0});a.search_commonLoggerObj("exploreArray: ",f);5<f.length&&(f=f.slice(0,5));a.explore=f;a.search_commonLoggerObj("explore: ",a.explore);document.querySelector(".searchHistoryView").classList.add("hidden");document.querySelector("#predictiveSearchContainer .skeleton-group").classList.add("hidden")}else a.search_commonLoggerObj("No results"),
a.resetValues(),a.allResults={}}).catch(function(d){a.search_commonLoggerObj("error: ",d);document.querySelector("#predictiveSearchContainer .skeleton-group").classList.add("hidden");a.resetValues();a.allResults={};var f={event:"Predictive Search Solr API call initiated"};f.reason="Failed to get Solr response - "+d;a.sendMailSearchError(f)})},500)}else document.querySelector("#predictiveSearchContainer .skeleton-group").classList.add("hidden"),this.resetValues(),this.allResults={}},getProductsMinPrice:function(a,
b){var c=this;a.forEach(function(d){if(d.hasOwnProperty(b)){var f=d[b];c.search_commonLoggerObj("baseProductCode",b,f);var k=c.getSessionVariable(f);if(null==k)c.productReferences&&c.productReferences[f]?c.getBaseProductInfo(f,c.productReferences[f].skuList).then(function(){k=c.getSessionVariable(f);if(null!=k){var l=k.minPricedSKU;""!=l&&(l=c.getSessionProductPricingInfo(l),c.search_commonLoggerObj("sessionProductPricingInfo",l),d.minPricedSkuObj=l,c.$forceUpdate())}else c.search_commonLoggerObj("Product "+
f+" not found in session.")}).catch(function(l){console.error(l);c.search_commonLoggerObj("error thrown while getting sessionBaseProductInfo :: ",f)}):c.search_commonLoggerObj("Product "+f+" not found in session.");else{var h=k.minPricedSKU;""!=h&&(h=c.getSessionProductPricingInfo(h),d.minPricedSkuObj=h,c.$forceUpdate())}}})},search_commonLoggerObj:function(a,b){-1<window.location.search.indexOf("debugSearch\x3dtrue")&&console.log(a,null!=b?b:"")}}};Vue.newInstance("PredictiveSearchApp",PredictiveSearchApp);
var PredictiveDetailSearchApp={el:"#searchDetailView",mixins:[commerceService],data:{COMPARE_CONSTANTS:{Recent_Searches_COOKIE:"recentSearches"},isFacetedSearch:!1,searchResp:{},productdata:[],subDocumentType:{},allResults:[],row:10,start:0,numFound:0,aaTrack:!1,docTypeFacetURL:"",subDocTypeFacetURL:"",searchParams:{},emptySearch:!1,refreshSubDocTypeFacets:!0,subDocTypeAllResults:!0,lastSearchQ:"",q:"",jsonData:[],isNotSearchResultPage:!1,searchBaseUrl:"",autoSuggestUrl:"",resultPagePath:"",viewType:"",
otherLabel:"",facetQueryEndPoint:"",numOfResult:0,hideBadge:!0,loading:!1,searchRespDocs:[],isPagination:0,paginationObj:{},showPaginationDotsAtStart:!1,showPaginationDotsAtEnd:!0,paginationStartCounter:2,paginationEndCounter:4,filterBySubDocumentType:"\x26fq\x3d-filterSubDocumentType:%22%22",currentPage:0,showErrorMsg:!1,storeSearchResult:"",suggestTextTimeout:"",showAutoSuggestions:!0,products:[],suggestions:[],categories:[],textLength:3,productsFound:0,explore:[],support:[],supportFound:0,exploreMapArray:[],
exploreFound:0,supportMapArray:[],showGreyBar:!1,productReferences:{},showPopularSearches:!1,errorCodesArray:[]},mounted:function(){var a=this,b=this.$refs;this.isNotSearchResultPage=b.isNotSearchResultPage.dataset.isnotsearchresultpage;this.searchBaseUrl=b.searchBaseUrl.dataset.searchbaseurl;this.autoSuggestUrl=b.autoSuggestUrl.dataset.autosuggesturl;this.resultPagePath=b.resultPagePath.dataset.resultpagepath;this.viewType=b.viewType.dataset.viewtype;this.otherLabel=b.otherLabel.dataset.otherlabel;
this.facetQueryEndPoint=b.facetQueryEndPoint.dataset.facetqueryendpoint;this.hideBadge=b.hideBadge.dataset.hidebadge;this.initCustomPromotion(document.getElementById("custompromotionJson").getAttribute("data-custom-promotions-json-string"));var c=new URLSearchParams(location.search);c.has("q")&&c.get("q").trim()?(this.q=c.get("q").trim(),this.aaTrack=!0):document.getElementById("searchDetailView")&&(this.emptySearch=!0);this.attachSearchEvents();setTimeout(function(){!a.q&&!a.emptySearch||a.isNotSearchResultPage||
a.getResults()},0);document.querySelector("#hero-input-field")&&(c=c.get("q"),document.querySelector("#hero-input-field").value=c);this.textLength=b.textLength.dataset.textlength;(this.productReferences=this.getSessionVariable(this.COMMERCE_CONSTANTS.PRODUCT_REFERENCES))||this.getProductReferences().then(function(){a.productReferences=a.getSessionVariable(a.COMMERCE_CONSTANTS.PRODUCT_REFERENCES)});document.querySelector("#searchDetailView").getAttribute("data-explore-mapping")&&(this.exploreMapArray=
document.querySelector("#searchDetailView").getAttribute("data-explore-mapping").split(","));document.querySelector("#searchDetailView").getAttribute("data-support-mapping")&&(this.supportMapArray=document.querySelector("#searchDetailView").getAttribute("data-support-mapping").split(","));document.querySelector("#searchDetailView").getAttribute("data-errorcodes")&&(this.errorCodesArray=document.querySelector("#searchDetailView").getAttribute("data-errorcodes").split(","));window.addEventListener("click",
function(d){d=d.target;if(d.classList.contains("predictive-search-class1"))try{var f=document.querySelector("#hero-input-field").value,k={};k.linkName=d.textContent;k.searchTerm=f?f:a.q;k.linkUrl=d.parentNode.href?d.parentNode.href:d.href;var h=window.aa.createEvent("INT_PREDICTIVE_SEARCH",k);window.dispatchEvent(h);a.search_commonLoggerObj("Predictive search details are submitted to analytics",k)}catch(l){a.search_commonLoggerObj("Error while firing Analytics call for Predictive search click",l)}})},
methods:{attachSearchEvents:function(){var a=this;document.addEventListener("click",function(c){var d=c.target;d.classList.contains("redirectToUrl")?0==document.body.classList.contains("disabledOutine")&&1==d.classList.contains("redirectOnEnter")?(d=d.getAttribute("data-url"),window.location.href=d):0==d.classList.contains("redirectOnEnter")&&(d=d.getAttribute("data-url"),window.location.href=d):d.classList.contains("btn-search-SummaryView")?(c.stopPropagation(),d.setAttribute("tabindex","-1"),d.closest("#searchSummaryView")&&
d.closest("#searchSummaryView").querySelector(".searchSummaryViewInput").classList.contains("search-expanded")?(c=document.querySelector(".searchSummaryViewInput"),0<c.value.length&&0<c.getBoundingClientRect().width&&c.querySelector(".searchSummaryViewInput").classList.contains("search-expanded")&&document.getElementById("searchSummaryViewForm")&&document.getElementById("searchSummaryViewForm").submit()):d.closest("#searchSummaryView").querySelector(".searchSummaryViewInput").classList.add("search-expanded").focus(),
document.querySelector(".wd-header-2-5")&&d.closest("#searchSummaryView")&&d.closest("#searchSummaryView").querySelector(".searchSummaryViewInput").focus(),d=document.getElementById("searchSummaryView"),d.classList.add("z-20"),d.classList.remove("z-4")):d.classList.contains("svClearInput")?document.querySelector("#hero-input-field").focus():d.classList.contains("search-collapse")&&(d.closest("#searchSummaryView")&&d.closest("#searchSummaryView").querySelector(".searchSummaryViewInput").classList.remove("search-expanded"),
d=document.getElementById("searchSummaryView"),d.classList.add("z-4"),d.classList.remove("z-20"),document.querySelector(".svClearInput,.btn-search-SummaryView").removeAttribute("tabindex"))});document.querySelector(".searchSummaryViewInput").addEventListener("keyup",function(c){""==document.querySelector(".searchSummaryViewInput").value?document.querySelector(".svClearInput").setAttribute("tabindex","-1"):document.querySelector(".svClearInput").removeAttribute("tabindex")});document.addEventListener("click",
function(c){c=c.target;c.closest(".hero-input")||c.classList.contains("close-productList-filter")||(a.allResults=[])});window.addEventListener("resize",function(){768<window.innerWidth&&document.querySelector(".close-productList-filter")&&document.querySelector(".close-productList-filter").click()});document.addEventListener("keyup",function(c){27===c.keyCode&&(a.allResults=[])});var b=document.querySelector("#hero-input-field");b&&b.addEventListener("keyup",function(c){27!=c.keyCode&&a.autoSuggest(c.currentTarget.value)})},
bindSearchResultEvents:function(){var a=this;document.querySelectorAll(".storeSearchResult .splide__slide").forEach(function(b){b.addEventListener("mouseenter",function(c){var d=document.querySelector(".storeSearchResult .splide__slide").offsetHeight,f=c.target.offsetHeight;c.target.querySelector(".productCTAwrap").classList.add("productCTAwrapShow");c.target.closest(".storeSearchResult").style.height=f+"px";c=$jscomp.makeIterator(this.parentNode.children);for(f=c.next();!f.done;f=c.next())f=f.value,
f!=this&&(f.querySelector(".storeSearchWrapper").style.height=d+"px")})});document.querySelectorAll(".storeSearchResult .splide__slide").forEach(function(b){b.addEventListener("mouseleave",function(c){c.target.closest(".storeSearchResult").style.height="";c.target.querySelector(".productCTAwrap").classList.remove("productCTAwrapShow");c=$jscomp.makeIterator(this.parentNode.children);for(var d=c.next();!d.done;d=c.next())d=d.value,d!=this&&(d.querySelector(".storeSearchWrapper").style.height="")})});
document.querySelector("#subDocType").addEventListener("focus",function(b){a.allResults=[]})},updateUrl:function(a){a.preventDefault();if(this.q=this.q.trim()){this.addSearchTermToCookie(this.q);var b=this.getLocale().toLowerCase(),c=a.target.getAttribute("data-url");"en-us"!=b&&(c="/"+b+c);try{var d=document.querySelector("#hero-input-field").value;b={};b.linkName=a.target.previousElementSibling.innerHTML+" View All";b.searchTerm=d?d:this.q;b.linkUrl=c;var f=window.aa.createEvent("INT_PREDICTIVE_SEARCH",
b);window.dispatchEvent(f);this.search_commonLoggerObj("Predictive search details are submitted to analytics",b)}catch(k){this.search_commonLoggerObj("Error while firing Analytics call for Predictive search click",k)}this.q=this.q.replace(/<\/?[^>]+(>|$)/g,"");window.location.href=c+"?q\x3d"+encodeURIComponent(this.q)}},productClicked:function(a){try{var b=document.querySelector(".search-result-product"+a),c=document.querySelector("#hero-input-field").value;a={};a.linkName=b.nextElementSibling.textContent.split("\n")[0];
a.searchTerm=c?c:this.q;a.linkUrl=b.parentNode.href?b.parentNode.href:b.href;var d=window.aa.createEvent("INT_PREDICTIVE_SEARCH",a);window.dispatchEvent(d);this.search_commonLoggerObj("Predictive search details are submitted to analytics",a)}catch(f){this.search_commonLoggerObj("Error while firing Analytics call for Predictive search click",f)}},sendMailSearchError:function(a){var b=this,c=!0,d=a.reason;this.errorCodesArray.forEach(function(l){if(d&&d.includes(l)){var p=b.getLocale().toLowerCase()+
"_"+l+"_search_error";Cookies.get(p)?(c=!1,console.log(p+" cookie exists so error mail not sent")):Cookies.set(p,JSON.stringify({errorCode:l}),{secure:!0,path:"/",expires:1})}});if(c){var f=document.getElementById("searchSummaryView").getAttribute("data-emailSubject")+" - Stage",k=this.getPlatformCommerceURL();k.includes("www.sandisk.com")&&(f=document.getElementById("searchSummaryView").getAttribute("data-emailSubject")+" - Production");var h=new URLSearchParams(Object.entries({currentPagePath:window.location.href,
emailTemplatePath:document.getElementById("searchSummaryView").getAttribute("data-emailTemplatePath"),emailSubject:f,reason:a.reason,event:a.event,domain:k}));document.getElementById("searchSummaryView").getAttribute("data-emailTo").split(",").forEach(function(l){return h.append("emailTo",l)});fetch("/bin/sd/formemail",{credentials:"include",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:h}).then(function(l){if(l.ok)return b.isResponseJson(l)?l.json():l.text();throw Error(l.status+
"-"+l.statusText);}).then(function(l){console.log(l)}).catch(function(l){console.log("failed to send email: "+l)})}},isResponseJson:function(a){return(a=a.headers.get("content-type"))&&-1<a.indexOf("json")?!0:!1},getSessionProductPricingInfo:function(a){a=this.getSessionVariable(a);return null!=a?a:""},resetValues:function(){this.products=[];this.explore=[];this.support=[];this.exploreFound=this.supportFound=0;this.showGreyBar=!1;this.categories=[];this.allResults=[];this.productsFound=0;document.querySelector(".searchHistoryView")&&
document.querySelector(".searchHistoryView").classList.add("hidden")},emptySearchText:function(){document.querySelector("#hero-input-field").value=""},initCustomPromotion:function(a){try{this.customPromotions=JSON.parse(a),this.store_searchLogger("custom promotions",this.customPromotios)}catch(b){console.error("error while parsing custom promo json",b)}},showProductResources:function(a,b){if(void 0!=a){if(-1<a.indexOf(b)){a=a.split(",");for(var c=0;c<a.length;c++)if(a[c].startsWith(b))return(b=a[c].substring(b.length+
1))&&(b.startsWith("/content/dam/doc-library")||b.startsWith("/content/dam/asset-library"))&&(b=this.getDomain()+"tools/documentRequestHandler?docPath\x3d"+b),b}return""}},getProductMinPricedSkuInfo:function(a,b){var c=this;if(void 0!=b){b=b.split(",");var d=this.getSessionVariable(a);if(null==d)this.getBaseProductInfo(a,b).then(function(){d=c.getSessionVariable(a);if(null!=d){var f=d.minPricedSKU;if(""!=f)return f=c.getSessionProductPricingInfo(f),c.$forceUpdate(),f}else c.store_searchLogger("Product not found in session.",
a)},function(f){c.store_searchLogger("Product Info not found for ",a)});else if(b=d.minPricedSKU,""!=b)return this.getSessionProductPricingInfo(b)}},getSkuColorInfo:function(a){var b=this,c="",d=this.getSessionVariable(this.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);null==d?this.getProductReferences().then(function(){(d=b.getSessionVariable(b.COMMERCE_CONSTANTS.PRODUCT_REFERENCES))&&d[a]&&d[a].categories&&d[a].categories["vc-color"]&&(c=d[a].categories["vc-color"].data[0].title)},function(f){b.store_searchLogger("In method: getSkuColorInfo, product Info not found for ",
productCode)}):(d=this.getSessionVariable(this.COMMERCE_CONSTANTS.PRODUCT_REFERENCES))&&d[a]&&d[a].categories&&d[a].categories["vc-color"]&&(c=d[a].categories["vc-color"].data[0].title);return c},productSchema:function(a,b,c,d,f,k){if(a&&d){a={"@context":"http://schema.org","@type":"Product",name:a,url:b,image:"https://"+f+c,color:this.getSkuColorInfo(d),sku:d};var h=JSON.stringify(a);setTimeout(function(){document.getElementById("schema-product-"+d+"-"+k)&&(document.getElementById("schema-product-"+
d+"-"+k).outerHTML='\x3cscript nonce\x3d"'+document.getElementById("commonUtilLoad").getAttribute("data-nonceKey")+'" type\x3d"application/ld+json"\x3e'+h+"\x3c/script\x3e")},1E3)}},offerSchema:function(a,b,c,d,f,k,h){if(this.getPurchasableCatalog()&&a&&a.prices.sale){a={"@context":"http://schema.org","@type":"Offer",priceCurrency:a.prices.sale.currency,price:a.prices.sale.amount,availability:a.stockStatus,itemOffered:[{"@type":"Product",name:b,url:c,image:"https://"+k+d,color:this.getSkuColorInfo(f),
sku:f}]};var l=JSON.stringify(a);setTimeout(function(){document.getElementById("schema-offer-"+f+"-"+h)&&(document.getElementById("schema-offer-"+f+"-"+h).outerHTML='\x3cscript nonce\x3d"'+document.getElementById("commonUtilLoad").getAttribute("data-nonceKey")+'" type\x3d"application/ld+json"\x3e'+l+"\x3c/script\x3e")},1E3)}},initCustomPromotionInfo:function(a){var b=this;this.store_searchLogger("initCustomPromotionInfo");var c={},d=this.getSessionVariable(this.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);
d&&d[a]?(c.attBelowAddToCartButtonPromo=d[a].attBelowAddToCartButtonPromo,c.attBelowResellerButtonPromo=d[a].attBelowResellerButtonPromo,d=[],c.attBelowResellerButtonPromo&&(d=c.attBelowResellerButtonPromo.split(",")),void 0!=this.customPromotions&&void 0!=this.customPromotions[c.attBelowAddToCartButtonPromo]?c.cpJson=this.customPromotions[c.attBelowAddToCartButtonPromo]:void 0!=this.customPromotions&&d.length&&void 0!=this.customPromotions[d[0]]&&(c.cpJson=this.customPromotions[d[0]])):this.getProductReferences().then(function(){var f=
b.getSessionVariable(b.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);f&&f[a]&&(c.attBelowAddToCartButtonPromo=f[a].attBelowAddToCartButtonPromo,c.attBelowResellerButtonPromo=f[a].attBelowResellerButtonPromo,f=[],c.attBelowResellerButtonPromo&&(f=c.attBelowResellerButtonPromo.split(",")),void 0!=b.customPromotions&&void 0!=b.customPromotions[c.attBelowAddToCartButtonPromo]?c.cpJson=b.customPromotions[c.attBelowAddToCartButtonPromo]:void 0!=b.customPromotions&&f.length&&void 0!=b.customPromotions[f[0]]&&(c.cpJson=
b.customPromotions[f[0]]))});return c},isB2BUser:function(){return this.getCustomerChannel()==this.COMMERCE_CONSTANTS.B2B?!0:!1},initBadgeInfo:function(a){var b=this;this.store_searchLogger("initBadgeInfo");var c={},d=this.getSessionVariable(this.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);d&&d[a]&&d[a].badgesInfo.tagTitle?(c.badgeTagLabel=d[a].badgesInfo.tagTitle,c.badgeClass=d[a].badgesInfo.styleClass,c.badgeStartDate=d[a].badgesInfo.startDate,c.badgeEndDate=d[a].badgesInfo.endDate):this.getProductReferences().then(function(){var f=
b.getSessionVariable(b.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);f&&f[a]&&f[a].badgesInfo.tagTitle&&(c.badgeTagLabel=f[a].badgesInfo.tagTitle,c.badgeClass=f[a].badgesInfo.styleClass,c.badgeStartDate=f[a].badgesInfo.startDate,c.badgeEndDate=f[a].badgesInfo.endDate)});return c},isBadgeStatusActive1:function(a,b){return this.isBadgeStatusActive(a,b)},rewritePageURL1:function(a){return void 0!=a&&0<a.trim().length?this.rewritePageURL(a):a},pageTop:function(){document.body.scrollTop=0;document.documentElement.scrollTop=
0},getResults:function(){this.allResults=[];this.searchResp={};this.subDocumentType={};if(this.q||this.emptySearch){this.refreshSubDocTypeFacets&&this.getSubDocTypeFacetsJson(this.q,this.docTypeFacetURL,this.subDocTypeFacetURL,this.facetQueryEndPoint,this.otherLabel);if(""==this.lastSearchQ){var a=new URLSearchParams(location.search);this.productdata=[];this.lastSearchQ=a.get("q");a=this.getSearchUrl(this.q,this.searchBaseUrl,this.searchParams)+this.filterBySubDocumentType+"\x26fq\x3dbaseProductId_s:*\x26fq\x3ddocumentType:products\x26qf\x3dtitle^10%20description^8%20url^5%20skuId^1";
this.getProductSearchResults(a)}if(a=this.q)this.loading=!0,a=a.replace(/\+/g," "),this.getSearchResults(a,this.searchBaseUrl,this.searchParams,this.docTypeFacetURL,this.subDocTypeFacetURL,this.aaTrack)}},subDocumentTypeFacetFilter:function(){this.subDocTypeFacetURL="";this.subDocTypeFacetURL=this.getSelectedSubDocumentTypeFacets(this.jsonData);this.subDocTypeAllResults=""==this.subDocTypeFacetURL?!0:!1;this.subDocTypeFacetURL=""!=this.subDocTypeFacetURL?"filterSubDocumentType:("+this.subDocTypeFacetURL+
")":"";this.refreshSubDocTypeFacets=""==this.docTypeFacetURL&&""!=this.subDocTypeFacetURL||""!=this.docTypeFacetURL&&""!=this.subDocTypeFacetURL||""==this.docTypeFacetURL&&""==this.subDocTypeFacetURL?!1:!0;this.currentPage=this.searchParams.start=this.start=0;this.getResults()},subDocumentTypeAllResultsFilter:function(){this.jsonData.forEach(function(a){a.selected&&(a.selected=!1)});this.subDocumentTypeFacetFilter()},openURL:function(a,b){b?window.open(a,"_self"):window.open(a,"_blank")},getURL:function(a){return window.location.pathname+
"?page\x3d"+(0==a?1:a)},searchsmoothScroll:function(){var a=document.querySelector(".filterItemWrap");if(a){var b=a.closest(".container").offsetTop-20;setTimeout(function(){window.scrollTo({top:b,behavior:"smooth"})})}},gotoPage:function(a,b){a.preventDefault();this.searchsmoothScroll();this.currentPage=b;this.searchParams.row=this.row;this.searchParams.start=this.currentPage*this.row;this.getResults();this.isPagination=1;this.$forceUpdate()},nextPage:function(a){a.preventDefault();this.searchsmoothScroll();
this.currentPage+=1;this.start+this.row<this.numFound&&(this.start+=this.row,this.searchParams.row=this.row,this.searchParams.start=this.start,this.getResults(),this.isPagination=1,this.$forceUpdate())},previousPage:function(a){a.preventDefault();this.searchsmoothScroll();--this.currentPage;0<this.start&&(this.start=0<this.start-this.row?this.start-this.row:0,this.searchParams.row=this.row,this.searchParams.start=this.start,this.getResults(),this.isPagination=1,this.$forceUpdate())},showPaginationDots:function(){5==
this.paginationObj.totalPages?this.showPaginationDotsAtEnd=this.showPaginationDotsAtStart=!1:(this.showPaginationDotsAtStart=4<this.currentPage+1&&6!=this.paginationObj.totalPages?!0:!1,this.showPaginationDotsAtEnd=this.currentPage+4>=this.paginationObj.totalPages?!1:!0)},updatePagination:function(){this.showPaginationDots();5==this.paginationObj.totalPages||4==this.paginationObj.totalPages?(this.paginationStartCounter=2,this.paginationEndCounter=4):4>this.currentPage+1&&this.currentPage+4!=this.paginationObj.totalPages?
(this.paginationStartCounter=2,this.paginationEndCounter=4<this.paginationObj.totalPages?4:this.paginationObj.totalPages):4==this.currentPage+1&&this.currentPage+4!=this.paginationObj.totalPages?(this.paginationStartCounter=2,this.paginationEndCounter=this.currentPage+1==this.paginationObj.totalPages?this.paginationObj.totalPages:5):4<this.currentPage+1&&this.currentPage+4!=this.paginationObj.totalPages&&this.currentPage+4<this.paginationObj.totalPages?(this.paginationStartCounter=this.currentPage,
this.paginationEndCounter=this.currentPage+2):4<this.currentPage+1&&this.currentPage+4==this.paginationObj.totalPages?(this.paginationStartCounter=this.currentPage,this.paginationEndCounter=this.paginationObj.totalPages-1):this.currentPage+4>this.paginationObj.totalPages?(this.paginationStartCounter=this.paginationObj.totalPages-4,this.paginationEndCounter=this.paginationObj.totalPages-1):this.currentPage+4==this.paginationObj.totalPages&&(this.paginationStartCounter=2,this.paginationEndCounter=this.paginationObj.totalPages-
1)},getSearchBlockClass:function(){return this.isFacetedSearch?"seventy col-sm-9":"col-sm-12"},setFocusOnPagination:function(){1==this.isPagination&&(this.isPagination=0)},submitQuery:function(a,b){a.preventDefault();this.showAutoSuggestions=!1;a="";b&&(this.q=b.replace(/<\/?[^>]+(>|$)/g,""),document.querySelector("#hero-input-field")&&(a=document.querySelector("#hero-input-field").value,document.querySelector("#hero-input-field").value=this.q));void 0==this.q||""==this.q?this.emptySearch=!0:(b=new URLSearchParams(window.location.search),
b.set("q",this.q),history.pushState(null,"",window.location.pathname+"?"+b.toString()));if(this.q||this.emptySearch)if(this.isNotSearchResultPage)this.openURL(this.resultPagePath,!0);else if(this.searchParams={},this.start=0,groupNumFoundArr=[],this.subDocTypeAllResults=this.refreshSubDocTypeFacets=this.aaTrack=!0,this.lastSearchQ=this.subDocTypeFacetURL="",this.currentPage=0,this.addSearchTermToCookie(this.q),this.getResults(),this.q)try{var c=this.getLocale().toLowerCase(),d=document.getElementById("searchDetailView").getAttribute("data-search-page");
"en-us"!=c&&(d="/"+c+d);document.querySelector("#hero-input-field");c={};c.linkName=this.q;c.searchTerm=a?a:this.q;c.linkUrl=d;var f=window.aa.createEvent("INT_PREDICTIVE_SEARCH",c);window.dispatchEvent(f);this.search_commonLoggerObj("Predictive search details are submitted to analytics",c)}catch(k){this.search_commonLoggerObj("Error while firing Analytics call for Predictive search click",k)}},addSearchTermToCookie:function(a){var b=this.getSearchesCookie();b?(b=JSON.parse(b).recentSearches,-1==
b.indexOf(a)&&(5>b.length?b.unshift(a):(b.unshift(a),b.pop()),this.addItemtoCookie(b))):this.setSearchesCookie({recentSearches:[a]})},addItemtoCookie:function(a){this.setSearchesCookie({recentSearches:a})},getSearchesCookie:function(){return Cookies.get(this.getLocale().toLowerCase()+"_"+this.$data.COMPARE_CONSTANTS.Recent_Searches_COOKIE)},setSearchesCookie:function(a){Cookies.set(this.getLocale().toLowerCase()+"_"+this.$data.COMPARE_CONSTANTS.Recent_Searches_COOKIE,JSON.stringify(a),{secure:!0,
path:"/",expires:365})},trackSearchResultClick:function(a,b){try{window.aa.trackSearchResultClick(a.currentTarget,b)}catch(c){}},autoSuggest:function(a){var b=this;if((this.q=a.replace(/[+\-&&||!(){}[\]^"~*?:/]/g,"\\$\x26"))&&this.q.trim().length>=this.textLength&&this.showAutoSuggestions){a=this.q.trim().split(" ").map(function(d){return d.includes("-")?'"'+d+'"':d}).join(" ");document.querySelector(".predictiveResultViewForm .skeleton-group").classList.remove("hidden");var c=this.getDomain()+"tools/shopsearchsuggest?q\x3d"+
encodeURIComponent(a)+"\x26group.field\x3dgrpDocumentType\x26group.limit\x3d5\x26group\x3dtrue\x26indent\x3don\x26wt\x3djson";this.resetValues();fetch(c).then(function(d){if(d.ok)return d.json();throw Error(d.status+"-"+d.statusText);}).then(function(d){if(b.q&&b.q.trim().length>=b.textLength&&d.grouped&&d.grouped.grpDocumentType&&0<d.grouped.grpDocumentType.matches&&b.showAutoSuggestions){b.resetValues();b.allResults=d.grouped.grpDocumentType.groups;b.search_commonLoggerObj("allResults: ",b.allResults);
var f=[];b.allResults.forEach(function(h){"Products"==h.groupValue&&(b.products=h.doclist.docs.slice(0,4),b.productsFound=h.doclist.numFound,b.getProductsMinPrice(b.products,"baseProductId_s"));b.exploreMapArray.forEach(function(l){l==h.groupValue&&(b.exploreFound+=h.doclist.numFound,f=f.concat(h.doclist.docs))})});var k=[];b.products.forEach(function(h){if(h.hasOwnProperty("productCategoryPagePath_s")&&h.hasOwnProperty("productCategoryTitle_s")){var l={};l.url=h.productCategoryPagePath_s;l.title=
h.productCategoryTitle_s;k.push(l)}h.hasOwnProperty("breadcrumbSubCategoryPagePath_s")&&h.hasOwnProperty("breadcrumbSubCategoryTitle_s")&&(l={},l.url=h.breadcrumbSubCategoryPagePath_s,l.title=h.breadcrumbSubCategoryTitle_s,k.push(l))});d=new Set(k.map(JSON.stringify));d=Array.from(d).map(JSON.parse);b.categories=5<d.length?d.slice(0,5):d;b.supportMapArray.forEach(function(h){b.allResults.forEach(function(l){h==l.groupValue&&(b.support.push(l.doclist.docs[0]),b.supportFound+=l.doclist.numFound)})});
f.sort(function(h,l){h=h.score;l=l.score;return h>l?-1:h<l?1:0});5<f.length&&(f=f.slice(0,5));b.explore=f;b.search_commonLoggerObj("explore: ",b.explore);document.querySelector(".predictiveResultViewForm .skeleton-group").classList.add("hidden")}else b.search_commonLoggerObj("No results"),b.resetValues(),b.allResults=[]}).catch(function(d){b.search_commonLoggerObj("error: ",d);document.querySelector(".predictiveResultViewForm .skeleton-group").classList.add("hidden");b.resetValues();b.allResults=
[];var f={event:"Predictive Search Solr API call initiated"};f.reason="Failed to get Solr response - "+d;b.sendMailSearchError(f)});this.suggestions=[];a=this.getDomain()+"tools/shopsuggest?q\x3d"+a+"\x26wt\x3djson";fetch(a).then(function(d){if(d.ok)return d.json();throw Error(d.status+"-"+d.statusText);}).then(function(d){b.q&&b.q.trim().length>=b.textLength&&d.suggest&&d.suggest.shopSuggester&&d.suggest.shopSuggester&&b.showAutoSuggestions?(d=Object.values(d.suggest.shopSuggester)[0],0<d.numFound&&
b.showAutoSuggestions?(b.suggestions=[],d=d.suggestions,b.search_commonLoggerObj("suggestionResults: ",d),b.suggestions=5<d.length?d.slice(0,5):d):(b.search_commonLoggerObj("No Suggestions results"),b.suggestions=[])):(b.search_commonLoggerObj("No Suggestions results"),b.suggestions=[])}).catch(function(d){b.search_commonLoggerObj("error: ",d);document.querySelector(".predictiveResultViewForm .skeleton-group").classList.add("hidden");b.suggestions=[];var f={event:"Predictive Search Solr API call initiated for suggestions"};
f.reason="Failed to get Solr suggestions response - "+d;b.sendMailSearchError(f)})}else document.querySelector(".predictiveResultViewForm .skeleton-group").classList.add("hidden"),this.resetValues(),this.allResults=[]},getProductsMinPrice:function(a,b){var c=this;a.forEach(function(d){if(d.hasOwnProperty(b)){var f=d[b];c.search_commonLoggerObj("baseProductCode",b,f);var k=c.getSessionVariable(f);if(null==k)c.productReferences&&c.productReferences[f]?c.getBaseProductInfo(f,c.productReferences[f].skuList).then(function(){k=
c.getSessionVariable(f);if(null!=k){var l=k.minPricedSKU;""!=l&&(l=c.getSessionProductPricingInfo(l),c.search_commonLoggerObj("sessionProductPricingInfo",l),d.minPricedSkuObj=l,c.$forceUpdate())}else c.search_commonLoggerObj("Product "+f+" not found in session.")}).catch(function(l){console.error(l);c.search_commonLoggerObj("error thrown while getting sessionBaseProductInfo :: ",f)}):c.search_commonLoggerObj("Product "+f+" not found in session.");else{var h=k.minPricedSKU;""!=h&&(h=c.getSessionProductPricingInfo(h),
d.minPricedSkuObj=h,c.$forceUpdate())}}})},filterDescription:function(a){return a.replace(/{{[^}}]+}}/g,"")},getTitle:function(a){return a.title?a.title[0]:a.id},openProductFilterMobile:function(){document.querySelector(".filter-overlay").style.display="block";document.body.classList.add("overflow-hidden");document.querySelector(".left-filter").classList.remove("hidden");var a=window.innerHeight,b=Math.abs(document.querySelector(".fliter_header").offsetHeight),c=Math.abs(document.querySelector(".filter_btn_height").offsetHeight);
document.querySelector(".filterItemWrap").style.height=a-b-c+"px"},closeProductFilterMobile:function(){document.querySelector(".filter-overlay").removeAttribute("style");document.body.classList.remove("overflow-hidden");document.querySelector(".left-filter").classList.add("hidden");document.querySelector(".filterItemWrap").removeAttribute("style")},storeSearchResultSlider:function(){var a=this;document.querySelector(".storeSearchResult").classList.contains("is-initialized")?setTimeout(function(){a.storeSearchResult.destroy();
a.storeSearchSlider();a.bindSearchResultEvents()},0):setTimeout(function(){a.storeSearchSlider();a.bindSearchResultEvents()},0)},store_searchLogger:function(a,b){-1<window.location.search.indexOf("debugStoreSearch\x3dtrue")&&console.log(a,null!=b?b:"")},search_commonLoggerObj:function(a,b){-1<window.location.search.indexOf("debugSearch\x3dtrue")&&console.log(a,null!=b?b:"")},getSelectedSubDocumentTypeFacets:function(a){var b="";a.forEach(function(c){c.selected&&(b=""!=b?b+"%20OR%20":"",b+="%22"+c.facetName+
"%22")});return b},getSubDocTypeFacetsJson:function(a,b,c,d,f){var k=this;b=""!=b?"\x26fq\x3d"+b:b;a=d+(d&&0<=d.indexOf("?")?"\x26":"?")+"q\x3d"+encodeURIComponent(void 0!=a&&""!=a?a:"*.*")+b+"\x26facet.field\x3dfilterSubDocumentType\x26wt\x3djson";fetch(a).then(function(h){if(h.ok)return h.json();throw Error(h.status+"-"+h.statusText);}).then(function(h){var l=[],p="";h=h.facet_counts.facet_fields.filterSubDocumentType;for(var q=0;q<h.length;q++)""!=h[q]&&"Other"!=h[q]?l.push({facetName:h[q],facetCount:h[q+
1],selected:""!=c?0<=c.indexOf(h[q])?!0:!1:!1}):"Other"==h[q]&&(p=h[q+1]),q+=1;""!=p&&l.push({facetName:f,facetCount:p,selected:""!=c?0<=c.indexOf(f)?!0:!1:!1});k.jsonData=l}).catch(function(h){k.search_commonLoggerObj("error: ",h.data)})},trackInternalSearch:function(a,b,c){var d={};d.q=a;d.searchTermsCount=b;d.filterBy=[];d.filterBy=""!=c?decodeURIComponent(c.replace(/%22/g,"").split("OR")).split(","):"All";try{var f=window.aa.createEvent("SEARCH",d);window.dispatchEvent(f)}catch(k){this.search_commonLoggerObj("Error while triggering analytics Search event.")}},
getSearchResults:function(a,b,c,d,f,k){var h=this;b=this.getSearchUrl(a,b,c)+this.filterBySubDocumentType;""!=d&&""!=f?b=b+"\x26fq\x3d"+f+"%20AND%20"+d:""!=d&&""==f?b=b+"\x26fq\x3d"+d:""==d&&""!=f&&(b=b+"\x26fq\x3d"+f);fetch(b).then(function(l){if(l.ok)return l.json();throw Error(l.status+"-"+l.statusText);}).then(function(l){var p=l.response.numFound;h.aaTrack&&h.trackInternalSearch(a,p,f);h.aaTrack=!1;h.searchResp=l.response;h.searchRespDocs=h.searchResp.docs;h.numFound=l.response.numFound;h.numOfResult=
h.numFound;h.showErrorMsg=0==h.numOfResult?!0:!1;h.paginationObj.totalPages=0==h.numFound/h.row%1?Math.floor(h.numFound/h.row):Math.floor(h.numFound/h.row)+1;h.loading=!1;h.setFocusOnPagination();h.updatePagination();h.allResults=[];h.showAutoSuggestions=!0}).catch(function(l){h.store_searchLogger("Error while getting search results."+l);h.search_commonLoggerObj("error: ",l.data);h.trackInternalSearch(a,0,f);h.aaTrack=!1})},getSearchUrl:function(a,b,c){var d=b+(b&&0<=b.indexOf("?")?"\x26":"?")+"q\x3d"+
encodeURIComponent(void 0!=a&&""!=a?a:"*:*");c.wt="json";for(key in c)"[object Array]"===Object.prototype.toString.call(c[key])?c[key].forEach(function(f){d+="\x26"+key+"\x3d"+f}):d+="\x26"+key+"\x3d"+c[key];return d},getProductSearchResults:function(a){var b=this;fetch(a).then(function(c){if(c.ok)return c.json();throw Error(c.status+"-"+c.statusText);}).then(function(c){b.productdata=c.response.docs;b.productdata.forEach(function(d,f){b.productdata[f].productInfo=b.initCustomPromotionInfo(d.baseProductId_s);
b.productdata[f].productBadgeInfo=b.initBadgeInfo(d.baseProductId_s)});b.store_searchLogger(b.productdata);b.storeSearchResultSlider()}).catch(function(c){b.search_commonLoggerObj("error: ",c)})},storeSearchSlider:function(){document.querySelector(".storeSearchResult").classList.remove("overflow-hidden","h-0");"rtl"==document.querySelector("html").getAttribute("dir")?this.storeSearchResult=new Splide("#storeSearchResult",{perPage:6,perMove:1,arrows:!0,height:"auto",pagination:!1,direction:"rtl",accessibility:!0,
gap:"16px",breakpoints:{1460:{perPage:5},1140:{perPage:4},992:{perPage:3},768:{perPage:3,pagination:!0},576:{perPage:2,pagination:!0}}}):this.storeSearchResult=new Splide(".storeSearchResult",{perPage:6,perMove:1,arrows:!0,height:"auto",pagination:!1,accessibility:!0,gap:"16px",breakpoints:{1460:{perPage:5},1140:{perPage:4},992:{perPage:3},768:{perPage:3,pagination:!0},576:{perPage:2,pagination:!0}}});this.storeSearchResult.mount()}}};Vue.newInstance("PredictiveDetailSearchApp",PredictiveDetailSearchApp);
var ProductCompare={el:"#product-compare",mixins:[compareTrayService,commerceService],data:{compareSkuDetailsArray:[],compareProductsData:[],comapreAttrMapping:[],comparebaseProdDetailsArray:[],usecaseArray:[],compareErrorMsg:"",sharePageLink:"",showDiffOption:!0,redirectPath:"",loadingFromCookie:!1,pageTitle:"",diffOptionChecked:!1,showFullTextIndex:-1,expandedTexts:{},shareEmailLink:"",isSummaryView:!1,isInPageView:!1,productRefData:[],skuListData:[],productReferences:{},baseProductTitle:"",isCatalogPurchasable:!1},
mounted:function(){this.getAttrMapping();this.getUsecaseMapping();this.checkURLparams();this.hadndleShowMoreLess();this.isCatalogPurchasable=this.getPurchasableCatalog()},methods:{showFullText:function(a){this.$set(this.expandedTexts,a,!this.expandedTexts[a])},containsHTMLTag:function(a){return/<[a-z][\s\S]*>/i.test(a)},hadndleShowMoreLess:function(){var a=document.querySelector(".show-all"),b=document.querySelector(".show-toggle-btn"),c=document.querySelector(".show-less"),d=document.querySelector(".compareTable .compare-table");
a&&(a.addEventListener("click",function(){d.classList.contains("specs-table")&&d.classList.remove("specs-table");a.classList.toggle("hidden");b.classList.add("table-expanded");c.classList.toggle("hidden")}),c.addEventListener("click",function(){d.classList.contains("specs-table")||d.classList.add("specs-table");a.classList.toggle("hidden");b.classList.remove("table-expanded");c.classList.toggle("hidden")}))},checkURLparams:function(){var a=this,b={},c=new URLSearchParams(decodeURIComponent(window.location.search));
if(c.has("ids")&&!this.isSummaryView){c.get("ids").trim().split(",").forEach(function(f){f=f.split(":");b[f[0]]=f[1]});if(c=sessionStorage.getItem("pctLoadingFromTray"))this.loadingFromCookie=!0,this.comparepage_commonLogger("pctLoadingFromTray: "+c),sessionStorage.removeItem("pctLoadingFromTray");this.loadingFromCookie||(document.getElementById("backDiv")?document.getElementById("backDiv").classList.add("hidden"):"");Object.keys(b).length?this.sendBaseProductsRequest(b):this.handleErrorWhenNoObj()}else if(this.isSummaryView&&
document.getElementById("ProductCompare").getAttribute("data-attr-productref")){var d="";c=new URLSearchParams(window.location.search);null!=c.get("sku")?d=c.get("sku"):document.querySelector("[data-defaultvariantsku]")&&(d=document.querySelector("[data-defaultvariantsku]").getAttribute("data-defaultvariantsku"));this.productRefData=JSON.parse(document.getElementById("ProductCompare").getAttribute("data-attr-productref"));this.getProductReferences().then(function(){a.productReferences=a.getSessionVariable(a.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);
a.productRefData.forEach(function(f){var k=a.productReferences[f]?a.productReferences[f].skuList:"";k&&0<k.length&&(b[k[-1!=k.indexOf(d)?k.indexOf(d):0]]=f)});1<Object.keys(b).length&&a.productRefData&&a.productRefData[0]&&a.productRefData[0]==b[Object.keys(b)[0]]?a.sendBaseProductsRequest(b):a.handleErrorWhenNoObj()})}else this.isInPageView&&document.getElementById("ProductCompare").getAttribute("data-attr-skulist")?(this.skuListData=JSON.parse(document.getElementById("ProductCompare").getAttribute("data-attr-skulist")),
this.getProductReferences().then(function(){a.productReferences=a.getSessionVariable(a.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);a.skuListData.forEach(function(f){var k=a.productReferences[f]?a.productReferences[f].productId:"";k&&(b[f]=k)});1<Object.keys(b).length&&a.skuListData&&a.skuListData[0]&&a.skuListData[0]==Object.keys(b)[0]?a.sendBaseProductsRequest(b):a.handleErrorWhenNoObj()})):this.handleErrorWhenNoObj()},handleErrorWhenNoObj:function(){this.hideSkeletonLoad();this.hidePDPCompareSummarySection();
document.getElementById("ProductCompare")&&document.getElementById("ProductCompare").getAttribute("data-novalidProducts")&&(this.compareErrorMsg=document.getElementById("ProductCompare").getAttribute("data-novalidProducts"));this.openModal();this.comparepage_commonLogger("no prodcuts selected")},sendBaseProductsRequest:function(a){var b="",c=[],d;for(d in a)c.push(a[d]);c.length&&(c=[].concat($jscomp.arrayFromIterable(new Set(c))),c.forEach(function(f,k){b+=f;k<c.length-1&&(b+=",")}),this.comparepage_commonLogger(b),
this.getProductsDeatils(b,a),this.updateProductSummaryViewTitle())},getUsecaseMapping:function(){var a=this;fetch("/content/dam/sandisk/en-us/assets/sys/pct/usecase-icons-mapping.xlsx.exceltojson.json").then(function(b){if(b.ok)return b.json();throw Error(b.status+"-"+b.statusText);}).then(function(b){b&&b[0].data?a.usecaseArray=b[0].data:a.comparepage_commonLogger("Error in response: "+b)}).catch(function(b){a.comparepage_commonLogger("failed to get usecase mapping from excel sheet: "+b)})},getAttrMapping:function(){this.redirectPath=
document.getElementById("ProductCompare").getAttribute("data-attr-redirectPath");this.isSummaryView="true"==document.getElementById("ProductCompare").getAttribute("data-attr-isSummaryView")?!0:!1;this.isInPageView="true"==document.getElementById("ProductCompare").getAttribute("data-attr-isInPageView")?!0:!1;var a=document.getElementById("ProductCompare").getAttribute("data-attr-mapping");a&&(this.comapreAttrMapping=JSON.parse(a))},hideSkeletonLoad:function(){document.querySelector(".compareTable").classList.remove("hidden");
document.querySelector(".table-loading").classList.add("hidden")},getProductsDeatils:function(a,b){var c=this;this.comparepage_commonLogger("getProductsDeatils",a);if(a){var d=this.getDomain()+"tools/api/globalsearchquery?q\x3d*\x26locale\x3d"+this.getLocale().toLowerCase()+"\x26documentType\x3dProducts\x26fq\x3dbaseProductId_s:"+a+"\x26channel\x3d"+this.getCustomerChannel()+"\x26rows\x3d100";this.compareProductsData=[];fetch(d,{method:"GET"}).then(function(f){if(f.ok)return f.json();throw Error(f.status+
"-"+f.statusText);}).then(function(f){f=f.docs;c.comparepage_commonLogger("docs",f);if(f&&0<f.length){c.checkIfValidResponse(f);c.compareProductsData=f;var k=[],h=[],l=[],p;for(p in b)for(var q=$jscomp.makeIterator(f),t=q.next();!t.done;t=q.next())if(t=t.value,t.id==p){k.push(t);h.push(p);t=$jscomp.makeIterator(f);for(var u=t.next();!u.done;u=t.next())if(u=u.value,"Products"==u.documentType[0]&&b[p]==u.baseProductId_s){t=Object.assign({},u);t.selectedSkuId=p;l.push(t);break}}c.isSummaryView||c.isInPageView||
(c.sortDetailsArray(l),c.sortDetailsArray(k));c.comparebaseProdDetailsArray=[];l.forEach(function(C,E){var F={};c.compareProductsData.forEach(function(G){G.id==C.selectedSkuId&&"Variant"==G.documentType[0]&&(F.primaryImage=G.primaryImage?G.primaryImage:C.primaryImage)});F.title=C.title[0];F.pagePath=c.isSummaryView&&0==E?"javascript:void(0)":C.pagePath_s;F.selectedSkuId=C.selectedSkuId;F.baseProductId=C.baseProductId_s;var K=[];C.skuId.forEach(function(G){c.compareProductsData.forEach(function(A){if(G==
A.id){var O="",W="",Z={};Z.val=G;var fa=A.variantCategories_ss?A.variantCategories_ss:A.attrCategories_ss;fa&&(fa.forEach(function(Ca,ta){Ca&&(O+=A.categoryAssociation[Ca+"-lbl_ss"][0],W+=A.categoryAssociation[Ca+"-val_ss"][0],ta<fa.length-1&&(O+=", ",W+=", "))}),Z.text=W,K.push(Z),F.attVariantCategory=O)}})});F.skuIdArray=K;c.comparebaseProdDetailsArray.push(F)});c.isCatalogPurchasable&&c.comparebaseProdDetailsArray.forEach(function(C){var E=c.getSessionVariable(C.selectedSkuId);null!=E&&null!=E.prices?
(C.skuPrice=E,c.comparepage_commonLogger(E),c.$forceUpdate()):c.getProductPrice(C.selectedSkuId).then(function(){var F=c.getSessionVariable(C.selectedSkuId);null!=F?(C.skuPrice=F.prices?F:"-",c.comparepage_commonLogger(F)):C.skuPrice="-";c.$forceUpdate()})});c.setMetaTags();c.comparepage_commonLogger("comparebaseProdDetailsArray",c.comparebaseProdDetailsArray);c.compareSkuDetailsArray=[];c.comapreAttrMapping.forEach(function(C){var E=C.techspecid,F={};F.tooltip=C.tooltip?C.tooltip:"";var K=[];k.forEach(function(G){var A=
G.productTechSpec.attrProductTechSpecs_ss;A&&A.includes(E)&&G.productTechSpec[E+"_val_ss"]&&"txtModelNumber"!=E||"productSubCategory"==E?(F.label=C.label?C.label:G.productTechSpec[E+"_lbl_ss"][0],F.techspecid=E,A=G.productTechSpec[E+"_val_ss"],"productSubCategory"==E&&(A=G.productTechSpec.productSubCategory_val_ss?G.productTechSpec.productSubCategory_val_ss:G.productTechSpec.productCategory_val_ss),A?K.push(A):(K.push(["-"]),c.comparepage_commonLogger(A+" value missing"))):"txtModelNumber"==E?(F.label=
C.label,F.techspecid=E,(G=G.id)?K.push([G]):(K.push(["-"]),c.comparepage_commonLogger(G+" value missing"))):G.hasOwnProperty(E)?(F.label=C.label,F.techspecid=E,(G=G[E])?Array.isArray(G)?K.push(G):K.push([G]):(K.push(["-"]),c.comparepage_commonLogger(G+" value missing"))):K.push(["-"])});K.length&&(F.skuValues=K,F.diffData=!0,c.compareSkuDetailsArray.push(F))});c.hideEmptyRows();c.comparepage_commonLogger("compareSkuDetailsArray",c.compareSkuDetailsArray);c.hideDiffOption();c.loadingFromCookie&&c.checkNotApplicableSkus(h);
c.hideSkeletonLoad();c.isSummaryView&&c.comparebaseProdDetailsArray&&2>c.comparebaseProdDetailsArray.length&&c.hidePDPCompareSummarySection()}else c.hideSkeletonLoad(),c.hidePDPCompareSummarySection(),c.comparepage_commonLogger("No sku is avaialble"),c.compareErrorMsg=document.getElementById("ProductCompare").getAttribute("data-notAvailable"),c.openModal(),c.loadingFromCookie&&Cookies.set(c.getLocale().toLowerCase()+"_"+c.$data.COMPARE_CONSTANTS.COMPARE_TRAY_COOKIE,JSON.stringify({}),{secure:!0,path:"/",
expires:30})}).catch(function(f){c.hideSkeletonLoad();c.compareErrorMsg=document.getElementById("ProductCompare").getAttribute("data-tryLater");c.openModal();console.error(f);c.hidePDPCompareSummarySection();var k={event:"Loading PCT page"};c.isSummaryView&&(k.event="Loading PDP page");c.isInPageView&&(k.event="Loading page");k.reason="failed to get SOLR response of base products ["+decodeURI(a)+"] - "+f;c.sendMailPctError(k)})}else console.error("product ids ",a)},checkIfValidResponse:function(a){var b=
[],c=[];a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;d=a.next())d=d.value,"Products"==d.documentType[0]?b.push(d):"Variant"==d.documentType[0]&&c.push(d);var f=[];a=$jscomp.makeIterator(b);for(d=a.next();!d.done;d=a.next())(d=d.value.skuId)&&d.length&&d.forEach(function(q){for(var t=!0,u=$jscomp.makeIterator(c),C=u.next();!C.done;C=u.next())if(C.value.id==q){t=!1;break}t&&f.push(q)});this.comparepage_commonLogger("notAvailSkus",f);0<f.length&&(f=[].concat($jscomp.arrayFromIterable(new Set(f))),
a={event:"Loading PCT page"},this.isSummaryView&&(a.event="Loading PDP page"),this.isInPageView&&(a.event="Loading page"),a.reason="SKUs missing in solr response "+f,this.sendMailPctError(a));a=[];var k=$jscomp.makeIterator(c);for(d=k.next();!d.done;d=k.next()){var h=d.value,l=!0,p=$jscomp.makeIterator(b);for(d=p.next();!d.done;d=p.next())if(d.value.baseProductId_s==h.baseProductId_s){l=!1;break}l&&a.push(h.baseProductId_s)}this.comparepage_commonLogger("notAvailBaseDocs",a);0<a.length&&(a=[].concat($jscomp.arrayFromIterable(new Set(a))),
b={event:"Loading PCT page"},this.isSummaryView&&(b.event="Loading PDP page"),this.isInPageView&&(b.event="Loading page"),b.reason="Base products missing in solr response "+a,this.sendMailPctError(b))},updateProductSummaryViewTitle:function(){var a=this;this.isSummaryView&&setTimeout(function(){document.getElementsByClassName("pdp-product-title")&&0<document.getElementsByClassName("pdp-product-title").length&&(a.baseProductTitle=document.getElementsByClassName("pdp-product-title")[0].getAttribute("data-product-title")+
" - "+document.getElementsByClassName("pdp-product-title")[0].getAttribute("data-product-sku"))})},setMetaTags:function(){var a=this;if(!this.isSummaryView&&!this.isInPageView){var b=this.pageTitle="",c=[];this.comparebaseProdDetailsArray.forEach(function(f,k){c.push(f.title)});c=[].concat($jscomp.arrayFromIterable(new Set(c)));c.forEach(function(f,k){a.pageTitle+=f;b+=f;k<c.length-1&&(a.pageTitle+=" vs. ",b+="\x3cspan class\x3d'text-sd-red'\x3e + \x3c/span\x3e")});document.getElementById("subHeading").innerHTML=
b;var d=null;document.title.includes("|")&&(d=document.title.substring(document.title.indexOf("|")-1,document.title.length));null==d||this.pageTitle.includes(d)||(this.pageTitle+=d);document.title=this.pageTitle?this.pageTitle:"Digital Storage Products Comparison Table";document.querySelector('meta[name\x3d"twitter:title"]').setAttribute("content",document.title);document.querySelector('meta[property\x3d"og:title"]').setAttribute("content",document.title)}},sortDetailsArray:function(a){a.sort(function(b,
c){b=b.title[0].toLowerCase();c=c.title[0].toLowerCase();return b<c?-1:b>c?1:0})},sortArray:function(a,b){a.sort(function(c,d){c=c[b].toLowerCase();d=d[b].toLowerCase();return c<d?-1:c>d?1:0})},isUserB2B:function(){return this.getCustomerChannel()==this.$data.COMMERCE_CONSTANTS.B2B},formatPrice:function(a,b){a=(new Intl.NumberFormat(this.getLocale(),{style:"currency",currency:b})).format(1*a);if("en-CA"==this.getLocale()||"fr-CA"==this.getLocale())a=a.replace("$","C$ ");"es-MX"==this.getLocale()&&
(a=a.replace("USD\u00a0","$ "));return a},hideDiffOption:function(){1==this.comparebaseProdDetailsArray.length&&(this.showDiffOption=!1);var a=!0;this.compareSkuDetailsArray.forEach(function(b){if(a){b=b.skuValues;for(var c={},d=$jscomp.makeIterator(b),f=d.next();!f.done&&(c.$jscomp$loop$prop$skuArray$284=f.value,a=b[0].every(function(k){return function(h){return k.$jscomp$loop$prop$skuArray$284.includes(h)}}(c)),a);c={$jscomp$loop$prop$skuArray$284:c.$jscomp$loop$prop$skuArray$284},f=d.next());}});
this.showDiffOption=a?!1:!0},checkNotApplicableSkus:function(a){var b=this.getCompareCookie(),c={};if(b){c=JSON.parse(b);for(var d in c)a.includes(d)||(this.removeSkuFromCookie(d),this.comparepage_commonLogger(d+" not applicable and removed from tray cookie"))}this.comparepage_commonLogger(a.length,Object.keys(c).length+" items length not equal");a.length!=Object.keys(c).length&&(this.compareErrorMsg=document.getElementById("ProductCompare").getAttribute("data-notAvailable"),this.openNotificationModal())},
removeItem:function(a,b){this.comparepage_commonLogger("removed sku "+a,b);this.comparebaseProdDetailsArray.splice(b,1);this.compareSkuDetailsArray.forEach(function(c){c.skuValues.splice(b,1)});this.loadingFromCookie&&this.removeSkuFromCookie(a);0==this.comparebaseProdDetailsArray.length&&(this.compareErrorMsg=document.getElementById("ProductCompare").getAttribute("data-novalidProducts"),this.openModal());this.diffOptionChecked&&this.showDiffSkuData();this.hideEmptyRows();this.hideDiffOption();this.setMetaTags();
this.updatePageUrl()},hideEmptyRows:function(){var a=[];this.compareSkuDetailsArray.forEach(function(b,c){c=b.skuValues;if(c.length){var d=!1;c.forEach(function(f){"-"!=f[0]&&(d=!0)});d?b.notEmptyRow=!0:(a.push(b.label),b.notEmptyRow=!1)}});this.comparepage_commonLogger("all values are empty for techspecs ",a)},changeSkuID:function(a,b){var c=this;var d=a&&a.target&&a.target.value?a.target.value:a;this.comparepage_commonLogger("changed sku "+d,b);this.compareProductsData.forEach(function(h){if(d==
h.id){var l=h.productTechSpec.attrProductTechSpecs_ss;c.compareSkuDetailsArray.forEach(function(p){var q=[],t=p.techspecid;if(l&&l.includes(t)&&h.productTechSpec[t+"_val_ss"]&&"txtModelNumber"!=t||"productSubCategory"==t){var u=h.productTechSpec[t+"_val_ss"];"productSubCategory"==t&&(u=h.productTechSpec.productSubCategory_val_ss?h.productTechSpec.productSubCategory_val_ss:h.productTechSpec.productCategory_val_ss);u?q.push(u):(q.push(["-"]),c.comparepage_commonLogger(u+" value missing"))}else"txtModelNumber"==
t?d?q.push([d]):(q.push(["-"]),c.comparepage_commonLogger(d+" value missing")):h.hasOwnProperty(t)?(t=h[t])?Array.isArray(t)?q.push(t):q.push([t]):(q.push(["-"]),c.comparepage_commonLogger(t+" value missing")):q.push(["-"]);q.length&&(p.skuValues[b]=q[0])});c.hideEmptyRows();c.$forceUpdate()}});this.comparebaseProdDetailsArray[b].selectedSkuId=d;this.compareProductsData.forEach(function(h){h.id==d&&"Variant"==h.documentType[0]&&(h.primaryImage?c.comparebaseProdDetailsArray[b].primaryImage=h.primaryImage:
c.comparepage_commonLogger(h.id+" primaryImage missing"))});if(this.isCatalogPurchasable){var f=this.getSessionVariable(d);f&&f.prices?(this.comparebaseProdDetailsArray[b].skuPrice=f,this.$forceUpdate()):this.getProductPrice(d).then(function(){var h=c.getSessionVariable(d);null!=h?(c.comparebaseProdDetailsArray[b].skuPrice=h.prices?h:"-",c.comparepage_commonLogger(h)):c.comparebaseProdDetailsArray[b].skuPrice="-";c.$forceUpdate()})}this.diffOptionChecked&&this.showDiffSkuData();this.hideDiffOption();
this.updatePageUrl();this.updateProductSummaryViewTitle();try{f={};f.skuID=d;var k=window.aa.createEvent("PROD_COMPARE_CAPACITY_CLICK",f);window.dispatchEvent(k)}catch(h){console.log("Error while firing Analytics call for compare Change Sku dropdown click: "+h)}this.loadingFromCookie&&(this.removeSkuFromCookie(a.target.oldsku),this.addSkuToCookie(a.target.value,this.comparebaseProdDetailsArray[b].baseProductId,!1))},setOldSkuValue:function(a){a.target.oldsku=a.target.value},updatePageUrl:function(){if(!this.isSummaryView&&
!this.isInPageView){for(var a="?ids\x3d",b=$jscomp.makeIterator(this.comparebaseProdDetailsArray),c=b.next();!c.done;c=b.next())c=c.value,a+=c.selectedSkuId+":"+c.baseProductId+",";a=a.slice(0,-1);b=this.getUtmQueryParams();window.history.replaceState("","",window.location.pathname+a+(""!=b?(""!=a?"\x26":"?")+b:""))}},openSharePopup:function(){for(var a="",b=$jscomp.makeIterator(this.comparebaseProdDetailsArray),c=b.next();!c.done;c=b.next())c=c.value,a+=c.selectedSkuId+":"+c.baseProductId+",";a=
a.slice(0,-1);this.sharePageLink=this.getDomain()+"tools/product-compare?ids\x3d"+a;this.shareEmailLink=this.getDomain()+"tools/product-compare?ids%3D"+a;document.querySelector("#compare-share-modal")&&document.querySelector("#compare-share-modal").classList&&document.querySelector("#compare-share-modal").classList.remove("hidden");try{var d=window.aa.createEvent("PROD_COMPARE_SHARE",{});window.dispatchEvent(d)}catch(f){console.log("Error while firing Analytics call for compare share button click: "+
f)}},showTooltip:function(a){if(document.querySelector(".chart-tooltip-body")&&document.querySelector(".chart-tooltip-body").classList){for(var b=document.querySelectorAll(".chart-tooltip-body"),c=0;c<b.length;c++)b[c]!=a.currentTarget.previousElementSibling&&(b[c].classList.add("hidden"),b[c].closest("tr").classList.remove("tooltip-open"));a.currentTarget.previousElementSibling.classList.toggle("hidden");a.currentTarget.closest("tr").classList.toggle("tooltip-open")}},copyToClipboard:function(){navigator.clipboard.writeText(this.sharePageLink);
document.getElementById("copiedInfo").classList.remove("hidden")},closeSharePopup:function(){document.getElementById("copiedInfo").classList.add("hidden")},openModal:function(){this.isSummaryView||this.isInPageView||document.querySelector("#compare-empty-alert").classList.remove("hidden")},openNotificationModal:function(){this.isSummaryView||this.isInPageView||document.querySelector("#compare-empty-alert1").classList.remove("hidden")},showDiffSkuData:function(){1<this.comparebaseProdDetailsArray.length?
this.diffOptionChecked?this.compareSkuDetailsArray.forEach(function(a){for(var b=!1,c=a.skuValues,d={},f=$jscomp.makeIterator(c),k=f.next();!k.done&&(d.$jscomp$loop$prop$skuArray$286=k.value,b=c[0].every(function(h){return function(l){return h.$jscomp$loop$prop$skuArray$286.includes(l)}}(d)),b);d={$jscomp$loop$prop$skuArray$286:d.$jscomp$loop$prop$skuArray$286},k=f.next());a.diffData=b?!1:!0}):this.compareSkuDetailsArray.forEach(function(a){a.diffData=!0}):1==this.comparebaseProdDetailsArray.length&&
this.compareSkuDetailsArray.forEach(function(a){a.diffData=!0})},setATCSession:function(a){sessionStorage.setItem("atcActionFromPCT",!0);window.location.href=a.target.getAttribute("data-href")},handleProductRedirectClick:function(a,b){try{var c={};c.skuID=b;var d=window.aa.createEvent("PROD_COMPARE_PRODUCT_CLICK",c);window.dispatchEvent(d)}catch(f){console.log("Error while firing Analytics call for compare page product click: "+f)}window.location.href=a.currentTarget.href},getComparePath:function(){var a=
this,b=document.querySelector("#commonUtilLoad").getAttribute("data-rootPath"),c="";this.comparebaseProdDetailsArray.forEach(function(d,f){c+=d.selectedSkuId+":"+d.baseProductId+(f+1!=a.comparebaseProdDetailsArray.length?",":"")});return b+"/tools/product-compare?ids\x3d"+c},hidePDPCompareSummarySection:function(){this.isSummaryView&&document.getElementById("ProductCompare")&&(document.getElementById("ProductCompare").classList.add("hidden"),document.getElementById("product-compare")&&(document.getElementById("product-compare").outerHTML=
""))},comparepage_commonLogger:function(a,b){-1<window.location.search.indexOf("debugComparepage\x3dtrue")&&(console.log(a),b&&console.log(b))}}},ProductCompareApp=Vue.newInstance("ProductCompare",ProductCompare),StoreProductBundle=Vue.newInstance("ProductBundlePromo",{el:"#store-product-bundle-promo",mixins:[commerceService],data:{productBundlePromoData:[],productReferencesData:{}},mounted:function(){document.getElementById("hideProductBundle")&&"true"==document.getElementById("hideProductBundle").value||
this.getCustomerChannel()&&"B2C"!=this.getCustomerChannel()?document.getElementById("product-bundle-promotion").outerHTML="":this.getCustomerChannel()&&"B2C"==this.getCustomerChannel()&&this.initProductBundleInfo()},methods:{onChange:function(a,b,c){var d=this,f=c.currentTarget.value,k=[];k.push(a+"|"+b+"|"+f);this.productBundlePromoData.forEach(function(h){h.code==a&&h.qualifyingProducts.forEach(function(l){l.products.forEach(function(p){var q=l.container,t=k.find(function(u){return u.split("|")[1]==
q});p.code==f?p.selected=!0:p.selected&&!t?(p.selected=!0,k.push(a+"|"+q+"|"+p.code)):p.selected=!1})})});this.getBundlePromo(k.join(",")).then(function(){var h=d.getSessionVariable(k.join(","));d.productBundlePromoData.forEach(function(l){l.code==a&&(l.bundleDiscountPriceData=h.bundleDiscountPriceData,l.bundlePriceData=h.bundlePriceData,l.qualifyingProducts.forEach(function(p){p.products.forEach(function(q,t){q.selected&&d.productReferencesData[q.code]&&d.productReferencesData[q.code].urlFileReference&&
(p.imageURL=d.productReferencesData[q.code].urlFileReference,p.url=d.productReferencesData[q.code].pagePath+"?sku\x3d"+q.code,p.title=q.name)})}))})})},initProductBundleInfo:function(){var a=this,b=document.querySelector("[data-defaultVariantSku]").getAttribute("data-defaultVariantSku");this.getProductPrice(b).then(function(){var c=a.getSessionVariable(b),d=[];c?c.bundlePromoId.forEach(function(f){-1==d.indexOf(f)&&d.push(f)}):document.querySelector("[data-b2cproductids]").getAttribute("data-b2cproductids").split(",").forEach(function(f){(f=
a.getSessionVariable(f))&&f.bundlePromoId.forEach(function(k){-1==d.indexOf(k)&&d.push(k)})});0<d.length?a.getProductReferences().then(function(){a.productReferencesData=a.getSessionVariable(a.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);a.getBundlePromo(d.join(",")).then(function(){d.forEach(function(f,k){f=a.getSessionVariable(f);f.promotionDetails&&(f.description+='\x3ca role\x3d"button" href\x3d"#bundle-promotion-popup-'+k+'" class\x3d"underline wd-modal-btn cursor-pointer hover:text-sd-red ml-2"\x3e'+
document.getElementById("store-product-bundle-promo").getAttribute("data-label-learnmore")+"\x3c/a\x3e");f.qualifyingProducts&&(f.qualifyingProducts.forEach(function(h){h.products.forEach(function(l,p){0==p?(l.selected=!0,a.productReferencesData[l.code]&&a.productReferencesData[l.code].urlFileReference&&(h.imageURL=a.productReferencesData[l.code].urlFileReference,h.url=a.productReferencesData[l.code].pagePath+"?sku\x3d"+l.code,h.title=h.products[0].name)):l.selected=!1})}),a.productBundlePromoData.push(f))})})}):
document.getElementById("product-bundle-promotion").classList.add("hidden")}).catch(function(){document.getElementById("product-bundle-promotion").classList.add("hidden")})},getSkuCategoriesTitle:function(a){var b="";if(this.productReferencesData&&this.productReferencesData[a])for(var c in this.productReferencesData[a].categories)b+=b?", "+this.productReferencesData[a].categories[c].data[0].title:this.productReferencesData[a].categories[[c]].data[0].title;return b?b:a},addBundleToCart:function(a,
b){var c=this,d={cartEntries:[]};this.productBundlePromoData.forEach(function(k){k.code==a&&k.qualifyingProducts.forEach(function(h){h.products.forEach(function(l){l.selected&&d.cartEntries.push(JSON.parse('{"quantity":1,"product":{"code":"'+l.code+'"}}'))})})});window.scrollTo({top:0,left:0,behavior:"smooth"});var f=document.querySelector(".cartwrapper");this.removeClass(f,"hidden");this.addClass(f,"updateCartData");this.addClass(f,"addToCartButton");f=f.querySelector(".cartShowInProgress");this.removeClass(f,
"hidden");this.addMultipleProductToCart(d).then(function(k){StoreProductCart[0].showMiniCart(b);c.$forceUpdate()})}}}),StoreResourceLibraryOptions={el:"#resource-library-component",data:function(){return{tagTitleMap:[],getWebServiceRes:[],resultsFound:!1,assetDomain:"",groupByTagsObj:{}}},mounted:function(){var a=this;null!=document.querySelector(".resourceLibraryComp")&&this.$nextTick(function(){a.init()})},methods:{init:function(){this.resourceLibraryLogger("in resource library");"undefined"!=typeof this.$refs.assetdomainmapping&&
(this.$data.assetDomainMappingJson=JSON.parse(this.$refs.assetdomainmapping.dataset.assetdomainmapping.replace(/\s+/g," ").trim()),this.techPubWebService(this.$refs.resurl.dataset.resurl,this.$refs.doctypeserviceurl.dataset.doctypeserviceurl,this.$refs.doctype.dataset.doctype,this.$refs.producttag.dataset.producttag,this.$refs.doctyperoottagid.dataset.doctyperoottagid))},techPubWebService:function(a,b,c,d,f){var k=this;this.$data.tagTitleMap=[];this.$data.getWebServiceRes=[];fetch(b).then(function(l){return l.json()}).then(function(l){k.$data.tagTitleMap=
l}).catch(function(l){console.error("Response error",l);return!0});b="2_group.1_property\x3d"+encodeURIComponent("jcr:content/metadata/cq:tags")+"\x262_group.1_property.value\x3d"+encodeURIComponent(d);var h=c.split(",");c="";for(d=0;d<h.length;d++)c=c+"group."+(d+1)+"_property\x3d"+encodeURIComponent("jcr:content/metadata/cq:tags")+"\x26group."+(d+1)+"_property.value\x3d"+encodeURIComponent(h[d])+"\x26";a=a.replace("PRODUCT-TAG-CONSTANT",b).replace("DOCUMENT-TYPE-TAG-CONSTANT",c);fetch(a).then(function(l){return l.json()}).then(function(l){k.resourceLibraryLogger("documents response : ",
l);k.$data.resultsFound=!0;0==l.hits.length&&(k.$data.resultsFound=!1);var p=JSON.stringify(l.hits),q=p;for(l=0;l<p.length;l++)q=q.replace("jcr:content/metadata/cq:tags","jcr_content_metadata_cq_tags").replace("jcr:path","jcr_path").replace("jcr:content/metadata/dc:title","jcr_content_metadata_dc_title").replace("jcr:content/metadata/Iptc4xmpExt:LocationShown","jcr_content_metadata_Iptc4xmpExt_LocationShown").replace("jcr:content/jcr:lastModified","jcr_content_jcr_lastModified");p=JSON.parse(q);k.resourceLibraryLogger("updatedJson -\x3e after modiying the property names : ",
p);for(l=0;l<p.length;l++){var t=[];for(q=0;q<p[l].jcr_content_metadata_cq_tags.length;q++)-1<p[l].jcr_content_metadata_cq_tags[q].indexOf(f)&&-1<h.indexOf(p[l].jcr_content_metadata_cq_tags[q])&&t.push(p[l].jcr_content_metadata_cq_tags[q]);p[l].jcr_content_metadata_cq_tags=t;p[l].jcr_content_metadata_dc_title=Array.isArray(p[l].jcr_content_metadata_dc_title)?p[l].jcr_content_metadata_dc_title[0]:p[l].jcr_content_metadata_dc_title}for(l=0;l<p.length;l++)if(1<p[l].jcr_content_metadata_cq_tags.length)for(q=
1;q<p[l].jcr_content_metadata_cq_tags.length;q++)p.push({jcr_path:p[l].jcr_path,jcr_content_metadata_dc_title:p[l].jcr_content_metadata_dc_title,jcr_content_metadata_cq_tags:[p[l].jcr_content_metadata_cq_tags[q]],jcr_content_metadata_Iptc4xmpExt_LocationShown:p[l].jcr_content_metadata_Iptc4xmpExt_LocationShown}),p[l].jcr_content_metadata_cq_tags.splice(q,1),q--;t=0;for(l=0;l<h.length;l++)for(q=0;q<p.length;q++)if(h[l]==p[q].jcr_content_metadata_cq_tags[0]){var u=p[q];p[q]=p[t];p[t]=u;t++}k.$data.getWebServiceRes=
p;k.$data.groupByTagsObj=k.groupByTags(k.$data.getWebServiceRes,"jcr_content_metadata_cq_tags");k.resourceLibraryLogger("Json -\x3e after group by document type and sorting : ",k.$data.groupByTagsObj);EventBus.$emit("datasheetContentLoaded",{isDataSheet:k.$data.groupByTagsObj["studio:document-type/datasheet"]})}).catch(function(l){console.error("Response error",l);return!0})},getTagsInfo:function(a){var b=this.$data.tagTitleMap.filter(function(d){return d.tagId==a}),c=this.getLocale().toLowerCase().replace("-",
"_");return b&&b[0]?b[0]["title_"+c]?b[0]["title_"+c]:b[0].title:""},getDomainForAsset:function(a){for(var b="",c=0;c<this.$data.assetDomainMappingJson.length;c++)for(var d in this.$data.assetDomainMappingJson[c])if(0==a.indexOf(this.$data.assetDomainMappingJson[c][d])){b=d;break}return b},isAssetHasUrlExtension:function(a){return-1<a.indexOf(".url")?!0:!1},isYoutubeUrl:function(a){return-1<a.indexOf("youtube")||-1<a.indexOf("youtu")||-1<a.indexOf("yout")?!0:!1},showVideoModal:function(a,b){a=document.querySelector(a.target).closest(".resource-library").querySelector(".wd-modal");
a.querySelector("iframe").setAttribute("src",b);this.addClass(document.querySelector("body"),"overflow-hidden");this.removeClass(a,"hidden")},closeVideoModal:function(a){a=document.querySelector(a.target).closest(".resource-library").querySelector(".wd-modal");var b=a.querySelector("iframe");this.addClass(a,"hidden");this.removeClass(document.querySelector("body"),"overflow-hidden");b.setAttribute("src","")},groupByTags:function(a,b){a=a.reduce(function(d,f){(d[f[b]]=d[f[b]]||[]).push(f);return d},
{});this.resourceLibraryLogger("groupByTags::",a);for(var c in a)a[c]=this.sortByDate(a[c],"jcr_content_jcr_lastModified");return a},sortByDate:function(a,b){try{return a.sort(function(c,d){return new Date(d[b])-new Date(c[b])})}catch(c){return this.resourceLibraryLogger("error while sorting ",c),a}},resourceLibraryLogger:function(a,b){-1<window.location.search.indexOf("debugResLib\x3dtrue")&&console.log("Res Library: "+a,null!=b?b:"")}}};Vue.newInstance("StoreResourceLibraryApp",StoreResourceLibraryOptions);
var spbMixins=[commerceService,StoreProductCart,compareTrayService,zinreloHelper,ProductCompareApp];null!=document.querySelector(".product-banner").querySelector(".resource-library")&&(spbMixins=[commerceService,StoreProductCart,ProductCompareApp,StoreResourceLibraryOptions,compareTrayService,zinreloHelper]);
var StoreProductBannerRedesign=Vue.newInstance("productBannerRedesign",{el:"#product-banner-component",mixins:spbMixins,data:{baseProductId:"",skuVariantCategoryMapping:[],variantCategoryOptionsString:{},skuProductIdsMappingString:{},productIds:[],defaultVariantSku:"",allCategories:[],allvariantCategories:[],skuProductIdsMapping:{},skuList:[],productqtySkuMap:{},currentSku:"",product:{quantity:1},hashUrl:!1,variantCategoryOptions:[],primaryCategoryGroup:"",secondaryCategoryGroup:"",prevSelectedSkuCategories:[],
activeSkuObj:{},variantCategoryOptionsNewView:[],ddItemSelected:{},ddItemSelectedTitles:{},itemSelected:{},viewUpdated:!1,currentSkuCategoryOptions:[],currentSkuSpecificProductObject:{},productReferences:{},inventory:{prices:{volumePrice:{},list:{},sale:{}},limitedTimeToCancel:-1},isCommerceServiceIssue:!1,isCatalogPurchasable:!1,affirmAllowed:!1,checkInventoryStatusAndSelectDefaultVariantFlag:!1,digitalattributes:{},digitalAttributesObject:{},currentSkuDigitalAttributesArray:[],productAttributeJsonString:"",
techSpecsSkuMapping:{},productAttributesJson:{},techSpecList:[],userTypeSkuList:[],currentSkuProuctResourceArray:[],productResourceJson:{},productInvalid:!1,productStockUnavailable:!1,sessionRelatedProducts:[],relatedProducts:{},active:!1,customPromotionInfo:{},customResellerPromotionInfo:[],customPromotions:{},attBelowAddToCartButtonPromo:"",attBelowResellerButtonPromo:"",productType:"",notifyMeSuccess:!1,promotionInfoPerProduct:{},wtbPagePath:"",email:"",platformCommerceURL:"",requestQuoteFormField:{},
uuid:"",name:"",firstName:"",lastName:"",company:"[Not Provided]",locale:"",requestQuoteSuccess:"false",isCandyrackEnabled:!1,activeTieredPrice:0,qvActiveSkuObj:{},backOrderText:"",requestQuoteFailure:!1,requestQuoteDate:{value:"",currentDate:""},skuWarrantyTitleMappingString:{},currentSkuWarrantyTitle:"",skuTitleMappingString:{},skuVariantTagDataMappingString:{},pdpMetaTitleDataMappingString:{},currentSkuTitle:"",variantTagData:"",showRequestQuoteModal:!1,offerSchemaSkuList:[],variantOfferSchema:{},
currentPageRelativeUrl:"",currentPageSelectorURLWithQP:"",suiteTitle:"",suiteDescription:"",enableProductGroupSchema:!1,showBusinessSignUpPopup:"",isShowB2bPopUpEnabled:!1,isjapanSite:!1,isProductImageComponentInitiated:!1,currentServiceProductDetails:[],serviceProducts:{},selectedServiceProduct:"",previouslySelectedServiceProduct:"",enableDRS:!1,enableMOQ:!1,defaultMinimumQuantity:1,isMoqCheckValid:!0,enableNCNR:!1,showNcnrModal:!1,ncnrCheckBox:!1,activateNcnrAcceptButton:!1,dropShipNcnrATCObj:{},
loyaltyPoints:0,showLoyaltyPoints:!1,loyaltyPointsSvgIcon:"/content/dam/sandisk/en-us/portal-assets/icons/LoyaltyTier.svg",showToolTip:!1,currentProductImage:"",colorVarientWithsku:"",notSelectedLabelTxt:"",selectedLabelTxt:"",isDataSheet:!1},watch:{ncnrCheckBox:function(){this.activateNcnrAcceptButton=this.ncnrCheckBox?!0:!1;this.$forceUpdate()}},mounted:function(){var a=this;this.activatePDP();window.addEventListener("hashchange",function(b){});EventBus.$on("datasheetContentLoaded",function(b){a.getRequestDatasheet(a.$data.currentSku,
b.isDataSheet)})},created:function(){window.addEventListener("resize",this.activatePDPSlide)},destroyed:function(){window.removeEventListener("resize",this.activatePDPSlide)},methods:{activatePDP:function(){var a=this;this.isCatalogPurchasable=this.getPurchasableCatalog();this.requestQuoteDate.value=this.getCurrenDateInWDFormat().toString();this.requestQuoteDate.currentDate=this.getCurrenDateInWDFormat().toString();this.wtbPagePath=this.rewritePageURL(this.getWTBPagePath());this.isCandyrackEnabled=
this.$refs.candyrackEnabled.dataset.candyrackenabled;this.platformCommerceURL=this.getPlatformCommerceURL();this.$data.baseProductId=this.$refs.baseProductId.dataset.baseproductid;this.$data.defaultVariantSku=this.$refs.defaultVariantSku.dataset.defaultvariantsku;this.backOrderText=this.$refs.backOrderText.dataset.backordertext;this.isShowB2bPopUpEnabled=this.$refs.showB2BLoginPopup.dataset.showb2bloginpopup;this.skuWarrantyTitleMappingString=JSON.parse(this.$refs.skuWarrantyTitleMappingString.dataset.skuwarrantytitlemappingstring);
this.isjapanSite="ja-jp"==this.getLocale().toLowerCase()?!0:!1;this.enableDRS=void 0!=this.$refs.enableDRS&&void 0!=this.$refs.enableDRS.dataset.enabledrs&&"true"==this.$refs.enableDRS.dataset.enabledrs?!0:!1;this.enableMOQ=this.$refs.enableMOQ.dataset.enablemoq;this.enableNCNR=this.$refs.enableNCNR.dataset.enablencnr;this.$data.notSelectedLabelTxt=this.$refs.variantcategorynotselected.dataset.notselectedlabel;this.$data.selectedLabelTxt=this.$refs.variantcategoryselected.dataset.selectedlabel;this.enableDRS&&
(this.serviceProducts=JSON.parse(this.$refs.serviceProdReferences.dataset.serviceprodreferences));try{this.skuTitleMappingString=JSON.parse(this.$refs.skuTitleMappingString.dataset.skutitlemappingstring.replace(/[\r\n]/gm,"")),this.skuVariantTagDataMappingString=JSON.parse(this.$refs.skuVariantTagDataMappingString.dataset.skuvarianttagdatamappingstring.replace(/[\r\n]/gm,"")),this.pdpMetaTitleDataMappingString=JSON.parse(this.$refs.pdpMetaTitleDataMappingString.dataset.pdpmetatitledatamappingstring.replace(/[\r\n]/gm,
""))}catch(d){console.error("Error while parsing the sku title mapping json",d)}this.currentPageRelativeUrl=this.$refs.currentPageRelativeUrl.dataset.currentpagerelativeurl;this.currentPageSelectorURLWithQP=this.$refs.currentPageSelectorURLWithQP.dataset.currentpageselectorurlwithqp;this.enableProductGroupSchema="true"===this.$refs.enableProductGroupSchema.dataset.enableproductgroupschema;if(this.isB2BUser())this.$data.skuVariantCategoryMapping=JSON.parse(this.$refs.b2bSkuVariantCategoryMapping.dataset.b2bskuvariantcategorymapping),
this.$data.skuProductIdsMappingString=JSON.parse(this.$refs.b2bSkuProductIdsMappingString.dataset.b2bskuproductidsmappingstring),this.$data.productIds=this.$refs.b2bProductIds.dataset.b2bproductids,this.productIds&&(this.$data.variantCategoryOptionsString=JSON.parse(this.$refs.b2bvariantCategoryOptionsString.dataset.b2bvariantcategoryoptionsstring)),this.populateUserDetailForRequestQuote(),this.requestQuoteFormField=JSON.parse(this.$refs.requestQuoteFormFields.dataset.requestquoteformfields);else{this.$data.skuVariantCategoryMapping=
JSON.parse(this.$refs.b2cSkuVariantCategoryMapping.dataset.b2cskuvariantcategorymapping);this.$data.skuProductIdsMappingString=JSON.parse(this.$refs.b2cSkuProductIdsMappingString.dataset.b2cskuproductidsmappingstring);this.$data.productIds=this.$refs.b2cProductIds.dataset.b2cproductids;this.$data.variantCategoryOptionsString=JSON.parse(this.$refs.b2cvariantCategoryOptionsString.dataset.b2cvariantcategoryoptionsstring);try{this.$data.variantOfferSchema=JSON.parse(this.$refs.variantOfferSchema.dataset.variantofferschema.replace(/[\r\n]/gm,
""))}catch(d){console.error("Error while parsing the promotion json",d)}}this.$data.productType=this.$refs.productType.dataset.producttype;this.getProductReferences().then(function(){a.productReferences=a.getSessionVariable(a.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);a.$data.attBelowResellerButtonPromo=a.productReferences[a.$data.baseProductId].attBelowResellerButtonPromo;a.$data.attBelowAddToCartButtonPromo=a.productReferences[a.$data.baseProductId].attBelowAddToCartButtonPromo;var d=a.getSessionVariable(a.$data.COMMERCE_CONSTANTS.CUSTOM_PROMOTIONS);
d?(a.$data.customPromotions=d,a.$data.customPromotions[a.$data.attBelowAddToCartButtonPromo]&&(a.$data.customPromotionInfo=a.$data.customPromotions[a.$data.attBelowAddToCartButtonPromo]),a.$data.attBelowResellerButtonPromo&&a.$data.attBelowResellerButtonPromo.split(",").forEach(function(f){a.$data.customPromotions[f]&&a.$data.customResellerPromotionInfo.push(a.$data.customPromotions[f])})):a.getPromotionsJson().then(function(){var f=a.getSessionVariable(a.$data.COMMERCE_CONSTANTS.CUSTOM_PROMOTIONS);
f&&(a.$data.customPromotions=f,a.$data.customPromotions[a.$data.attBelowAddToCartButtonPromo]&&(a.$data.customPromotionInfo=a.$data.customPromotions[a.$data.attBelowAddToCartButtonPromo]),a.$data.attBelowResellerButtonPromo&&a.$data.attBelowResellerButtonPromo.split(",").forEach(function(k){a.$data.customPromotions[k]&&a.$data.customResellerPromotionInfo.push(a.$data.customPromotions[k])}))})});var b=this.getCookie(this.COMMERCE_CONSTANTS.BUSINESS_SIGNUP_COOKIE);this.showBusinessSignUpPopup="string"===
typeof b?decodeURIComponent(b):"";this.$data.allvariantCategories=[];void 0!=this.$data.skuVariantCategoryMapping&&this.$data.skuVariantCategoryMapping.forEach(function(d){a.$data.allvariantCategories=a.$data.allvariantCategories.concat(d.categories)});this.$data.allvariantCategories=this.$data.allvariantCategories.filter(function(d,f){return a.$data.allvariantCategories.indexOf(d)==f});this.$data.skuProductIdsMapping=this.$data.skuProductIdsMappingString;"undefined"!==typeof this.$data.productIds?
this.$data.skuList=this.$data.productIds.split(","):this.skuList.push(this.$data.defaultVariantSku);this.skuList==[]||this.skuList.includes(this.defaultVariantSku)?this.$data.currentSku=this.$data.defaultVariantSku:this.$data.currentSku=this.skuList[0];this.$data.skuList&&0<this.$data.skuList.length&&this.$data.skuList.forEach(function(d){a.$data.productqtySkuMap[d]=a.$data.product.quantity});b=new URLSearchParams(window.location.search);null!=b.get("sku")&&(b=b.get("sku"),this.$data.skuProductIdsMapping.hasOwnProperty(b)&&
(this.$data.hashUrl=!0,this.$data.currentSku=b));this.currentSkuWarrantyTitle=this.skuWarrantyTitleMappingString[this.currentSku];this.currentSkuTitle=this.skuTitleMappingString[this.currentSku];this.addVariantTagData();this.$data.variantCategoryOptions=this.$data.variantCategoryOptionsString;0<this.$data.variantCategoryOptions.length&&(this.$data.primaryCategoryGroup=this.$data.variantCategoryOptions[0].variantCategory);1<this.$data.variantCategoryOptions.length&&(this.$data.secondaryCategoryGroup=
this.$data.variantCategoryOptions[1].variantCategory);setTimeout(function(){a.updateVariantCategoriesView(a.$data.currentSku,null);a.updateViewForVariant(a.$data.currentSku,!0)},1);this.activatePDPSlide();var c=!1;767<window.screen.width?this.getProductReferences().then(function(){a.productReferences=a.getSessionVariable(a.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);a.processRelatedProducts()}):window.addEventListener("scroll",function(d){!c&&0<window.scrollY&&(c=!0,a.getProductReferences().then(function(){a.productReferences=
a.getSessionVariable(a.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);a.processRelatedProducts()}))});this.updateBVReviewToLoadLater();this.attachEventOnFocusOutForProductQuantity();document.querySelectorAll(".content").forEach(function(d){var f=d.querySelector("p");if(f){var k=f.innerHTML;if(150<f.innerText.length){var h=function(q){if(!(150<=p))if(q.nodeType===Node.TEXT_NODE){var t=150-p;q.textContent.length>t?(l+=q.textContent.substring(0,t),p+=t):(l+=q.textContent,p+=q.textContent.length)}else q.nodeType===
Node.ELEMENT_NODE&&(t=q.cloneNode(!1),l+=t.outerHTML.substring(0,t.outerHTML.indexOf("\x3e")+1),Array.from(q.childNodes).forEach(h),l+="\x3c/"+q.nodeName.toLowerCase()+"\x3e")};document.createRange().selectNodeContents(f);var l="",p=0;Array.from(f.childNodes).forEach(h);d.closest(".inheritPara").querySelector("#seeMore").classList.remove("hidden");d.closest(".inheritPara").querySelector("#ellipsis").classList.remove("hidden");d.innerHTML=l}else d.innerHTML=k,d.closest(".inheritPara").querySelector("#seeMore").classList.add("hidden"),
d.closest(".inheritPara").querySelector("#ellipsis").classList.add("hidden")}});this.addLoggedInUserAndPurchasableClasstoBody();this.addOverviweIdToResponsiveGrid();this.hideEmptySections();setTimeout(function(){a.attachEventOnclickOfBusinessPricing()},1E3)},updateVariantCategoriesView:function(a,b){var c=this;this.$data.prevSelectedSkuCategories=[];null!=b&&(document.querySelectorAll("li[data-variant-category].active-variant-axis").forEach(function(h){h.getAttribute("data-variant-category")!=b&&
c.$data.prevSelectedSkuCategories.push(h.getAttribute("data-variant-category"))}),document.querySelectorAll("li[data-variant-category].vc-active").forEach(function(h){h.getAttribute("data-variant-category")!=b&&c.$data.prevSelectedSkuCategories.push(h.getAttribute("data-variant-category"))}),document.querySelectorAll("option[data-variant-category].active-variant-axis").forEach(function(h){h.getAttribute("data-variant-category")!=b&&c.$data.prevSelectedSkuCategories.push(h.getAttribute("data-variant-category"))}));
null==a&&(this.$data.currentSku=this.findSku(this.$data.prevSelectedSkuCategories,b));this.$data.activeSkuObj=this.$data.skuVariantCategoryMapping.filter(function(h){if(h.sku==c.$data.currentSku)return h.categories})[0];var d=[];this.$data.skuVariantCategoryMapping.forEach(function(h){d=d.concat(h.categories)});d=d.filter(function(h,l){return d.indexOf(h)==l});var f=this.$data.activeSkuObj.categories;null==b&&(b=f[0]);var k={};f.forEach(function(h){k[h]=[];c.$data.skuVariantCategoryMapping.forEach(function(l,
p){l=c.$data.skuVariantCategoryMapping[p].categories;-1<l.indexOf(h)&&(k[h]=k[h].concat(l))});null!=c.$data.primaryCategoryGroup&&-1<h.indexOf(c.$data.primaryCategoryGroup)&&(c.$data.selectedPrimaryCategory=h);null!=c.$data.secondaryCategoryGroup&&-1<h.indexOf(c.$data.secondaryCategoryGroup)&&(c.$data.selectedSecondaryCategory=h)});this.$data.variantCategoryOptions.map(function(h){h.children.map(function(l){-1<f.indexOf(l.variantCategory)?l.viewType=1:1<f.length?f.forEach(function(p){l.variantCategory.substr(0,
l.variantCategory.indexOf("/"))!=p.substr(0,p.indexOf("/"))&&(-1<k[p].indexOf(l.variantCategory)?l.viewType=0:l.viewType=-1)}):l.viewType=0})});this.$data.variantCategoryOptionsNewView=this.$data.variantCategoryOptions;this.$data.variantCategoryOptionsNewView.map(function(h,l){0<l?h.children.map(function(p,q){"color"==h.displayType&&(h.variantCategoryLabel=1==p.viewType?h.variantCategoryLabel.split(":")[0]+": \x3cb\x3e"+p.variantCategoryLabel+"\x3c/b\x3e":h.variantCategoryLabel,p.img=p.img?p.img:
c.getColourVariantImage(p.variantCategory),p.alt=p.alt?p.alt:c.getColourVariantImageAltText(p.variantCategory));-1<f.indexOf(p.variantCategory)&&(c.$data.ddItemSelected[l]=p.variantCategory,c.$data.ddItemSelectedTitles[l]=p.variantCategoryLabel,c.itemSelected[l]=p.variantCategory);-1<f.indexOf(p.variantCategory)?p.showFlag=1:1<f.length?1==l?-1<k[c.$data.selectedPrimaryCategory].indexOf(p.variantCategory)?p.showFlag=0:p.showFlag=-1:-1<k[c.$data.selectedPrimaryCategory].indexOf(p.variantCategory)&&
-1<k[c.$data.selectedSecondaryCategory].indexOf(p.variantCategory)?p.showFlag=0:p.showFlag=-1:p.showFlag=0}):h.children.map(function(p,q){"color"==h.displayType&&(h.variantCategoryLabel=1==p.viewType?h.variantCategoryLabel.split(":")[0]+": \x3cb\x3e"+p.variantCategoryLabel+"\x3c/b\x3e":h.variantCategoryLabel,p.img=p.img?p.img:c.getColourVariantImage(p.variantCategory),p.alt=p.alt?p.alt:c.getColourVariantImageAltText(p.variantCategory));-1<f.indexOf(p.variantCategory)&&(c.$data.ddItemSelected[l]=p.variantCategory,
c.$data.ddItemSelectedTitles[l]=p.variantCategoryLabel,c.itemSelected[l]=p.variantCategory);p.showFlag=p.variantCategory==c.$data.selectedPrimaryCategory?1:0})});this.getRequestDatasheet(a||this.$data.currentSku)},getRequestDatasheet:function(a,b){a=document.querySelector("#support-resource-carousel-"+a+' [data-datasheet\x3d"true"]');var c=document.querySelector('.docTypeContainer[data-datasheet\x3d"true"]');this.$data.isDataSheet=b||a||c?!0:!1},getColorVariantWithSku:function(){var a=this;this.colorVarientWithsku||
(this.colorVarientWithsku=this.$data.skuVariantCategoryMapping.map(function(b){var c=b.categories.findIndex(function(d){return-1!=d.indexOf("variant-category:vc-color")});return JSON.parse('{"sku":"'+b.sku+'","color":"'+b.categories[c]+'"}')}),this.colorVarientWithsku=this.colorVarientWithsku.filter(function(b,c){return c===a.colorVarientWithsku.findIndex(function(d){return b.color===d.color})}));return this.colorVarientWithsku},getColourVariantImage:function(a){var b=this.getColorVariantWithSku().filter(function(c){return c.color==
a})[0].sku;b=document.querySelector("div[data-sku\x3d'"+b+"']").querySelector(".img-fluid").hasAttribute("src")?document.querySelector("div[data-sku\x3d'"+b+"']").querySelector(".img-fluid").getAttribute("src"):document.querySelector("div[data-sku\x3d'"+b+"']").querySelector(".img-fluid").getAttribute("data-splide-lazy");return b.substring(0,b.length-20)+".wdthumb.48.48.webp"},getColourVariantImageAltText:function(a){var b=this.getColorVariantWithSku().filter(function(c){return c.color==a})[0].sku;
return document.querySelector("div[data-sku\x3d'"+b+"']").querySelector(".img-fluid").hasAttribute("alt")?document.querySelector("div[data-sku\x3d'"+b+"']").querySelector(".img-fluid").getAttribute("alt"):document.querySelector("div[data-sku\x3d'"+b+"']").querySelector(".img-fluid").getAttribute("aria-label")},findSku:function(a,b){var c=[];this.$data.skuVariantCategoryMapping.filter(function(d,f){-1<d.categories.indexOf(b)&&(d.count=0,c.push(d))});1<c.length&&(c.forEach(function(d,f){d=d.categories.filter(function(k){return-1<
a.indexOf(k)});c[f].count=d.length}),c.sort(function(d,f){return f.count-d.count}));return c[0].sku},handleVariantCategoryClick:function(a){var b=this;try{var c=window.aa.createEvent("TRIGGER_VIEW_PDP",{});window.dispatchEvent(c)}catch(d){console.log("Error while triggering analytics TRIGGER_VIEW_PDP event")}this.updateVariantCategoriesView(null,a);this.updateViewForVariant(this.$data.currentSku,!1);this.activatePDPSlide();setTimeout(function(){document.querySelectorAll(".variant-category-select").forEach(function(d){b.spb_commonLogger("updating dropdown with",
b.$data.ddItemSelected[d.getAttribute("data-variant-category-number")]);document.createEvent("Event").initEvent("change",!1,!0)});null!=document.querySelector("ul.variant-category-container")&&(document.querySelector("ul.variant-category-container").querySelector("li").querySelector("a, button").setAttribute("tabindex","-1"),document.querySelector("ul.variant-category-container").querySelector("li.active").querySelector("a, button").setAttribute("tabindex","0"))});this.productInvalid=!1;this.product.quantity=
this.productqtySkuMap[this.currentSku];this.isB2BUser()&&this.updateTieredPricing();this.currentSkuWarrantyTitle=this.skuWarrantyTitleMappingString[this.currentSku];this.currentSkuTitle=this.skuTitleMappingString[this.currentSku];a=null;document.title.includes("|")&&(a=document.title.substring(document.title.indexOf("|")-1,document.title.length));document.title=this.getUnEscapedHTMLContent(this.pdpMetaTitleDataMappingString[this.currentSku]);null!=a&&(document.title+=a,document.querySelector('meta[name\x3d"twitter:title"]').setAttribute("content",
document.title),document.querySelector('meta[property\x3d"og:title"]').setAttribute("content",document.title));this.addVariantTagData();this.updateProductSummaryView();this.$forceUpdate()},addVariantTagData:function(){this.variantTagData=this.getUnEscapedHTMLContent(this.skuVariantTagDataMappingString[this.currentSku]);0<document.querySelectorAll("#subNavVariantTagData").length&&(this.variantTagData?document.querySelectorAll("#subNavVariantTagData span")[0].innerText=this.variantTagData:document.querySelectorAll("#subNavVariantTagData")[0].classList.add("hidden"))},
updateViewForVariant:function(a,b){var c=this;this.$data.viewUpdated=!0;if(this.$data.hashUrl||!b){for(var d=document.querySelectorAll("div[data-sku].active"),f=0;f<d.length;f++)d[f].classList.add("hidden"),d[f].classList.remove("active");d=document.querySelectorAll("div[data-sku\x3d'"+a+"']");for(f=0;f<d.length;f++)d[f].classList.add("active"),d[f].classList.remove("hidden")}d=new URLSearchParams(window.location.search);d.set("sku",a);d=""!=d.toString()?"?"+decodeURIComponent(d.toString()):"";history.replaceState("",
"",window.location.pathname+d);document.querySelectorAll("div.component-product-bv")&&0<document.querySelectorAll("div.component-product-bv").length&&document.querySelectorAll("div.component-product-bv").forEach(function(l){if(l.querySelectorAll("div.rating_reviews")&&0<l.querySelectorAll("div.rating_reviews").length){l=l.querySelector("div.rating_reviews").children;for(var p=0;p<l.length;p++)l[p].setAttribute("data-bv-product-id",a),l[p].hasAttribute("bv-product-id")&&l[p].setAttribute("bv-product-id",
a)}});document.querySelector("div.component-product-bv")&&document.querySelector("div.component-product-bv").querySelectorAll("div.rating_reviews")&&0<document.querySelector("div.component-product-bv").querySelectorAll("div.rating_reviews").length&&this.isB2BUser()&&document.querySelectorAll("div.component-product-bv").forEach(function(l){null!==l.closest("section.component-accordian-text")&&(l.closest("section.component-accordian-text").outerHTML="")});var k=!1;d=sessionStorage.getItem("atcActionFromPCT");
767<window.screen.width||!b||d?this.getPriceFrmInventory():(this.getPriceFrmInventory(),window.addEventListener("scroll",function(l){!k&&0<window.scrollY&&(k=!0,c.attachEventsForModalAfterPrice())}));if(this.isB2BUser()&&this.isLoyaltyProgramEnabled){var h=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.USER_DETAILS);null==h?this.getUser().then(function(){h=c.getSessionVariable(c.COMMERCE_CONSTANTS.USER_DETAILS);c.initZinreloApi(h)}):this.initZinreloApi(h)}try{window.aa.updateUtagProductVariables(a)}catch(l){}},
attachEventsForModalAfterPrice:function(){var a=document.querySelector(".product-price"),b=!1;(new MutationObserver(function(c){b||(initSiteRedesign(),b=!0)})).observe(a,{subtree:!0,childList:!0})},getPriceFrmInventory:function(){var a=this;this.$data.inventory=!1;this.$data.isCommerceServiceIssue=!1;this.spb_commonLogger("in getPriceFrmInventory...");this.initOfferSchema();if(this.$data.isCatalogPurchasable){this.spb_commonLogger("catalog is purchasable");this.spb_commonLogger("getProductPrice from API for: ",
this.$data.productIds);if(this.enableDRS)for(var b=this.$data.productIds.split(","),c=0;c<b.length;c++)this.serviceProducts[b[c]]&&0<this.serviceProducts[b[c]].length&&(this.$data.productIds=this.$data.productIds+","+this.serviceProducts[b[c]].join(","));if(null==this.getSessionVariable(this.$data.currentSku)||null==this.getSessionVariable(this.$data.currentSku).prices)this.getProductPrice(this.$data.productIds).then(function(){a.spb_commonLogger("product banner - got product price");a.$data.isCommerceServiceIssue=
!1;a.$data.inventory=a.getSessionVariable(a.$data.currentSku);null!=a.$data.inventory&&null!=a.$data.inventory.prices?a.productSubNavPriceUpdate():(document.getElementById("productPageSubNavPricePipeSymbol").innerHTML="",document.getElementById("productPageSubNavPrice").innerHTML="");a.spb_commonLogger("current sku \x3e\x3e "+a.$data.currentSku,sessionStorage.getItem(a.$data.currentSku));if(null==a.$data.inventory||null==a.$data.inventory.productLifeCycle)a.$data.isCommerceServiceIssue=!0;a.enableDRS&&
a.updateProductServiceData();a.initAffirmMessage();a.initOfferSchema();a.showWTB();a.isB2BUser()&&(a.updateMOQData(),a.changeListPriceAccordingToVolume(0));a.triggerAnalyticsProductViewEvent(a.currentSku,a.inventory);a.spb_commonLogger("current sku inventory:",a.$data.inventory);a.$forceUpdate();a.triggerATCclickEvent()}).catch(function(d){a.spb_commonLogger("product banner - Rejection from commerce service",d);a.$data.inventory=null;a.$data.isCommerceServiceIssue=!0;a.showWTB();a.$forceUpdate()});
else{this.$data.isCommerceServiceIssue=!1;this.$data.inventory=this.getSessionVariable(this.$data.currentSku);this.productSubNavPriceUpdate();if(null==this.$data.inventory||null==this.$data.inventory.productLifeCycle)this.$data.isCommerceServiceIssue=!0;this.enableDRS&&this.updateProductServiceData();this.initAffirmMessage();this.initOfferSchema();this.showWTB();this.isB2BUser()&&(this.updateMOQData(),this.changeListPriceAccordingToVolume(0));this.triggerAnalyticsProductViewEvent(this.currentSku,
this.inventory);this.spb_commonLogger("current sku inventory:",this.$data.inventory);this.$forceUpdate();this.triggerATCclickEvent()}}else this.initOfferSchema(),this.showWTB(),this.triggerAnalyticsProductViewEvent(this.currentSku,this.inventory),this.spb_commonLogger("catalog is not purchasable")},triggerATCclickEvent:function(){sessionStorage.getItem("atcActionFromPCT")&&(sessionStorage.removeItem("atcActionFromPCT"),setTimeout(function(){document.querySelector(".addToCartBtn")&&document.querySelector(".addToCartBtn").click()},
500))},updateMOQData:function(){this.enableMOQ&&(this.product.quantity=this.inventory.isDropShipProduct&&0<this.inventory.casePackQuantity?this.calculateDefaultOrderQuantity(this.inventory.minOrderQuantity,this.inventory.casePackQuantity):this.inventory.minOrderQuantity,this.updateProductQuantitySkuMap(),this.defaultMinimumQuantity=this.product.quantity)},calculateDefaultOrderQuantity:function(a,b){var c=a%b;return 0===c?a:this.defaultMinimumQuantity=a+(b-c)},checkMoqValidity:function(){this.isMoqCheckValid=
this.inventory.isDropShipProduct?this.product.quantity<this.inventory.minOrderQuantity||0!=this.product.quantity%this.inventory.casePackQuantity?!1:!0:this.product.quantity<this.inventory.minOrderQuantity?!1:!0;this.$forceUpdate()},showWTB:function(){var a=document.querySelector(".store-product-wtb");this.removeClass(a,"hidden")},initOfferSchema:function(){this.enableProductGroupSchema?this.newInitOfferSchema():this.oldInitOfferSchema()},newInitOfferSchema:function(){var a=this;this.spb_commonLogger("in newInitOfferSchema...");
this.suiteTitle=this.$refs.suiteTitle.dataset.suitetitle;this.suiteDescription=this.$refs.suiteDescription.dataset.suitedescription;for(var b={"@context":"http://schema.org","@type":"ProductGroup",name:this.suiteTitle||document.title.substring(0,document.title.indexOf("|")).trim(),description:this.suiteDescription||(document.querySelector("meta[name\x3d'description']")?document.querySelector("meta[name\x3d'description']").getAttribute("content"):""),url:this.currentPageSelectorURLWithQP,"@id":this.currentPageSelectorURLWithQP,
brand:{"@type":"Brand",name:""},hasVariant:[]},c=0,d=$jscomp.makeIterator(Object.entries(this.variantOfferSchema)),f=d.next();!f.done;f=d.next())if(f=f.value,2==f.length){this.spb_commonLogger("variantOfferSchema item \x3d\x3e",f);var k=this.currentPageRelativeUrl+"?sku\x3d"+f[0],h=this.getSessionVariable(f[0]);k=this.getOfferSchema(h,f[1].title,k,f[1].primaryProductAsset,f[1].colorTitle,f[0],f[1].brandTitle,f[1].description,f[1].upc);0==c&&(b.brand.name=f[1].brandTitle,c++);this.spb_commonLogger("productJson \x3d\x3e",
k);null!=k&&b.hasVariant.push(k)}this.createSchemaTag(b);this.getBVReview().then(function(l){b.aggregateRating={"@type":"AggregateRating",itemReviewed:{"@type":"IndividualProduct",name:b.name},ratingValue:l.ratingValue,reviewCount:l.reviewCount,bestRating:l.bestRating};a.createSchemaTag(b)}).catch(function(l){a.spb_commonLogger("Error in BV Service",l)})},oldInitOfferSchema:function(){this.spb_commonLogger("in oldInitOfferSchema...");for(var a={"@context":"http://schema.org","@type":"ProductGroup",
name:"",description:"",url:"","@id":this.currentPageSelectorURLWithQP,brand:{},hasVariant:[]},b=0,c=$jscomp.makeIterator(Object.entries(this.variantOfferSchema)),d=c.next();!d.done;d=c.next()){var f=d.value;if(2==f.length){this.spb_commonLogger("variantOfferSchema item \x3d\x3e",f);d=this.currentPageRelativeUrl+"?sku\x3d"+f[0];var k=this.offerSchema(f[1].title,d,f[1].primaryProductAsset,f[1].colorTitle,f[0],f[1].brandTitle,f[1].description,f[1].upc);if(0==b){a.name=document.title.substring(0,document.title.indexOf("|")).trim();
a.description=document.querySelector("meta[name\x3d'description']")?document.querySelector("meta[name\x3d'description']").getAttribute("content"):"";var h={"@type":"Brand"};h.name=f[1].brandTitle;a.url=this.currentPageRelativeUrl;a.brand=h;b++}(f=this.getSessionVariable(f[0]))&&f.prices&&k&&(k.offers||(k.offers=[]),k.offers&&!Array.isArray(k.offers)&&(this.spb_commonLogger("Warning: offers was an object, converting to array",k.offers),k.offers=[]),this.spb_commonLogger("offers array",k.offers),k.offers.push({"@type":"Offer",
url:d,priceCurrency:f.prices.sale.currencyIso,price:f.prices.sale.value,availability:"inStock"===f.stockStatus?"http://schema.org/InStock":"http://schema.org/OutOfStock",itemCondition:"http://schema.org/NewCondition"}));this.spb_commonLogger("productJson \x3d\x3e",k);null!=k&&a.hasVariant.push(k)}}try{var l=document.createElement("script");l.setAttribute("nonce",document.getElementById("commonUtilLoad").getAttribute("data-nonceKey"));l.setAttribute("type","application/ld+json");var p=document.createTextNode(JSON.stringify(a));
l.appendChild(p);document.querySelector(".product-banner").appendChild(l)}catch(q){console.log("Error while creating script tag for schema")}},createSchemaTag:function(a){try{var b=document.getElementById("product-group-schema-script");b||(b=document.createElement("script"),b.id="product-group-schema-script",b.setAttribute("nonce",document.getElementById("commonUtilLoad").getAttribute("data-nonceKey")),b.setAttribute("type","application/ld+json"),document.head.appendChild(b));b.text=JSON.stringify(a);
this.spb_commonLogger("ProductGroup Schema injected/updated in head.")}catch(c){console.error("Error while creating/updating script tag for schema",c)}},getBVReview:function(){var a=this,b=document.getElementById("commerceLoad"),c=b.getAttribute("data-enableBV"),d=getCookie("Channel"),f=null!=document.getElementById("hideProductReviews")?document.getElementById("hideProductReviews").value:"",k=Q.defer();"true"==c&&"B2B"!=d&&"true"!=f&&b.getAttribute("data-bv-product-api-url")?(b=b.getAttribute("data-bv-product-api-url")+
this.currentSku,fetch(b,{method:"GET",xhrFields:{withCredentials:!0}}).then(function(h){return h.json()}).then(function(h){if(h){var l={};l.ratingValue=Math.round(10*h.Results[0].ProductStatistics.ReviewStatistics.AverageOverallRating)/10;l.reviewCount=h.Results[0].ProductStatistics.ReviewStatistics.TotalReviewCount;l.bestRating=h.Results[0].ProductStatistics.ReviewStatistics.OverallRatingRange;k.resolve(l)}else a.spb_commonLogger("No data in BV API call",error),k.reject()}).catch(function(h){a.spb_commonLogger("Error in BV Service",
h);k.reject()})):k.reject();return k.promise},updateProductServiceData:function(){var a=this;this.currentServiceProductDetails=[];this.selectedServiceProduct="";0<this.serviceProducts[this.currentSku].length&&this.getProductReferences().then(function(){a.productReferences=a.getSessionVariable(a.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);for(var b={},c=0;c<a.serviceProducts[a.currentSku].length;b={$jscomp$loop$prop$inventory$288:b.$jscomp$loop$prop$inventory$288,$jscomp$loop$prop$serviceProductSkusorCurrentSku$289:b.$jscomp$loop$prop$serviceProductSkusorCurrentSku$289,
$jscomp$loop$prop$serviceProductObject$290:b.$jscomp$loop$prop$serviceProductObject$290},c++)b.$jscomp$loop$prop$serviceProductSkusorCurrentSku$289=a.serviceProducts[a.currentSku][c],b.$jscomp$loop$prop$serviceProductObject$290={},b.$jscomp$loop$prop$inventory$288=a.getSessionVariable(b.$jscomp$loop$prop$serviceProductSkusorCurrentSku$289),a.spb_commonLogger("service product sku inventory",b.$jscomp$loop$prop$inventory$288),null==b.$jscomp$loop$prop$inventory$288||null==b.$jscomp$loop$prop$inventory$288.prices?
a.getProductPrice(b.$jscomp$loop$prop$serviceProductSkusorCurrentSku$289).then(function(d){return function(){d.$jscomp$loop$prop$inventory$288=a.getSessionVariable(d.$jscomp$loop$prop$serviceProductSkusorCurrentSku$289);!d.$jscomp$loop$prop$inventory$288.purchasable||"Active"!=d.$jscomp$loop$prop$inventory$288.productLifeCycle||"inStock"!=d.$jscomp$loop$prop$inventory$288.stockStatus&&"lowStock"!=d.$jscomp$loop$prop$inventory$288.stockStatus?a.spb_commonLogger("service product - check inventory",
d.$jscomp$loop$prop$serviceProductSkusorCurrentSku$289):(d.$jscomp$loop$prop$serviceProductObject$290.sku=d.$jscomp$loop$prop$serviceProductSkusorCurrentSku$289,d.$jscomp$loop$prop$serviceProductObject$290.title=null!=a.productReferences[d.$jscomp$loop$prop$serviceProductSkusorCurrentSku$289]?a.productReferences[d.$jscomp$loop$prop$serviceProductSkusorCurrentSku$289].variantTitle:"",d.$jscomp$loop$prop$serviceProductObject$290.inventory=d.$jscomp$loop$prop$inventory$288,a.currentServiceProductDetails.push(d.$jscomp$loop$prop$serviceProductObject$290))}}(b)):
!b.$jscomp$loop$prop$inventory$288.purchasable||"Active"!=b.$jscomp$loop$prop$inventory$288.productLifeCycle||"inStock"!=b.$jscomp$loop$prop$inventory$288.stockStatus&&"lowStock"!=b.$jscomp$loop$prop$inventory$288.stockStatus?a.spb_commonLogger("service product - check inventory",b.$jscomp$loop$prop$serviceProductSkusorCurrentSku$289):(b.$jscomp$loop$prop$serviceProductObject$290.sku=b.$jscomp$loop$prop$serviceProductSkusorCurrentSku$289,b.$jscomp$loop$prop$serviceProductObject$290.title=null!=a.productReferences[b.$jscomp$loop$prop$serviceProductSkusorCurrentSku$289]?
a.productReferences[b.$jscomp$loop$prop$serviceProductSkusorCurrentSku$289].variantTitle:"",b.$jscomp$loop$prop$serviceProductObject$290.inventory=b.$jscomp$loop$prop$inventory$288,a.currentServiceProductDetails.push(b.$jscomp$loop$prop$serviceProductObject$290))})},checkInventoryStatusAndSelectDefaultVariant:function(){var a=this;if(!this.$data.checkInventoryStatusAndSelectDefaultVariantFlag){this.spb_commonLogger("Inventory is out of stock or null for default variant : ",this.$data.currentSku);
this.spb_commonLogger("Filtering skus which has inventory to select updated default variant");var b=this.$data.skuList.filter(function(c){var d=a.getSessionVariable(c);if(null!=d&&d.purchasable&&"Active"==d.productLifeCycle&&("inStock"==d.stockStatus||"lowStock"==d.stockStatus))return c});this.spb_commonLogger("checkInventoryStatusAndSelectDefaultVariant : Filtered Skus[inStock] :",b);0==b.length&&(b=this.$data.skuList.filter(function(c){var d=a.getSessionVariable(c);if(null!=d&&d.purchasable&&("Active"==
d.productLifeCycle&&"backOrderStock"==d.stockStatus||"Pre"==d.productLifeCycle&&("preOrder"==d.stockStatus||"reserveNow"==d.stockStatus)))return c}),this.spb_commonLogger("checkInventoryStatusAndSelectDefaultVariant : Filtered Skus[backOrder,preOrder,reserveNow] :",b));this.$data.checkInventoryStatusAndSelectDefaultVariantFlag=!0;0<b.length?(this.$data.currentSku=b[0],this.updateVariantCategoriesView(this.$data.currentSku,null),this.updateViewForVariant(this.$data.currentSku,!1)):this.$data.isCommerceServiceIssue=
!0}},openReserveNowForm:function(a,b){this.qvActiveSkuObj=this.productReferences[this.currentSku];this.qvActiveSkuObj.baseProductId=this.baseProductId;this.$forceUpdate();a=b.currentTarget;document.querySelector("[data-target\x3d'#reserve-now-modal']").removeAttribute("data-target");a.setAttribute("data-target","#reserve-now-modal");document.getElementById("reserve-now-modal").classList.remove();document.querySelector("body").classList.add("overflow-hidden");setTimeout(function(){},1E3)},addToCart:function(a,
b,c){var d=this;if(("undefined"==typeof this.product.quantity||isNaN(this.product.quantity)||0>=this.product.quantity)&&"undefined"==typeof c)this.productInvalid=!0,this.$forceUpdate();else if(this.isB2BUser()&&this.product.quantity>this.inventory.stockLevel)this.productStockUnavailable=!0,this.$forceUpdate();else if(null!=this.inventory)if(this.productStockUnavailable=this.productInvalid=!1,this.dropShipNcnrATCObj={},this.ncnrCheckBox=!1,this.isB2BUser())"true"===this.enableNCNR&&(this.inventory.isNonReturnable||
-1<this.inventory.limitedTimeToCancel)?(this.dropShipNcnrATCObj.skuId=a,this.dropShipNcnrATCObj.quantity=c,this.dropShipNcnrATCObj.event=b,this.addClass(b.currentTarget,"wd-modal-active"),document.body.classList.add("overflow-hidden"),this.showNcnrModal=!0):(this.domUpdatesForAddToCart(b),this.triggerAddToCart(a,b,c,null));else if(this.domUpdatesForAddToCart(b),this.isB2BUser()||"true"!=this.isCandyrackEnabled)this.triggerAddToCart(a,b,c,null);else{var f=this.getSessionVariable(this.COMMERCE_CONSTANTS.REL_PROD+
a);null==f?(this.spb_commonLogger("getting sku based related products"),this.getRelatedProductsDetail(a,!0).then(function(k){f=d.getSessionVariable(d.COMMERCE_CONSTANTS.REL_PROD+a);d.spb_commonLogger("got sku based related products",f);0<f.length?(StoreProductCart[0].resetCandyRackData(),StoreProductCart[0].showCandyRackProducts(d,f,a,b,c,d.selectedServiceProduct)):d.triggerAddToCart(a,b,c,null)})):(this.spb_commonLogger("product banner - sku related products info found in session"),0<f.length?(StoreProductCart[0].resetCandyRackData(),
StoreProductCart[0].showCandyRackProducts(this,f,a,b,c,this.selectedServiceProduct)):this.triggerAddToCart(a,b,c,null))}},triggerGreenPromoModal:function(a){(a=document.querySelector(""+a.target.getAttribute("data-target")))&&a.classList.remove("hidden")},acceptNcnr:function(a){a.preventDefault();a.stopPropagation();a.target.closest(".ncnrModal").querySelector(".wd-modal-close").click();this.domUpdatesForAddToCart(this.dropShipNcnrATCObj.event);this.triggerAddToCart(this.dropShipNcnrATCObj.skuId,
this.dropShipNcnrATCObj.event,this.dropShipNcnrATCObj.quantity,null);this.$forceUpdate()},cancelNcnr:function(a){a.target.closest(".ncnrModal").querySelector(".wd-modal-close").click()},closeNcnr:function(a){this.showNcnrModal=!1;this.$forceUpdate()},domUpdatesForAddToCart:function(a){this.addClass(a.currentTarget?a.currentTarget:a.target,"addToCartBtnActive");a=document.querySelector(".cartwrapper");this.removeClass(a,"hidden");this.addClass(a,"updateCartData");this.addClass(a,"addToCartButton");
a=a.querySelector(".cartShowInProgress");this.removeClass(a,"hidden")},triggerAddToCart:function(a,b,c,d){var f=this;c="undefined"==typeof c||null==c?this.product.quantity:c;if(d||null!=d)d.showCandyRackContainer=!d.showCandyRackContainer,d.$forceUpdate();768>window.screen.width&&this.scrollToTop(600);d=this.getSessionVariable(this.COMMERCE_CONSTANTS.CART_DETAILS);var k=!1;if(this.isCatalogPurchasable)if(this.spb_commonLogger("catalog is purchasable"),null==d||"undefined"!=typeof d.cartId&&null!=
d.cartId&&"undefined"!=typeof d.cartEntries&&0!=d.cartEntries.length||(k=!0),this.selectedServiceProduct&&""!=this.selectedServiceProduct){d={};var h=[],l={product:{}};l.product.associatedProductCode=a;l.product.code=this.selectedServiceProduct;l.quantity=c;var p={product:{}};p.product.code=a;p.quantity=c;h.push(p);h.push(l);d.cartEntries=h;this.addMultipleProductToCart(d).then(function(q){f.spb_commonLogger("returned from adding product to cart, now update cart");StoreProductCart[0].setSkuId(a);
StoreProductCart[0].showMiniCart(b);k?f.checkAndtriggerAnalyticsCartOpenEvent(k,a):f.triggerAnalyticsAddToCartEvent(a)})}else this.addProductToCart(a,c).then(function(q){f.spb_commonLogger("returned from adding product to cart, now update cart");StoreProductCart[0].setSkuId(a);StoreProductCart[0].showMiniCart(b);k?f.checkAndtriggerAnalyticsCartOpenEvent(k,a):f.triggerAnalyticsAddToCartEvent(a)});else this.spb_commonLogger("catalog is not purchasable")},openWtbPage:function(){this.trackWTBClick();
window.location.href=this.wtbPagePath},addToCompareTray:function(){this.addSkuToCookie(this.$data.currentSku,this.$data.baseProductId)},trackWTBClick:function(){try{var a=window.aa.createEvent("WHERE_TO_BUY",{});window.dispatchEvent(a)}catch(b){console.log("Error while triggering analytics WHERE_TO_BUY event")}},filteredSkus:function(a){if(void 0!=a){var b={};a=$jscomp.makeIterator(Object.entries(a));for(var c=a.next();!c.done;c=a.next()){var d=$jscomp.makeIterator(c.value);c=d.next().value;d=d.next().value;
0!==c.indexOf("sku")&&0!==c.indexOf("ean")&&(b[c]=d)}return b}},isPathProtected:function(a){var b=!1;document.querySelector("#commonUtilLoad").getAttribute("data-isPathProtected").split(",").forEach(function(c){null!=c&&""!==c&&""!=a&&-1<a.indexOf(c)&&(b=!0)});return b},processRelatedProducts:function(){var a=this;this.spb_commonLogger("processRelatedProduct for ",this.$data.baseProductId);var b=this.getSessionVariable(this.COMMERCE_CONSTANTS.REL_PROD+this.baseProductId);null==b?(this.spb_commonLogger("product banner - getting related products"),
this.getRelatedProductsDetail(this.baseProductId).then(function(c){a.spb_commonLogger("product banner - got related products");b=a.getSessionVariable(a.COMMERCE_CONSTANTS.REL_PROD+a.baseProductId);a.setRelatedProducts(b)})):(this.spb_commonLogger("product banner - related products info found in session"),b=this.getSessionVariable(this.COMMERCE_CONSTANTS.REL_PROD+this.baseProductId),this.setRelatedProducts(b))},setRelatedProducts:function(a){var b=this;this.sessionRelatedProducts=a.filter(function(c){if(null!=
b.productReferences[c.code])return c});(new Promise(function(c,d){var f=0;a.forEach(function(k,h,l){if(null!=b.$data.productReferences[k.code]){b.spb_commonLogger("product banner - setting related products info to scope");f++;var p={},q=b.$data.productReferences[k.code];p.code=k.code;p.pagePath=q.pagePath;p.pageImage=q.urlFileReference;p.pageTitle=q.pageTitle;p.brandId=q.productBrandId;p.minPricedSKU={};b.isB2BUser()||b.initCustomPromotionInfo(k.code);if(b.$data.isCatalogPurchasable){var t=b.getSessionVariable(k.code);
if(null==t)b.getBaseProductInfo(k.code,k.variants).then(function(){b.spb_commonLogger("sku.code :: ",k.code);t=b.getSessionVariable(k.code);var C={};if(null!=b.getSessionVariable(t.minPricedSKU)){var E=b.getSessionVariable(t.minPricedSKU);C.amountFormatted=E.prices.sale.amountFormatted;if(C.isSubscriptionProduct=E.isSubscriptionProduct)C.billingPlanName=E.prices.sale.billingPlanName;p.minPricedSKU=C}b.relatedProducts[k.code]=p;b.$forceUpdate();b.spb_commonLogger("sessionBaseProductInfo :: ",t)}).catch(function(){b.spb_commonLogger("error thrown while getting sessionBaseProductInfo :: ",
k.code)});else{q={};if(null!=b.getSessionVariable(t.minPricedSKU)){var u=b.getSessionVariable(t.minPricedSKU);q.amountFormatted=u.prices.sale.amountFormatted;if(q.isSubscriptionProduct=u.isSubscriptionProduct)q.billingPlanName=u.prices.sale.billingPlanName;p.minPricedSKU=q;b.$forceUpdate()}b.relatedProducts[k.code]=p}}b.relatedProducts[k.code]=p;b.$forceUpdate();b.initRelatedProductSplide()}h===l.length-1&&c()})})).then(function(){b.initRelatedProductSplide()})},initCustomPromotionInfo:function(a){var b=
this;this.spb_commonLogger("initCustomPromotionInfo");var c={},d=this.getSessionVariable(this.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);if(d&&d[a]){c.attBelowAddToCartButtonPromo=d[a].attBelowAddToCartButtonPromo;c.attBelowResellerButtonPromo=d[a].attBelowResellerButtonPromo;var f=[];c.attBelowResellerButtonPromo&&(f=c.attBelowResellerButtonPromo.split(","));(d=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.CUSTOM_PROMOTIONS))?(this.customPromotions=d,void 0!=this.customPromotions&&void 0!=this.customPromotions[c.attBelowAddToCartButtonPromo]?
c.cpJson=this.customPromotions[c.attBelowAddToCartButtonPromo]:void 0!=this.customPromotions&&f.length&&void 0!=this.customPromotions[f[0]]&&(c.cpJson=this.customPromotions[f[0]]),this.promotionInfoPerProduct[a]=c):this.getPromotionsJson().then(function(){var k=b.getSessionVariable(b.$data.COMMERCE_CONSTANTS.CUSTOM_PROMOTIONS);k&&(b.customPromotions=k,void 0!=b.customPromotions&&void 0!=b.customPromotions[c.attBelowAddToCartButtonPromo]?c.cpJson=b.customPromotions[c.attBelowAddToCartButtonPromo]:
void 0!=b.customPromotions&&f.length&&void 0!=b.customPromotions[f[0]]&&(c.cpJson=b.customPromotions[f[0]]),b.promotionInfoPerProduct[a]=c)})}else this.getProductReferences().then(function(){var k=b.getSessionVariable(b.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);if(k&&k[a]){c.attBelowAddToCartButtonPromo=k[a].attBelowAddToCartButtonPromo;c.attBelowResellerButtonPromo=k[a].attBelowResellerButtonPromo;var h=[];c.attBelowResellerButtonPromo&&(h=c.attBelowResellerButtonPromo.split(","));(k=b.getSessionVariable(b.$data.COMMERCE_CONSTANTS.CUSTOM_PROMOTIONS))?
(b.customPromotions=k,void 0!=b.customPromotions&&void 0!=b.customPromotions[c.attBelowAddToCartButtonPromo]?c.cpJson=b.customPromotions[c.attBelowAddToCartButtonPromo]:void 0!=b.customPromotions&&h.length&&void 0!=b.customPromotions[h[0]]&&(c.cpJson=b.customPromotions[h[0]])):b.getPromotionsJson().then(function(){var l=b.getSessionVariable(b.$data.COMMERCE_CONSTANTS.CUSTOM_PROMOTIONS);l&&(b.customPromotions=l,void 0!=b.customPromotions&&void 0!=b.customPromotions[c.attBelowAddToCartButtonPromo]?
c.cpJson=b.customPromotions[c.attBelowAddToCartButtonPromo]:void 0!=b.customPromotions&&h.length&&void 0!=b.customPromotions[h[0]]&&(c.cpJson=b.customPromotions[h[0]]))})}b.promotionInfoPerProduct[a]=c});this.spb_commonLogger(a+" : "+c.cpJson);return c},activatePDPSlide:function(){var a=this,b=document.querySelector("html").getAttribute("dir");if(null!=document.getElementById("main-slider-"+this.$data.currentSku)&&!document.getElementById("main-slider-"+this.$data.currentSku).classList.contains("is-initialized")){var c=
new Splide("#main-slider-"+this.$data.currentSku,{lazyLoad:"nearby",preloadPages:1,type:"fade",rewind:!0,height:"557px",pagination:!1,breakpoints:{1464:{height:"450px"},992:{height:"390px"},767:{arrows:!1,autoplay:!0,interval:1E5,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0}}}),d=new Splide("#support-resource-carousel-"+this.$data.currentSku,{preloadPages:1,perPage:3,perMove:1,fixedWidth:425,arrows:!0,type:"scroll",gap:24,padding:{right:"5rem"},pagination:!1,direction:document.querySelector('html[dir\x3d"rtl"]')?
"rtl":"ltr",wheel:!0,releaseWheel:!0,wheelSleep:1E3,isNavigation:!1,breakpoints:{1464:{perPage:2},992:{perPage:1,arrows:!1}}});if(null!=document.getElementById("carouselModal-"+this.$data.currentSku))var f=new Splide("#carouselModal-"+this.$data.currentSku,{lazyLoad:"nearby",preloadPages:1,type:"fade",height:"700px",pagination:!1,arrows:!0,rewind:!0,breakpoints:{1464:{height:"450px"},992:{height:"390px"},767:{autoplay:!0,interval:1E5,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0}}});if(null!=document.getElementById("single-carouselModal-"+
this.$data.currentSku)){var k=new Splide("#single-carouselModal-"+this.$data.currentSku,{lazyLoad:"nearby",preloadPages:1,type:"fade",height:"700px",pagination:!1,arrows:!1,rewind:!0,breakpoints:{1464:{height:"450px"},992:{height:"390px"},767:{autoplay:!0,interval:1E5,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0}}}),h=new Splide("#thumbnail-slider-"+this.$data.currentSku,{lazyLoad:"nearby",preloadPages:1,perPage:4,wheel:!0,arrows:!1,rewind:!0,fixedWidth:90,fixedHeight:90,isNavigation:!0,gap:24,
pagination:!1,dragMinThreshold:{mouse:4,touch:10},breakpoints:{576:{fixedWidth:72,fixedHeight:72,gap:12,arrows:!1}},perMove:1});d=new Splide("#support-resource-carousel-"+this.$data.currentSku,{preloadPages:1,perPage:3,perMove:1,fixedWidth:425,arrows:!0,type:"scroll",gap:24,padding:{right:"5rem"},pagination:!1,direction:document.querySelector('html[dir\x3d"rtl"]')?"rtl":"ltr",wheel:!0,releaseWheel:!0,wheelSleep:1E3,isNavigation:!1,breakpoints:{1464:{perPage:2},992:{perPage:1,arrows:!1}}})}if(null!=
document.getElementById("thumbnail-slider-"+this.$data.currentSku)){var l=new Splide("#thumbnail-slider-"+this.$data.currentSku,{lazyLoad:"nearby",preloadPages:1,perPage:4,wheel:!0,arrows:!0,rewind:!0,fixedWidth:90,fixedHeight:90,isNavigation:!0,gap:24,pagination:!1,direction:b,dragMinThreshold:{mouse:4,touch:10},breakpoints:{576:{fixedWidth:72,fixedHeight:72,gap:12,arrows:!1}},perMove:1});c.sync(l);c.mount();l.mount();f&&f.mount();768<=window.screen.width?d.mount():d.destroy();document.querySelectorAll(".rd-main-carousel li.splide__slide").forEach(function(q){q.addEventListener("click",
function(t){t=Array.prototype.slice.call(t.currentTarget.parentElement.children).indexOf(t.currentTarget);var u=null;0<q.closest(".store-product-image.active").querySelectorAll(".play-btn.video-in-carousel").length&&(u=q.closest(".store-product-image.active").querySelectorAll(".play-btn.video-in-carousel"));null!=u&&a.OpenVideoModal(u);a.openCarouselModal(q,t,f)})});window.addEventListener("resize",function(){setTimeout(function(){768<=window.innerWidth?d&&(d.destroy(),d.mount()):d.destroy()},200)});
window.addEventListener("resize",function(q){setTimeout(function(){document.querySelector(".store-product-image.active .rd-modal-carousel iframe")&&(document.querySelector(".store-product-image.active .rd-modal-carousel iframe").closest("li").display="flex",document.querySelector(".store-product-image.active .rd-modal-carousel iframe").closest("li").style.height="100%")},500)},!0);document.querySelectorAll(".rd-main-carousel button.video-in-carousel").forEach(function(q){q.addEventListener("click",
function(){a.OpenVideoModal(q)})});document.querySelectorAll(".rd-modal-carousel button.wd-modal-close").forEach(function(q){q.addEventListener("click",function(){a.closeModalCarousel(q)})});var p=document.querySelectorAll(".store-product-image");0<p.length&&setTimeout(function(){p.forEach(function(q){if(q.classList.contains("active")){var t=q.querySelectorAll(".rd-thumbnail-carousel .splide__list .splide__slide").length;q=q.querySelector(".rd-thumbnail-carousel .splide__list");6<t?q.classList.remove("justify-center",
"sm:justify-center"):6===t?(q.classList.remove("justify-center"),q.classList.add("justify-start","xl:justify-center")):5===t?(q.classList.remove("justify-center"),q.classList.add("justify-start","xs:justify-center","sm:justify-start","lg:justify-center")):4===t&&(q.classList.remove("justify-center"),q.classList.add("justify-center","sm:justify-start","md:justify-center"))}})},2E3);767>=window.innerWidth&&window.addEventListener("scroll",function(){document.querySelector("#updateProductGallery");new window.IntersectionObserver(function(q){$jscomp.makeIterator(q).next().value.isIntersecting?
(c.Components.Autoplay.play(),l.Components.Autoplay.play()):(c.Components.Autoplay.pause(),l.Components.Autoplay.pause())},{threshold:1})});this.isProductImageComponentInitiated=!0;document.querySelectorAll(".productImageComponentSkeleton").forEach(function(q){return q.remove()});document.querySelectorAll(".splide__track").forEach(function(q){return q.setAttribute("aria-live","off")});k&&document.querySelector(".rd-vertical-carousel-single li.splide__slide")&&(document.querySelectorAll(".rd-vertical-carousel-single li.splide__slide").forEach(function(q){q.addEventListener("click",
function(t){t=Array.prototype.slice.call(t.currentTarget.parentElement.children).indexOf(t.currentTarget);a.openCarouselModal(q,t,f)})}),k.mount())}else c.sync(h),c.mount(),k.mount(),h.mount(),d&&(768<=window.screen.width?d.mount():d.destroy()),this.isProductImageComponentInitiated=!0,document.querySelectorAll(".productImageComponentSkeleton").forEach(function(q){return q.remove()}),document.querySelectorAll(".splide__track").forEach(function(q){return q.setAttribute("aria-live","off")}),document.querySelectorAll(".rd-vertical-carousel-single li.splide__slide").forEach(function(q){q.addEventListener("click",
function(t){t=Array.prototype.slice.call(t.currentTarget.parentElement.children).indexOf(t.currentTarget);a.openCarouselModal(q,t,f)})})}},openCarouselModal:function(a,b,c){body.classList.add("overflow-hidden");a.closest(".rd-main-carousel")&&a.closest(".rd-main-carousel").querySelector(".rd-modal-carousel")&&(a.closest(".rd-main-carousel").querySelector(".rd-modal-carousel").classList.remove("hidden"),c.go(b));a.closest(".rd-vertical-carousel-single")&&a.closest(".rd-vertical-carousel-single").querySelector(".single-image-carousel-modal")&&
a.closest(".rd-vertical-carousel-single").querySelector(".single-image-carousel-modal").classList.remove("hidden")},OpenVideoModal:function(a){if(document.querySelector(".rd-modal-carousel")&&document.querySelector(".rd-modal-carousel").classList.contains("hidden")){document.querySelector(".store-product-image.active .rd-modal-carousel iframe").closest("li").display="flex";document.querySelector(".store-product-image.active .rd-modal-carousel iframe").closest("li").style.height="100%";for(var b={},
c=0;c<a.length;b={$jscomp$loop$prop$modalId$292:b.$jscomp$loop$prop$modalId$292,$jscomp$loop$prop$videoURL$293:b.$jscomp$loop$prop$videoURL$293,$jscomp$loop$prop$players$294:b.$jscomp$loop$prop$players$294},c++){var d=document.querySelectorAll(".store-product-image.active .rd-modal-carousel iframe");b.$jscomp$loop$prop$modalId$292=a[c].getAttribute("data-target");b.$jscomp$loop$prop$videoURL$293=a[c].getAttribute("data-videosrc");d.length&&(b.$jscomp$loop$prop$players$294=[],d.forEach(function(f){return function(k,
h){k.setAttribute("src",a[h].getAttribute("data-videosrc"));k={};k.modalID="#"+f.$jscomp$loop$prop$modalId$292;k.videoURL=f.$jscomp$loop$prop$videoURL$293;try{var l=window.aa.createEvent("VIDEO",k);window.dispatchEvent(l)}catch(p){console.log("Error while triggering analytics VIDEO event")}}}(b)),document.querySelectorAll(".splide__arrow")&&0<document.querySelectorAll(".splide__arrow").length&&document.querySelectorAll(".splide__arrow").forEach(function(f){return function(k){k.addEventListener("click",
function(){var h=k.closest(".store-product-image.active");h&&0<h.querySelectorAll(".rd-modal-carousel iframe").length&&h.querySelectorAll(".rd-modal-carousel iframe").forEach(function(l){var p=f.$jscomp$loop$prop$players$294.find(function(q){return q.getIframe().id===l.id});p&&p.pauseVideo&&p.pauseVideo()})})}}(b)));body.classList.add("overflow-hidden")}}},closeModalCarousel:function(a){body.classList.remove("overflow-hidden");document.querySelectorAll(".store-product-image.active .rd-modal-carousel iframe").forEach(function(b){b.setAttribute("src",
"")});document.querySelector(".rd-modal-carousel").classList.add("hidden")},initRelatedProductSplide:function(){var a=new Splide(".relatedProduct",{preloadPages:1,perPage:5,type:"scroll",height:"auto",pagination:!1,arrows:!1,cover:!1,autoplay:!1,gap:16,dragMinThreshold:{mouse:4,touch:10},breakpoints:{7680:{perPage:5,gap:16},1920:{perPage:4,gap:16},1464:{perPage:3,gap:16},992:{perPage:2,gap:16},768:{perPage:1},576:{perPage:1}}}),b=document.querySelector(".relatedProduct .splide__list");(new MutationObserver(function(c){a.refresh();
slidNavshow(document.querySelector(".relatedProduct"))})).observe(b,{childList:!0});window.addEventListener("resize",function(c){slidNavshow(document.querySelector(".relatedProduct"))},!0);a.on("moved",function(){slidNavshow(document.querySelector(".relatedProduct"))});a.mount()},updateBVReviewToLoadLater:function(){var a=document.querySelector(".product-tech-specs-store"),b=document.getElementById("bvReview");if(null!=b){if(null!=a){var c=new IntersectionObserver(function(f){f[0].isIntersecting&&
(setTimeout(function(){b.setAttribute("data-bv-show",b.getAttribute("bv-show"));b.setAttribute("data-bv-product-id",b.getAttribute("bv-product-id"))},500),c.unobserve(a))});c.observe(a)}else{var d=!1;window.addEventListener("scroll",function(f){!d&&0<window.scrollY&&(d=!0,b.setAttribute("data-bv-show",b.getAttribute("bv-show")),b.setAttribute("data-bv-product-id",b.getAttribute("bv-product-id")))})}window.addEventListener("load",function(){if(!document.body.classList.contains("b2b")){var f=document.querySelector('[data-bv-show\x3d"rating_summary"]'),
k=new MutationObserver(function(h){h.forEach(function(l){l=l.addedNodes;null!=l[0]&&l[0].classList&&l[0].classList.contains("bv_main_container_row_flex")&&l[0].addEventListener("mouseenter",function(){var p=document.getElementById("bvReview");null==p||p.hasAttribute("data-bv-ready")||(p.setAttribute("data-bv-show",p.getAttribute("bv-show")),p.setAttribute("data-bv-product-id",p.getAttribute("bv-product-id")));p=document.querySelector(".bv_button_buttonFull");null!=p&&p.addEventListener("click",function(){var q=
document.querySelector(".reviews-subnavItem").querySelector("a");null!=q&&q.click();k.disconnect()})},{once:!0})})});k.observe(f,{subtree:!0,childList:!0})}})}},initAffirmMessage:function(){var a=this.getSessionVariable(this.COMMERCE_CONSTANTS.AFFIRM_ALLOWED);if(!this.isB2BUser()&&"undefined"==typeof affirm&&null!=a&&a)a={public_api_key:this.getAffirmPublicApiKey(),script:this.getAffirmScriptURL()},function(b,c,d,f,k,h,l){var p=b[d]||{},q=document.createElement(h),t=document.getElementsByTagName(h)[0],
u=function(E,F,K){return function(){E[F]._.push([K,arguments])}};p[f]=u(p,f,"set");var C=p[f];p[k]={};p[k]._=[];C._=[];p[k][l]=u(p,k,l);k=0;for(l="set add save post open empty reset on off trigger ready setProduct".split(" ");k<l.length;k++)C[l[k]]=u(p,f,l[k]);k=0;for(l=["get","token","url","items"];k<l.length;k++)C[l[k]]=function(){};q.async=!0;q.src=c[h];t.parentNode.insertBefore(q,t);delete c[h];C(c);b[d]=p}(window,a,"affirm","checkout","ui","script","ready");else if("undefined"!=typeof affirm&&
"undefined"!=typeof affirm.ui)try{setTimeout(function(){affirm.ui.refresh()},1)}catch(b){this.spb_commonLogger("error while refreshing affirm ui")}},dataAmountAffirm:function(a){return 100*a},isB2BUser:function(){return this.getCustomerChannel()==this.COMMERCE_CONSTANTS.B2B?!0:!1},notifyMe:function(a,b){a=b.currentTarget.getAttribute("data-target");a=document.getElementById(a);this.notifyMeSuccess=!1;a.classList.remove("hidden");a.querySelector("form").reset();a.querySelector("form .form-group").classList.remove("filled",
"invalidField");document.querySelector("body").classList.add("overflow-hidden");setTimeout(function(){},1E3)},submitNotifyMeForm:function(a){var b=this;a.preventDefault();a.stopPropagation();var c=a.currentTarget;this.email=c.querySelector('[name\x3d"email"]').value;if(""!=this.email&&!this.validateEmail(this.email)){a=new URL(a.currentTarget.action);var d=new FormData(c);d=$jscomp.makeIterator(d);for(var f=d.next();!f.done;f=d.next()){var k=$jscomp.makeIterator(f.value);f=k.next().value;k=k.next().value;
a.searchParams.append(f,k)}fetch(a.href,{method:"GET",xhrFields:{withCredentials:!0}}).then(function(h){return h.json()}).then(function(h){b.spb_commonLogger("Notify Me service response :",h);if(-1<h.indexOf("success")){b.spb_commonLogger("showing success");b.notifyMeSuccess=!0;h={};h.formRef=c;try{b.spb_commonLogger("analytics form submitted data obj: ",h);var l=window.aa.createEvent("FORM_SUBMITTED",h);window.dispatchEvent(l)}catch(p){console.log("Error while triggering analytics FORM_SUBMITTED event")}}else b.spb_commonLogger("showing form"),
b.notifyMeSuccess=!1;b.$forceUpdate();c.reset();setTimeout(function(){},1E3)}).catch(function(h){c.reset();b.notifyMeSuccess=!1;b.spb_commonLogger("Error in Notify Me Service",h)})}},validateEmail:function(a){if(!/^(([^<>()[\]\.,;:\s@"]+(\.[^<>()[\]\.,;:\s@"]+)*)|(".+"))@(([^<>()[\]\.,;:\s@"]+\.)+[^<>()[\]\.,;:\s@"]{2,})$/i.test(a)||128<a.length)return!0},notifyMeClose:function(a){a=a.target;closeModalWindow(a);this.notifyMeSuccess=!1;this.$forceUpdate();var b=a.closest(".product-details").querySelector(".product-price button");
b&&null!=b&&"undefined"!=typeof b&&a.closest(".product-details").querySelector(".product-price button").focus()},closeRequestQuoteModal:function(a){a=a.target;closeModalWindow(a);var b=a.closest(".product-details").querySelector(".product-price button");b&&null!=b&&"undefined"!=typeof b&&a.closest(".product-details").querySelector(".product-price button").focus();this.showRequestQuoteModal=!1;this.$forceUpdate()},attachEventOnFocusOutForProductQuantity:function(){var a=this,b=document.querySelector(".product-price"),
c=new MutationObserver(function(d){a.isCatalogPurchasable&&(d=document.getElementById("productQuantity"))&&d.addEventListener("focusout",function(f){a.showBusinessPop()});c.disconnect()});c.observe(b,{subtree:!0,childList:!0})},attachEventOnclickOfBusinessPricing:function(){var a=this;setTimeout(function(){var d=document.querySelector(".BusinessPricingB2C");d&&d.addEventListener("click",function(f){a.showBusinessPricingPop()})},3E3);var b=document.querySelector(".store-product-wtb"),c=new MutationObserver(function(d){a.isCatalogPurchasable&&
(d=document.querySelector(".BusinessPricingB2C"))&&d.addEventListener("click",function(f){a.showBusinessPricingPop()});c.disconnect()});c.observe(b,{subtree:!0,childList:!0})},showBusinessPop:function(){var a=this.showBusinessSignUpPopup.split(",");if(this.isShowB2bPopUpEnabled&&!a.includes(this.$data.currentSku)&&6<=this.product.quantity&&!this.isB2BUser()){document.getElementById("business-signup-modal").classList.remove("hidden");document.getElementById("business-signup-modal").getAttribute("data-credit-na-locales")&&
document.getElementById("business-signup-modal").getAttribute("data-credit-na-locales").split(",").includes(this.getLocale().toLowerCase())&&document.querySelector(".sandisk-credit-text").classList.add("hidden");a.push(this.$data.currentSku);Cookies.set(this.COMMERCE_CONSTANTS.BUSINESS_SIGNUP_COOKIE,a.toString(),{secure:!0,path:"/",expires:1});this.showBusinessSignUpPopup=a.toString();try{var b=window.aa.createEvent("GENERAL_POPUP",{title:"business-signup-modal",eventType:"impression"});window.dispatchEvent(b)}catch(c){console.error("Error While firing GENERAL_POPUP impression event")}}},
showBusinessPricingPop:function(){if(this.isShowB2bPopUpEnabled&&!this.isB2BUser()){document.getElementById("business-signup-modal").classList.remove("hidden");document.getElementById("business-signup-modal").getAttribute("data-credit-na-locales")&&document.getElementById("business-signup-modal").getAttribute("data-credit-na-locales").split(",").includes(this.getLocale().toLowerCase())&&document.querySelector(".sandisk-credit-text").classList.add("hidden");try{var a=window.aa.createEvent("GENERAL_POPUP",
{title:"business-signup-modal",eventType:"impression"});window.dispatchEvent(a)}catch(b){console.error("Error While firing GENERAL_POPUP impression event")}}},closeb2bSignUpModal:function(){try{var a=window.aa.createEvent("GENERAL_POPUP",{title:"business-signup-modal",eventType:"close"});window.dispatchEvent(a)}catch(b){console.error("Error While firing GENERAL_POPUP close event")}},showSalesInquiryModal:function(){document.getElementById("sales-inquiry-modal").classList.remove("hidden");recaptchaScriptLoaded||
loadRecaptchaScript()},increment:function(){if(this.isB2BUser()&&this.enableMOQ)if(this.inventory.isDropShipProduct&&1<this.inventory.casePackQuantity)if(this.product.quantity=parseInt(this.product.quantity)+parseInt(this.inventory.casePackQuantity),this.product.quantity>this.inventory.minOrderQuantity)for(;0!==this.product.quantity%this.inventory.casePackQuantity;)this.product.quantity--;else this.product.quantity<=this.inventory.minOrderQuantity&&this.increment();else 1<this.inventory.minOrderQuantity&&
this.product.quantity<this.inventory.minOrderQuantity?this.product.quantity=this.inventory.minOrderQuantity:this.product.quantity++;else this.product.quantity++;this.updateOnInputQuantityChange();this.showBusinessPop()},decrement:function(){this.isB2BUser()&&this.enableMOQ?this.inventory.isDropShipProduct?this.product.quantity=Math.max(Math.ceil((parseInt(this.product.quantity)-parseInt(this.inventory.casePackQuantity))/parseInt(this.inventory.casePackQuantity))*parseInt(this.inventory.casePackQuantity),
parseInt(this.inventory.minOrderQuantity)):this.product.quantity--:this.product.quantity--;this.updateOnInputQuantityChange()},resetProductQuantity:function(){this.product={quantity:1};this.productInvalid=!1;this.$forceUpdate()},changePriceOnQuantityChange:function(){if(this.inventory&&this.inventory.prices&&this.inventory.prices.volumePrice){if(1==this.inventory.prices.volumePrice.length)return 0;for(var a=0;a<this.inventory.prices.volumePrice.length;a++){var b=this.inventory.prices.volumePrice[a];
if(null!=b.maxQuantity&&b.maxQuantity>=this.product.quantity&&b.minQuantity<=this.product.quantity||null==b.maxQuantity&&b.minQuantity<=this.product.quantity)return a}}},updateOnInputQuantityChange:function(){0<this.product.quantity?(this.productInvalid=!1,this.isB2BUser()&&this.product.quantity<this.inventory.stockLevel?this.productStockUnavailable=!1:this.isB2BUser()&&this.product.quantity>this.inventory.stockLevel&&(this.productStockUnavailable=!0),this.isB2BUser()&&(this.enableMOQ&&this.checkMoqValidity(),
this.updateTieredPricing()),this.updateProductQuantitySkuMap()):this.productInvalid=!0},updateProductQuantitySkuMap:function(){this.productqtySkuMap[this.currentSku]=this.product.quantity;this.spb_commonLogger("product quantity sku map in updateProductQuantitySkuMap method: ",this.productqtySkuMap)},formatPrice:function(a,b){if(0<this.product.quantity){a=(new Intl.NumberFormat(this.getLocale(),{style:"currency",currency:b})).format(a*this.product.quantity);if("en-CA"==this.getLocale()||"fr-CA"==this.getLocale())a=
a.replace("$","C$ ");this.productSubNavPriceUpdate(a);return a}},getFormattedText:function(a,b){return a.replace("{}",b)},getFormattedBackOrderAvailabilityText:function(a){return a.replace("{'stockLevel'}",this.inventory.stockLevel).replace("{'availabilityMsg'}",this.inventory.stockAvailabilityMessage)},populateUserDetailForRequestQuote:function(){var a=this,b=this.getSessionVariable(this.COMMERCE_CONSTANTS.USER_DETAILS);null==b?this.getUser().then(function(){b=a.getSessionVariable(a.COMMERCE_CONSTANTS.USER_DETAILS);
null==b||"undefined"==typeof b.uid?a.spb_commonLogger("populateUserDetailForRequestQuote : User is not logged in."):(a.spb_commonLogger("populateUserDetailForRequestQuote : user logged in."),a.uuid=b.uid,a.name=b.firstName+" "+b.lastName,a.firstName=b.firstName,a.lastName=b.lastName,a.company=b.company,a.locale=a.getLocale().toLowerCase())}):(this.spb_commonLogger("populateUserDetailForRequestQuote : user is logged in."),this.uuid=b.uid,this.name=b.firstName+" "+b.lastName,this.firstName=b.firstName,
this.lastName=b.lastName,this.company=b.company,this.locale=this.getLocale().toLowerCase(),this.populateData("emailTemplate-firstName",this.firstName),this.populateData("emailTemplate-lastName",this.lastName),this.populateData("emailTemplate-company",this.company),this.populateData("emailTemplate-email",this.uuid),this.populateData("email",this.uuid),this.populateData("sku",this.currentSkuTitle+", "+this.currentSku,!0),this.populateData("emailTemplate-sku",this.currentSku),this.populateData("emailTemplate-skuName",
this.currentSkuTitle))},populateData:function(a,b,c){var d=document.getElementsByName(a);this.spb_commonLogger(a+":"+b+":"+d);d&&0<d.length&&(d[0].value=b,c&&(d[0].disabled=!0))},requestQuote:function(a){a=a.currentTarget;recaptchaScriptLoaded||loadRecaptchaScript();a=a.getAttribute("data-target");this.isB2BUser()&&1==this.inventory.prices.volumePrice.length&&(this.inventory.prices.maxQuantity=50);this.requestQuoteFailure=this.requestQuoteSuccess=!1;document.getElementById(a).classList.remove("hidden");
document.getElementById(a).querySelector("form").reset();document.getElementById(a).querySelector("form .form-group").classList.remove("filled","invalidField");this.showRequestQuoteModal=!0;document.querySelector("body").classList.add("overflow-hidden");this.$forceUpdate();setTimeout(function(){},1E3);this.populateUserDetailForRequestQuote()},requestQuoteFormSubmitAction:function(a){var b=this;a.preventDefault();a.stopPropagation();var c=a.currentTarget;c.querySelector(".form-group").classList.remove("focused",
"filled","invalidField");var d=document.getElementById("commonUtilLoad").getAttribute("data-enableRecaptcha"),f=a.currentTarget.action;if("true"==d){var k=document.getElementById("commonUtilLoad").getAttribute("data-recaptchaSiteKey");grecaptcha.ready(function(){grecaptcha.execute(k,{action:"requestQuote"}).then(function(h){var l=document.createElement("INPUT");l.setAttribute("type","hidden");l.setAttribute("name","g-recaptcha-response");l.setAttribute("value",h);c.append(l);b.validateRequestModal(c)&&
b.submitRequestQuoteForm(c,f)})})}else this.validateRequestModal(c)&&this.submitRequestQuoteForm(c,f)},submitRequestQuoteForm:function(a,b){var c=this,d=(new URLSearchParams(Array.from(new FormData(a)))).toString();fetch(b,{credentials:"include",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:d}).then(function(f){c.spb_commonLogger("product added to cart response",f);if(c.isResponseTypeJson(f))return f.status;c.createErrorObject(deferred,"Add product to cart response object is not of type JSON",
f)}).then(function(f){if("200"==f){c.spb_commonLogger("showing success");c.requestQuoteSuccess=!0;c.$forceUpdate();try{f={businessUse:"",quantity:"",targetShipDate:"",comments:""};var k={};Array.from(new FormData(a)).forEach(function(l){k[l[0]]=l[1]});f.businessUse=k["emailTemplate-businessUse"];f.quantity=k["emailTemplate-qty"];f.targetShipDate=k["emailTemplate-date"];f.comments=k["emailTemplate-comments"];var h=window.aa.createEvent("Request_Quote",JSON.stringify(f));window.dispatchEvent(h)}catch(l){console.log("Error while firing Analytics call for Request Quote",
l)}}else c.spb_commonLogger("showing form"),c.requestQuoteSuccess=!1,c.requestQuoteFailure=!0,c.$forceUpdate();a.reset();setTimeout(function(){},1E3)}).catch(function(f){c.requestQuoteSuccess=!1;c.requestQuoteFailure=!0;a.reset();c.spb_commonLogger("Error in Request Quote Service",f);c.$forceUpdate()})},validateRequestModal:function(a){this.requestQuoteFailure=!1;var b=!0,c=a.querySelector('[name\x3d"emailTemplate-businessUse"]').value;if(void 0==c||""==c)b=!1,a.querySelector('[name\x3d"emailTemplate-businessUse"]').closest(".form-group").classList.add("focused",
"filled","invalidField");c=a.querySelector('[name\x3d"emailTemplate-sku"]').value;if(void 0==c||""==c)b=!1,a.querySelector('[name\x3d"emailTemplate-sku"]').closest(".form-group").classList.add("focused","filled","invalidField");c=a.querySelector('[name\x3d"emailTemplate-qty"]').value;if(""==c||1>parseFloat(c))b=!1,a.querySelector('[name\x3d"emailTemplate-qty"]').closest(".form-group").classList.add("focused","filled","invalidField");c=a.querySelector('[name\x3d"emailTemplate-date"]').value;var d=
this.getCurrenDateInWDFormat();if(void 0==c||""==c||new Date(c)<d)b=!1,a.querySelector('[name\x3d"emailTemplate-date"]').closest(".form-group").classList.add("focused","filled","invalidField");c=a.querySelector('[name\x3d"emailTemplate-comments"]').value;if(void 0==c||""==c||""==c.trim())b=!1,a.querySelector('[name\x3d"emailTemplate-comments"]').closest(".form-group").classList.add("focused","filled","invalidField");this.$forceUpdate();return b},changeListPriceAccordingToVolume:function(a){try{this.inventory.prices.list=
this.inventory.prices.volumePrice[a],1<this.inventory.prices.volumePrice.length&&(this.inventory.prices.sale=this.inventory.prices.volumePrice[a])}catch(b){console.log("Error while changing List Price according to volume",b)}},changePriceValueOnTieredPriceClick:function(a,b){try{this.inventory.prices.list=a;1<this.inventory.prices.volumePrice.length&&(this.inventory.prices.sale=a);this.product.quantity=parseFloat(a.minQuantity);this.activeTieredPrice=b;this.updateProductQuantitySkuMap();var c={priceTier:"TIER"+
this.activeTieredPrice};this.spb_commonLogger("Price Tier Analytics call obj: "+c);var d=window.aa.createEvent("PRICE_TIER",JSON.stringify(c));window.dispatchEvent(d)}catch(f){console.log("Error while firing Analytics call for Tiered Pricing",f)}},triggerAnalyticsProductViewEvent:function(a,b){var c=this;try{var d={productSkuID:[],productSalePrice:[],productUnitPrice:[],productDiscount:[]};d.productSkuID.push(a);d.inventoryFlag="";null!=b&&null!=b.prices&&(d.productSalePrice.push(b.prices.sale.amount.toFixed(2).toString()),
d.productUnitPrice.push(b.prices.list.amount.toFixed(2).toString()),d.productDiscount.push((b.prices.list.amount-b.prices.sale.amount).toFixed(2)),d.inventoryFlag=b.purchasable?b.stockStatus:"findAReseller");d.productSkuName=[];d.productSkuName.push(document.querySelector("div[data-sku\x3d'"+a+"'].product-title").getAttribute("data-sku-title"));var f=[];this.variantCategoryOptions.forEach(function(l){var p=l.children.filter(function(q){return 1==q.viewType});c.spb_commonLogger("activeCategory:",p);
"undefined"!=typeof p[0]&&f.push(l.attVariantCategoryLabel+":"+p[0].attVariantCategoryLabel)});0<f.length&&(d.productVariantCategory=[],d.productVariantCategory.push(f));if("undefined"!=typeof this.allCategories[a]){d.productCategory=[];var k=this.allCategories[a].split(",").map(function(l){return l.match("vvc")?l.substring(l.match("vvc").index,l.length):l});d.productCategory.push(k)}var h=this.getSessionVariable(this.COMMERCE_CONSTANTS.USER_DETAILS);d.loginStatusFlag=null==h||"undefined"==typeof h.uid?
"guest":"logged-in";this.spb_commonLogger("analytics product view data obj: ",d);setTimeout(function(){if("undefined"!=typeof window.aa&&window.aa){var l=window.aa.createEvent("PROD_VIEW",d);window.dispatchEvent(l)}},3E3)}catch(l){console.log("Error while triggering analytics PROD_VIEW event",l)}},updateTieredPricing:function(){if(this.inventory&&this.inventory.prices&&this.inventory.prices.volumePrice){if(1==this.inventory.prices.volumePrice.length)this.activeTieredPrice=0;else for(var a=0;a<this.inventory.prices.volumePrice.length;a++){var b=
this.inventory.prices.volumePrice[a];null!=b.maxQuantity&&b.maxQuantity>=this.product.quantity&&b.minQuantity<=this.product.quantity?this.activeTieredPrice=a:null==b.maxQuantity&&b.minQuantity<=this.product.quantity&&(this.activeTieredPrice=a)}this.changeListPriceAccordingToVolume(this.changePriceOnQuantityChange());try{var c=window.aa.createEvent("PRICE_TIER",JSON.stringify({priceTier:"TIER"+this.activeTieredPrice}));window.dispatchEvent(c)}catch(d){console.log("Error while firing Analytics call for Tiered Pricing",
d)}}},onhashchange:function(a){a=window.location.hash.split("#")[1];this.skuProductIdsMapping.hasOwnProperty(a)&&(a!=this.currentSku&&(this.currentSku=a,this.viewUpdated=!1,this.updateVariantCategoriesView(this.currentSku,null),this.updateViewForVariant(this.currentSku,!1)),this.$forceUpdate())},offerSchema:function(a,b,c,d,f,k,h,l){var p=this;if(!this.isB2BUser()&&!this.offerSchemaSkuList.includes(f)){this.offerSchemaSkuList.push(f);var q="";if(this.isCatalogPurchasable)if(null==this.getSessionVariable(f)||
null==this.getSessionVariable(f).prices){this.spb_commonLogger("getProductPrice from API for: ",f);var t=!1;767<window.screen.width||botCheck()?this.getProductPrice(f).then(function(u){p.spb_commonLogger("product banner offer schema - got product price");q=p.getSessionVariable(f);return p.getOfferSchema(q,a,b,c,d,f,k,h,l)}):window.addEventListener("scroll",function(u){!t&&0<window.scrollY&&(t=!0,p.getProductPrice(f).then(function(C){p.spb_commonLogger("product banner offer schema - got product price");
q=p.getSessionVariable(f);return p.getOfferSchema(q,a,b,c,d,f,k,h,l)}))})}else return this.spb_commonLogger("getProductPrice from session for ",f),q=this.getSessionVariable(f),this.getOfferSchema(q,a,b,c,d,f,k,h,l);else return this.spb_commonLogger("generate product json with empty offers obj for non commerce sites. . . "),this.getOfferSchema(q,a,b,c,d,f,k,h,l)}},getOfferSchema:function(a,b,c,d,f,k,h,l,p){this.spb_commonLogger("inside getOfferSchema. . . ");var q={};if(a&&a.prices&&a.prices.sale){var t=
(new Date).toISOString().slice(0,10);q["@type"]="Offer";q.url=c;q.priceCurrency=a.prices.sale.currency;q.price=a.prices.sale.amount;q.availability=a.stockStatus;q.priceValidUntil=t;a={"@type":"Organization"};a.name=h;q.seller=[a]}b={"@type":"Product",name:b,identifier:p,description:l,url:c,image:d,color:f,sku:k,mpn:k};this.isCatalogPurchasable&&(b.offers=q);this.spb_commonLogger("productJson"+b);return b},checkAndtriggerAnalyticsCartOpenEvent:function(a,b){var c={},d=this.getSessionVariable(this.COMMERCE_CONSTANTS.CART_DETAILS);
try{if(this.spb_commonLogger("analytics SC_FIRST event data obj :",c),a){c.cartID=d.cartId;c.productName=[];c.productName.push(d.cartEntries[0].pageTitle);c.productSkuName=[];c.productSkuName.push(document.querySelector("div[data-sku\x3d'"+b+"'].product-title").getAttribute("data-sku-title"));c.productID=[];c.productID.push(d.cartEntries[0].pagePath.substring(d.cartEntries[0].pagePath.lastIndexOf("/")+1));c.productSkuID=[];c.productSkuID.push(b);c.productUnitPrice=[];c.productUnitPrice.push(d.cartEntries[0].prices.list.amount.toFixed(2).toString());
c.productSalePrice=[];c.productSalePrice.push(d.cartEntries[0].prices.sale.amount.toFixed(2).toString());c.productDiscount=[];c.productDiscount.push((d.cartEntries[0].prices.list.amount-d.cartEntries[0].prices.sale.amount).toFixed(2));this.isB2BUser()&&(c.priceTier=this.activeTieredPrice);c.productQuantity=this.product.quantity;var f=window.aa.createEvent("SC_FIRST",c);window.dispatchEvent(f)}}catch(k){console.log("Error while triggering analytics SC_FIRST event")}},triggerAnalyticsAddToCartEvent:function(a){a=
{};var b=this.getSessionVariable(this.COMMERCE_CONSTANTS.CART_DETAILS);null!=b&&"undefined"!=typeof b.cartId&&(a.cartID=b.cartId,this.isB2BUser()&&(a.priceTier=this.activeTieredPrice),a.productQuantity=this.product.quantity);try{this.spb_commonLogger("analytics ADD_TO_CART event data obj :",a);var c=window.aa.createEvent("ADD_TO_CART",a);window.dispatchEvent(c)}catch(d){console.log("Error while triggering analytics ADD_TO_CART event")}},openLoginPopupFromBanner:function(a){this.spb_commonLogger("in openLoginPopupFromBanner");
document.getElementById("business-signup-modal").classList.add("hidden");document.getElementById("store-value-prop-non-login")&&document.getElementById("store-value-prop-non-login").classList.add("hidden");document.getElementById("store-value-prop-login")&&document.getElementById("store-value-prop-login").classList.add("hidden");window.location.href=this.gotoCommerceURL("business/login")},redirectToRegistrationPage:function(){this.spb_commonLogger("in redirectToRegistrationPage");try{var a=window.aa.createEvent("GENERAL_POPUP",
{title:"business-signup-modal",eventType:"signup"});window.dispatchEvent(a)}catch(b){console.error("Error While firing GENERAL_POPUP signup event")}window.location.href=this.gotoCommerceURL("registration")+"?treg\x3db2b"},uncheckDataRecovery:function(a){this.previouslySelectedServiceProduct=a===this.previouslySelectedServiceProduct?this.selectedServiceProduct="":a},showBusinessLoginPage:function(){window.location.replace(this.gotoBusinessCommerceURL("login"))},initZinreloApi:function(a){function b(){return"undefined"!==
typeof zrl_mi&&"undefined"!==zrl_mi.init_success&&zrl_mi.init_success}function c(){if(b()){zrl_mi.get_potential_points_success_handler=function(){console.log("potential_points :: ",potential_points);d.spb_commonLogger("zinrelo potential_points",potential_points);d.loyaltyPoints=potential_points;d.showLoyaltyPoints=0<d.loyaltyPoints?!0:!1};zrl_mi.get_potential_points_failure_handler=function(){};var t=[{price:1,quantity:"1",category:""}];t[0].product_id=d.currentSku;zrl_mi.get_potential_points(t)}else setTimeout(c,
50)}var d=this;window._zrl=window._zrl||[];var f;var k=this.apiKey;var h=this.partnerId;var l=f="";a.loyaltyOptIn&&(f=null!=a.uid?a.uid:"",l=null!=a.loyaltyMemberId?a.loyaltyMemberId:"");a=Date.now();var p=l+f+h+k+a;var q={partner_id:h,email:f,user_id:l,ts:a};k=document.createElement("script");b()?getSha256Hash(p).then(function(t){q.access_token=t;_zrl.push(["init",q]);c()}):(k.onload=function(){d.spb_commonLogger("zinrelo script loaded");getSha256Hash(p).then(function(t){q.access_token=t;d.spb_commonLogger("zinrelo init data",
q);_zrl.push(["init",q]);c()});scriptLoaded=!0},k.src=this.jsLibraryUrl,document.head.appendChild(k))},productSubNavPriceUpdate:function(a){if(a)var b=a;else this.$data.inventory&&this.$data.inventory.prices.list.amount==this.$data.inventory.prices.sale.amount&&this.$data.inventory.prices.sale.amountFormatted?b=this.$data.inventory.prices.list.amountFormatted:this.$data.inventory&&this.$data.inventory.prices.list.amount!=this.$data.inventory.prices.sale.amount&&this.$data.inventory.prices.sale.amountFormatted?
b=this.$data.inventory.prices.sale.amountFormatted:this.$data.inventory&&null!=this.$data.inventory.prices.lowest&&(b=this.$data.inventory.prices.lowest.amountFormatted);document.getElementById("productPageSubNavPricePipeSymbol")&&document.getElementById("productPageSubNavPrice")&&(document.getElementById("productPageSubNavPricePipeSymbol").innerHTML=b?"|":"",document.getElementById("productPageSubNavPrice").innerHTML=b?b:"")},productImageUpdate:function(a,b,c){this.variantCategoryOptionsNewView.forEach(function(h){"color"==
h.displayType&&h.children.map(function(l){b&&b==l.variantCategory?h.variantCategoryLabel=h.variantCategoryLabel.split(":")[0]+": \x3cb\x3e"+c+"\x3c/b\x3e":b||1!=l.viewType||(h.variantCategoryLabel=h.variantCategoryLabel.split(":")[0]+": \x3cb\x3e"+l.variantCategoryLabel+"\x3c/b\x3e")})});var d=document.querySelector("#updateProductGallery .active .splide-placeholder"),f=document.querySelector("#updateProductGallery .active li.is-active.is-visible");this.currentProductImage=document.getElementById("updateProductGallery").querySelector(".active .splide-placeholder").querySelector(".img-fluid").getAttribute("src");
var k=document.querySelector("#updateProductGallery .active .splide__list .is-active.is-visible").offsetHeight;a?(a=a.substring(0,a.length-19)+".wdthumb.1280.1280.webp",d.style.height=k+"px",d.querySelector("img").setAttribute("src",a),d.classList.remove("hidden"),f.style.visibility="hidden"):(d.querySelector("img").setAttribute("src",this.currentProductImage),d.classList.add("hidden"),f.style.visibility="visible")},storeValuePropPopUp:function(){document.getElementById("store-value-prop-non-login")&&
document.getElementById("store-value-prop-non-login").classList.add("hidden");document.getElementById("store-value-prop-login")&&document.getElementById("store-value-prop-login").classList.add("hidden")},updateProductSummaryView:function(){document.getElementById("ProductCompare")&&!document.getElementById("ProductCompare").classList.contains("hidden")&&ProductCompareApp[0].changeSkuID(this.$data.currentSku,0)},addLoggedInUserAndPurchasableClasstoBody:function(){var a=this;if(!document.body.classList.contains("user-logged-in")){var b=
this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.USER_DETAILS);null==b&&this.isCatalogPurchasable?this.getUser().then(function(c){(c=a.getSessionVariable(a.$data.COMMERCE_CONSTANTS.USER_DETAILS))&&"{'uid':''}"!=c&&document.body.classList.add("user-logged-in")}):b&&"{'uid':''}"!=b&&document.body.classList.add("user-logged-in")}!document.body.classList.contains("purchasable-catalog")&&this.isCatalogPurchasable&&document.body.classList.add("purchasable-catalog")},addOverviweIdToResponsiveGrid:function(){document.getElementById("overview")&&
1==document.querySelectorAll("#overview").length&&document.getElementById("overview").closest(".responsivegrid").setAttribute("id","overview")},hideEmptySections:function(){document.getElementById("hideProductHighlights")&&"true"==document.getElementById("hideProductHighlights").value&&document.getElementById("product-highlights")?document.getElementById("product-highlights").outerHTML="":document.getElementById("product-highlights")&&document.getElementById("product-highlights").querySelector(".product-sku-list")&&
document.getElementById("product-highlights").querySelector(".product-sku-list").querySelector("div")&&""==document.getElementById("product-highlights").querySelector(".product-sku-list").querySelector("div").innerHTML.replace(/(\r\n|\n|\r|\t)/gm,"").trim()&&(document.getElementById("product-highlights").outerHTML="");document.getElementById("hideProductSpecs")&&"true"==document.getElementById("hideProductSpecs").value&&document.getElementById("product-specifications")&&(document.getElementById("product-specifications").outerHTML=
"");document.getElementById("hideProductModelNo")&&"true"==document.getElementById("hideProductModelNo").value&&document.getElementById("product-model-number")&&(document.getElementById("product-model-number").outerHTML="");document.getElementById("hideProductModelNo")&&"true"==document.getElementById("hideProductModelNo").value&&document.getElementById("hideProductSpecs")&&"true"==document.getElementById("hideProductSpecs").value&&document.getElementById("specifications")&&(document.getElementById("specifications").outerHTML=
"");document.getElementById("hideProductCompare")&&"true"==document.getElementById("hideProductCompare").value&&document.getElementById("product-compare")?document.getElementById("product-compare").outerHTML="":document.getElementById("ProductCompare")&&document.getElementById("ProductCompare").classList.contains("hidden")&&document.getElementById("product-compare")?document.getElementById("product-compare").outerHTML="":document.getElementById("product-compare")&&document.getElementById("product-compare").querySelector(".product-compare div")&&
""==document.getElementById("product-compare").querySelector(".product-compare div").innerHTML.replace(/(\r\n|\n|\r|\t)/gm,"").trim()&&(document.getElementById("product-compare").outerHTML="");document.getElementById("disclosures")&&!document.getElementById("disclosures").querySelector(".digital-commerce-attributes .digital-commerce-attributes")?document.getElementById("disclosures").outerHTML="":document.getElementById("disclosures")&&document.getElementById("disclosures").querySelector(".digital-commerce-attributes .digital-commerce-attributes").querySelector("div")&&
""==document.getElementById("disclosures").querySelector(".digital-commerce-attributes .digital-commerce-attributes").querySelector("div").innerHTML.replace(/(\r\n|\n|\r|\t)/gm,"").trim()&&(document.getElementById("disclosures").outerHTML="");document.getElementById("hideProductReviews")&&"true"==document.getElementById("hideProductReviews").value&&(document.getElementById("ratings-and-reviews").outerHTML="",document.querySelectorAll("div.product-bv").forEach(function(a){a.outerHTML=""}))},spb_commonLogger:function(a,
b){-1<window.location.search.indexOf("debugSPB\x3dtrue")&&console.log("PB : "+a,null!=b?b:"")}}});
function slidNavshow(a){a.querySelector(".splide__track ul.splide__list").classList.remove("justify-center");var b=window.innerWidth;991>b&&(b=a.querySelectorAll(".relatedProduct .splide__slide")[document.querySelectorAll(".relatedProduct .splide__slide").length-1],Array.from(b).findIndex(function(c){return c.classList.contains("is-visible")}),b.classList.contains("is-visible")?(a.getElementsByClassName("splide__track")[0].classList.remove("rightSpace"),a.getElementsByClassName("splide__track")[0].classList.add("leftSpace")):
(a.getElementsByClassName("splide__track")[0].classList.remove("leftSpace"),a.getElementsByClassName("splide__track")[0].classList.add("rightSpace")))}function initSlideUpDown(){for(var a=document.getElementsByClassName("slide-down"),b=0;b<a.length;b++)a[b].addEventListener("click",slideDown,!1);a=document.getElementsByClassName("slide-up");for(b=0;b<a.length;b++)a[b].addEventListener("click",slideUp,!1)}
function slideUp(){var a=this.parentElement.parentElement,b=a.getElementsByClassName("slide-elements");a.classList.remove("accordion-open");for(a=0;a<b.length;a++);this.style.display="none";this.previousElementSibling.style.display="initial"}function slideDown(){var a=this.parentElement.parentElement,b=a.getElementsByClassName("slide-elements");a.classList.add("accordion-open");for(a=0;a<b.length;a++);this.style.display="none";this.nextElementSibling.style.display="initial"}
function initSPB(){initSlideUpDown();addAnchorsToDisclosures()}function addAnchorsToDisclosures(){var a=document.querySelector("#overview")&&document.querySelector("#overview").querySelectorAll("sup");a&&a.forEach(function(b){b.parentElement.classList.contains("skip-for-disclosures")||isNaN(b.innerText)||(b.outerHTML='\x3ca class\x3d"disclosure" href\x3d"#disclosures'+b.innerText+'" target\x3d"_self" aria-describedby\x3d"disclosures"\x3e'+b.outerHTML+"\x3c/a\x3e")})}
document.addEventListener("DOMContentLoaded",initSPB);
window.addEventListener("load",function(){var a=document.getElementById("commerceLoad"),b=a.getAttribute("data-enableBV"),c=getCookie("Channel"),d=null!=document.getElementById("hideProductReviews")?document.getElementById("hideProductReviews").value:"";if("true"==b&&"B2B"!=c&&"true"!=d&&!document.body.hasAttribute("bvJSLoaded")){var f=document.createElement("script");f.src=a.getAttribute("data-bv-endpoint-url");document.body.appendChild(f);document.body.setAttribute("bvJSLoaded","true");null!=document.getElementById("sticky-nav")&&
document.querySelector(".reviews-subnavItem").classList.remove("hidden")}if("false"==b||"true"==b&&"B2B"==c||"true"==b&&"B2B"!=c&&"true"==d)null!=document.querySelector("div.component-product-bv")&&0==document.querySelector("div.component-product-bv").children.length&&document.querySelectorAll("div.component-product-bv").forEach(function(k){null!==k.closest("section.component-accordian-text")&&(k.closest("section.component-accordian-text").outerHTML="")}),document.getElementById("ratings-and-reviews")&&
document.getElementById("ratings-and-reviews").remove(),document.querySelectorAll("div.product-bv").forEach(function(k){k.outerHTML=""})});document.addEventListener("DOMContentLoaded",function(){});
Vue.newInstance("StoreProductCompatibilityApp",{el:"#store-product-compatability-component",mixins:[commerceService],data:{excelDataStore:{},userSelectedVendorName:"",excelUniqueVendors:[],userSelectedVendorModel:"",excelUniqueVendorModels:[],tableData:[],isCatalogPurchasable:!0,productReferences:{},matchedSkuJson:{}},mounted:function(){this.initProductCompatabilityInfo()},methods:{initProductCompatabilityInfo:function(){var a=this;this.productCompatabilityInfoLogger("in initProductCompatabilityInfo...");
this.$data.isCatalogPurchasable=this.getPurchasableCatalog();this.loadProductRefereces();var b=this.$refs.urlSelectors.dataset.urlselectors,c="",d="";b&&(b=b.split(","),c=b[0],d=b[1]);b=this.$refs.excelPath.dataset.excelpath;this.productCompatabilityInfoLogger("excelPath: "+b);var f=this.$refs.sheetName.dataset.sheetname;this.productCompatabilityInfoLogger("sheetName: "+f);var k="";k=f?this.getPlatformCommerceURL()+b+".exceltojson."+f+".json":this.getPlatformCommerceURL()+b+".exceltojson.json";this.productCompatabilityInfoLogger("servletUrl: "+
k);fetch(k,{credentials:"include"}).then(function(h){var l=h.headers.get("content-type");if(h.ok&&l&&-1!==l.indexOf("application/json"))return h.json();l={};l.status=h.status;l.statusText=h.statusText;throw Error(JSON.stringify(l));}).then(function(h){if(h){a.productCompatabilityInfoLogger("Success: "+JSON.stringify(h));a.$data.excelDataStore=h[0].data;for(h=0;h<a.$data.excelDataStore.length;h++){var l=a.$data.excelDataStore[h].vendorName;l&&(l=l.trim(),a.$data.excelUniqueVendors.includes(l)||a.$data.excelUniqueVendors.push(l))}a.loadSelectors(c,
d)}}).catch(function(h){a.productCompatabilityInfoLogger("Error occured",h)})},loadSelectors:function(a,b){this.productCompatabilityInfoLogger("in loadSelectors..."+a+":"+b);a&&setTimeout(function(){document.getElementById("userSelectedVendorNameId").value=a;document.getElementById("userSelectedVendorNameId").dispatchEvent(new Event("change"));setTimeout(function(){b&&(document.getElementById("urlSelectorVendorModelId").value=b,document.getElementById("urlSelectorVendorModelId").dispatchEvent(new Event("change")))},
1E3)},1E3)},onVendorChange:function(a){this.productCompatabilityInfoLogger("in onVendorChange...");this.$data.tableData=[];this.$data.excelUniqueVendorModels=[];this.$data.userSelectedVendorModel="";a=a.target.value.trim();this.productCompatabilityInfoLogger("selectedVendorName: "+a);for(var b=0;b<this.$data.excelDataStore.length;b++){var c=this.$data.excelDataStore[b].vendorModelNumber;if(c){c=c.trim();var d=this.$data.excelDataStore[b].vendorName;d&&(d=d.trim());d!==a||this.$data.excelUniqueVendorModels.includes(c)||
this.$data.excelUniqueVendorModels.push(c)}}},onVendorModelChange:function(a){this.productCompatabilityInfoLogger("in onVendorModelChange...");""===this.$data.userSelectedVendorModel&&(this.$data.tableData=[]);if(a=a.target.value)for(a=a.trim(),this.productCompatabilityInfoLogger("selectedVendorModel: "+a),this.$data.tableData=[],a=0;a<this.$data.excelDataStore.length;a++){var b=this.$data.excelDataStore[a],c=b.vendorModelNumber;if(c){c=c.trim();var d=b.vendorName;d&&(d=d.trim());d===this.$data.userSelectedVendorName&&
c===this.$data.userSelectedVendorModel&&(this.$data.tableData.push(b),(b=b["wd-model-number"])&&(b=b.trim()),this.formulateMatchedSkuList(b))}}},loadProductRefereces:function(){var a=this;this.productCompatabilityInfoLogger("in loadProductRefereces...");this.$data.productReferences=this.getSessionVariable(this.$data.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);null==this.$data.productReferences&&this.getProductReferences().then(function(){a.$data.productReferences=a.getSessionVariable(a.$data.COMMERCE_CONSTANTS.PRODUCT_REFERENCES);
a.productCompatabilityInfoLogger("product references loaded.")}).catch(function(b){a.productCompatabilityInfoLogger("Issue in getting product references ",b)})},formulateMatchedSkuList:function(a){this.productCompatabilityInfoLogger("in formulateMatchedSkuList...");var b=this.$data.productReferences[a];if(b&&!this.$data.matchedSkuJson[a]){var c={};c.capacityTitle=b.categories["vc-capacity"].data[0].title;c.pagePath=b.pagePath;this.$data.matchedSkuJson[a]=c;this.productCompatabilityInfoLogger("new json added for ["+
a+"] \x3d\x3e "+c)}},setMatchedSkuPrice:function(a,b){var c=this;this.productCompatabilityInfoLogger("in setMatchedSkuPrice for ["+a+"] and ["+b+"]...");if(this.isCatalogPurchasable){var d=this.getSessionVariable(a);d&&d.prices&&d.prices.sale&&d.prices.sale.amountFormatted?setTimeout(function(){c.productCompatabilityInfoLogger("price for ["+a+"] and ["+b+"] from session cache: "+d.prices.sale.amountFormatted);document.getElementById(b).innerText=d.prices.sale.amountFormatted},"1000"):this.getProductPrice(a).then(function(){var f=
c.getSessionVariable(a);f&&f.prices&&f.prices.sale&&f.prices.sale.amountFormatted&&setTimeout(function(){c.productCompatabilityInfoLogger("price for ["+a+"] and ["+b+"] from service response: "+f.prices.sale.amountFormatted);document.getElementById(b).innerText=f.prices.sale.amountFormatted},"1000")}).catch(function(f){c.productCompatabilityInfoLogger(a+" Error occurred while getting price info",f)})}},getFromMatchedSku:function(a,b){this.productCompatabilityInfoLogger("in getFromMatchedSku...");
if(!this.$data.matchedSkuJson[a])return"";this.productCompatabilityInfoLogger("return macthed sku info for ["+a+"] and ["+b+"] and ["+this.$data.matchedSkuJson[a][b]+"]");return this.$data.matchedSkuJson[a][b]},productCompatabilityInfoLogger:function(a,b){-1<window.location.search.indexOf("debugProductCompatability\x3dtrue")&&(console.log("product compatability info: "+a),b?console.log(b):"")}}});