{"version":3,"file":"default/js/search.js","mappings":";;;;;;;;;;AAAa;;AAEb;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClCa;;AAEb;AACA;AACA,WAAW,MAAM;AACjB,WAAW,UAAU;AACrB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,kBAAkB;AACjC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,0BAA0B;AAC9C;AACA;AACA;AACA;AACA;AACA,mEAAmE;AACnE;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,0FAA0F;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA,6CAA6C;AAC7C,iDAAiD;AACjD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;AChGa;AACb;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA,0CAA0C;AAC1C,oBAAoB,oBAAoB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB;AACA;AACA;AACA;;AAEA,6CAA6C,oCAAoC;AACjF;;AAEA;AACA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB;AACjB,iBAAiB;AACjB,sBAAsB;;;;;;;;;;;;AClDT;AACb,kBAAkB,mBAAO,CAAC,+GAAqB;AAC/C,sBAAsB,mBAAO,CAAC,iHAAsB;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB;;AAEA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,sBAAsB;AACpC;;AAEA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,WAAW,UAAU;AACrB,WAAW,SAAS;AACpB;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,MAAM;AACN;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,SAAS;AACvB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB;AACA;;AAEA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;;AAEjB;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,iBAAiB;AACjB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;;AAEA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3pCa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA,+FAA+F;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACvEa;AACb,WAAW,mBAAO,CAAC,8FAAQ;AAC3B,kBAAkB,mBAAO,CAAC,+GAAqB;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,eAAe;AAC3B;AACA;AACA;;AAEA;AACA;;AAEA,aAAa;AACb;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA,6CAA6C,mCAAmC;;AAEhF;AACA,6CAA6C,wCAAwC;;AAErF;AACA;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;ACxMa;AACb,kBAAkB,mBAAO,CAAC,qHAAwB;AAClD,cAAc,mBAAO,CAAC,mHAAuB;AAC7C,eAAe,mBAAO,CAAC,0DAAiB;AACxC,YAAY,mBAAO,CAAC,qGAAgB;;AAEpC;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA,WAAW,GAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,sDAAsD,EAAE;AACxD;;AAEA;AACA;AACA;AACA,+DAA+D,IAAI,OAAO,EAAE;AAC5E;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wBAAwB,yBAAyB;AACjD;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wBAAwB,0BAA0B;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;;AAEA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sBAAsB;AACtB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,qBAAqB;;AAErB;AACA,aAAa;AACb,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,sDAAsD,oBAAoB;AAC1E;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,sDAAsD,oBAAoB;AAC1E;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,aAAa;AACb,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB,cAAc;AACd;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;;;;;;;;;;;;ACl1Ba;;AAEb;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;ACZa;;AAEb;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;ACjGA,WAAW,mBAAO,CAAC,+CAAS;;AAE5B;AACA;;AAEA;;;;;;;;;;;ACLA,aAAa,mBAAO,CAAC,mDAAW;AAChC,gBAAgB,mBAAO,CAAC,yDAAc;AACtC,qBAAqB,mBAAO,CAAC,mEAAmB;;AAEhD;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;AC3BA,sBAAsB,mBAAO,CAAC,qEAAoB;;AAElD;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;AClBA;AACA,wBAAwB,qBAAM,gBAAgB,qBAAM,IAAI,qBAAM,sBAAsB,qBAAM;;AAE1F;;;;;;;;;;;ACHA,aAAa,mBAAO,CAAC,mDAAW;;AAEhC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;AC7CA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;;;;;;;;;;;ACrBA,iBAAiB,mBAAO,CAAC,2DAAe;;AAExC;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;ACRA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;AClBA,eAAe,mBAAO,CAAC,qDAAY;AACnC,UAAU,mBAAO,CAAC,2CAAO;AACzB,eAAe,mBAAO,CAAC,qDAAY;;AAEnC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB,WAAW,QAAQ,WAAW;AAC9B,WAAW,SAAS;AACpB;AACA,WAAW,QAAQ;AACnB;AACA,WAAW,SAAS;AACpB;AACA,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,+CAA+C,iBAAiB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;AC9LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,aAAa,SAAS;AACtB;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,aAAa,SAAS;AACtB;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;AC5BA,iBAAiB,mBAAO,CAAC,2DAAe;AACxC,mBAAmB,mBAAO,CAAC,6DAAgB;;AAE3C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;AC5BA,WAAW,mBAAO,CAAC,+CAAS;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;ACtBA,eAAe,mBAAO,CAAC,uDAAa;AACpC,eAAe,mBAAO,CAAC,qDAAY;AACnC,eAAe,mBAAO,CAAC,qDAAY;;AAEnC;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;AC/DA;AACA,IAAI,KAAyC;AAC7C,IAAI,iCAAO,EAAE,mCAAE;AACf;AACA,KAAK;AAAA,kGAAC,GAAG,CAGsD;AAC/D,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,yBAAyB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wFAAwF;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,qBAAqB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,8BAA8B;AAC9B;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,6BAA6B,gEAAgE;AAC7F;AACA;AACA;AACA,CAAC;;;;;;UCzGD;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,GAAG;WACH;WACA;WACA,CAAC;;;;;;;;;;;ACPY;;AAEb,qBAAqB,mBAAO,CAAC,sFAAQ;;AAErC;AACA,mBAAmB,mBAAO,CAAC,wGAAiB;AAC5C,mBAAmB,mBAAO,CAAC,gHAAqB;AAChD,CAAC;;;;;;;;ACPD,mBAAO,CAAC,yEAAe,IAAI","sources":["webpack://sfra-startup-kit/./cartridges/app_custom_fraserhart/cartridge/client/default/js/components/focus.js","webpack://sfra-startup-kit/./cartridges/app_custom_fraserhart/cartridge/client/default/js/components/v12Tile.js","webpack://sfra-startup-kit/./cartridges/app_custom_fraserhart/cartridge/client/default/js/helpers/pageHelpers.js","webpack://sfra-startup-kit/./cartridges/app_custom_fraserhart/cartridge/client/default/js/product/base.js","webpack://sfra-startup-kit/./cartridges/app_custom_fraserhart/cartridge/client/default/js/product/countdown.js","webpack://sfra-startup-kit/./cartridges/app_custom_fraserhart/cartridge/client/default/js/product/quickView.js","webpack://sfra-startup-kit/./cartridges/app_custom_fraserhart/cartridge/client/default/js/search/search.js","webpack://sfra-startup-kit/./cartridges/app_custom_fraserhart/cartridge/client/default/js/util.js","webpack://sfra-startup-kit/./cartridges/app_custom_fraserhart/cartridge/client/default/js/utils/utils.js","webpack://sfra-startup-kit/./node_modules/lodash/_Symbol.js","webpack://sfra-startup-kit/./node_modules/lodash/_baseGetTag.js","webpack://sfra-startup-kit/./node_modules/lodash/_baseTrim.js","webpack://sfra-startup-kit/./node_modules/lodash/_freeGlobal.js","webpack://sfra-startup-kit/./node_modules/lodash/_getRawTag.js","webpack://sfra-startup-kit/./node_modules/lodash/_objectToString.js","webpack://sfra-startup-kit/./node_modules/lodash/_root.js","webpack://sfra-startup-kit/./node_modules/lodash/_trimmedEndIndex.js","webpack://sfra-startup-kit/./node_modules/lodash/debounce.js","webpack://sfra-startup-kit/./node_modules/lodash/isObject.js","webpack://sfra-startup-kit/./node_modules/lodash/isObjectLike.js","webpack://sfra-startup-kit/./node_modules/lodash/isSymbol.js","webpack://sfra-startup-kit/./node_modules/lodash/now.js","webpack://sfra-startup-kit/./node_modules/lodash/toNumber.js","webpack://sfra-startup-kit/./node_modules/svg4everybody/dist/svg4everybody.js","webpack://sfra-startup-kit/webpack/bootstrap","webpack://sfra-startup-kit/webpack/runtime/global","webpack://sfra-startup-kit/./cartridges/app_custom_fraserhart/cartridge/client/default/js/search.js","webpack://sfra-startup-kit/./node_modules/svg-spritemap-webpack-plugin/svg4everybody-helper.js"],"sourcesContent":["'use strict';\n\nmodule.exports = {\n setTabNextFocus: function (focusParams) {\n var KEYCODE_TAB = 9;\n var isTabPressed = (focusParams.event.key === 'Tab' || focusParams.event.keyCode === KEYCODE_TAB);\n\n if (!isTabPressed) {\n return;\n }\n\n var firstFocusableEl = $(focusParams.containerSelector + ' ' + focusParams.firstElementSelector);\n var lastFocusableEl = $(focusParams.containerSelector + ' ' + focusParams.lastElementSelector);\n\n if ($(focusParams.containerSelector + ' ' + focusParams.lastElementSelector).is(':disabled')) {\n lastFocusableEl = $(focusParams.containerSelector + ' ' + focusParams.nextToLastElementSelector);\n if ($('.product-quickview.product-set').length > 0) {\n var linkElements = $(focusParams.containerSelector + ' a#fa-link.share-icons');\n lastFocusableEl = linkElements[linkElements.length - 1];\n }\n }\n\n if (focusParams.event.shiftKey) /* shift + tab */ {\n if ($(':focus').is(firstFocusableEl)) {\n lastFocusableEl.focus();\n focusParams.event.preventDefault();\n }\n } else /* tab */ {\n if ($(':focus').is(lastFocusableEl)) { // eslint-disable-line\n firstFocusableEl.focus();\n focusParams.event.preventDefault();\n }\n }\n }\n};\n","'use strict';\n\n/**\n * Adds a MutationObserver to a target node and performs an action when a childList mutation occurs\n * @param {Node} targetNode - the target node to observe\n * @param {Function} actionToPerform - the action to perform when a childList mutation occurs\n * @returns {void}\n */\nfunction addMutationObserverAction(targetNode, actionToPerform) {\n // observer options\n const config = {\n attributes: true,\n childList: true,\n subtree: true\n };\n\n // callback function for observer\n /**\n * Callback function for observing mutations in a DOM element\n * @param {Array} mutationsList - List of mutations observed\n * @param {MutationObserver} observer - The MutationObserver object\n */\n const callback = function (mutationsList, observer) {\n for (const mutation of mutationsList) {\n if (mutation.type === 'childList') {\n // action to perform\n actionToPerform();\n\n // disconnect observer\n observer.disconnect();\n }\n }\n };\n\n // create observer instance and observe\n const mutationObserver = new MutationObserver(callback);\n mutationObserver.observe(targetNode, config);\n}\n\n/**\n * Updates the product tiles with V12 finance information\n */\nfunction updateProductTiles() {\n const $productTiles = $('.product-tile');\n\n for (let i = 0; i < $productTiles.length; i++) {\n let currentTile = $productTiles[i];\n let v12eligibility = $(currentTile).attr('data-v12eligibility');\n let v12productfilterterms = JSON.parse($(currentTile).attr('data-productfilterterms'));\n if (v12productfilterterms && v12productfilterterms.length > 0) {\n let productId = v12productfilterterms[v12productfilterterms.length-1] ? v12productfilterterms[v12productfilterterms.length-1].productId : v12productfilterterms[0].productId;\n let financeProduct = V12.getFinanceProduct(productId); // eslint-disable-line\n if (financeProduct) {\n if (v12eligibility == 'true') {\n let cashPrice = $(currentTile).attr('data-cashprice');\n\n if (cashPrice != 'null') {\n let depositFactor = $(currentTile).attr('data-depositfactor');\n let deposit = parseInt(Math.ceil(cashPrice * depositFactor), 10) / 100;\n deposit = parseFloat(deposit.toFixed(2));\n\n let payments = V12.calculate(financeProduct, cashPrice, deposit); // eslint-disable-line\n let v12Amount = $(currentTile).find('.v12-amount').text();\n let newV12Money = v12Amount.replace('0.00', payments.initialPayments);\n $(currentTile).find('.v12-amount').text(newV12Money);\n }\n }\n }\n }\n }\n}\n\n/**\n * Updates the V12 tile\n * @returns {void}\n */\nfunction updateTileV12() {\n if (typeof V12 !== 'undefined' && V12) { // eslint-disable-line\n let products = V12.getFinanceProducts(); // eslint-disable-line\n if (products && products.length > 0) {\n const $productTiles = $('.product-tile');\n const $tileV12Recommender = $('[id*=cq_recomm_slot]');\n\n if ($productTiles.length) {\n updateProductTiles();\n }\n\n if ($tileV12Recommender.length && $tileV12Recommender.is(':empty')) {\n addMutationObserverAction($tileV12Recommender[0], updateProductTiles);\n }\n }\n }\n}\n\nmodule.exports = {\n updateTileV12: updateTileV12\n};\n","'use strict';\n/**\n * @function getCookie\n *\n * @param {string} key - The cookie name\n * @returns {string} value - the value of the cookie if found, null otherwise\n **/\nfunction getCookie(key) {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var tokens = cookies[i].split('=');\n var cookieKey = tokens[0].trim();\n if (cookieKey === key) {\n return tokens[1];\n }\n }\n return '';\n}\n\n/**\n * @function setCookie\n *\n * @param {string} key - The cookie name\n * @param {string} value - The cookie value\n * @param {integer} minutes - The number of minutes to expire the cookie\n **/\nfunction setCookie(key, value, minutes) {\n var date = new Date();\n date.setTime(date + (minutes * 60 * 1000));\n\n document.cookie = key + '=' + value + '; expires=' + date.toGMTString() + '; path=/';\n}\n\n/**\n * @function isMobileDevice\n * \n * @returns {boolean} value - the value true if the device is mobile\n **/\nfunction isMobileDevice() {\n // condition to check if device is tablet IOS \n let isIpad = /Macintosh/i.test(navigator.userAgent) && navigator.maxTouchPoints && navigator.maxTouchPoints > 1 && window.innerWidth <= 991;\n\n if (/Android|webOS|iPhone|iPod|iPad|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && window.innerWidth <= 991 || isIpad) {\n return true;\n }\n return false;\n}\n\nexports.setCookie = setCookie;\nexports.getCookie = getCookie;\nexports.isMobileDevice = isMobileDevice;\n","'use strict';\nvar focusHelper = require('../components/focus');\nvar countdownHelper = require('../product/countdown');\n\nfunction removeMainProductBonusProductModal() {\n let url = $('.choose-bonus-product-dialog').data('removeproducturl');\n if ($('.choose-bonus-product-dialog').data('updatequantityurl') !== 'undefined') {\n url = $('.choose-bonus-product-dialog').data('updatequantityurl');\n }\n $.ajax({\n url: url,\n method: 'GET',\n success: function (data) {\n $('.minicart').trigger('count:update', data);\n }\n });\n}\n\n/**\n * Retrieves the relevant pid value\n * @param {jquery} $el - DOM container for a given add to cart button\n * @return {string} - value to be used when adding product to cart\n */\nfunction getPidValue($el) {\n var pid;\n\n if ($('#quickViewModal').hasClass('show') && !$('.product-set').length) {\n pid = $($el).closest('.modal-content').find('.product-quickview').data('pid');\n } else if ($('.product-set-detail').length || $('.product-set').length) {\n pid = $($el).closest('.product-detail').attr('data-pid');\n } else {\n pid = $('.product-detail:not(\".bundle-item\")').data('pid');\n }\n\n return pid;\n}\n\n/**\n * Retrieve contextual quantity selector\n * @param {jquery} $el - DOM container for the relevant quantity\n * @return {jquery} - quantity selector DOM container\n */\nfunction getQuantitySelector($el) {\n var quantitySelected;\n if ($el && $('.set-items').length) {\n quantitySelected = $($el).closest('.product-detail').find('.quantity-select');\n } else if ($el && $('.product-bundle').length) {\n var quantitySelectedModal = $($el).closest('.modal-footer').find('.quantity-select');\n var quantitySelectedPDP = $($el).closest('.bundle-footer').find('.quantity-select');\n if (quantitySelectedModal.val() === undefined) {\n quantitySelected = quantitySelectedPDP;\n } else {\n quantitySelected = quantitySelectedModal;\n }\n } else {\n quantitySelected = $('.quantity-select');\n }\n return quantitySelected;\n}\n\n/**\n * Retrieves the value associated with the Quantity pull-down menu\n * @param {jquery} $el - DOM container for the relevant quantity\n * @return {string} - value found in the quantity input\n */\nfunction getQuantitySelected($el) {\n return getQuantitySelector($el).val();\n}\n\n/**\n * Process the attribute values for an attribute that has image swatches\n *\n * @param {Object} attr - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {Object[]} attr.values - Array of attribute value objects\n * @param {string} attr.values.value - Attribute coded value\n * @param {string} attr.values.url - URL to de/select an attribute value of the product\n * @param {boolean} attr.values.isSelectable - Flag as to whether an attribute value can be\n * selected. If there is no variant that corresponds to a specific combination of attribute\n * values, an attribute may be disabled in the Product Detail Page\n * @param {jQuery} $productContainer - DOM container for a given product\n * @param {Object} msgs - object containing resource messages\n */\nfunction processSwatchValues(attr, $productContainer, msgs) {\n attr.values.forEach(function (attrValue) {\n var $attrValue = $productContainer.find('[data-attr=\"' + attr.id + '\"] [data-attr-value=\"' +\n attrValue.value + '\"]');\n var $swatchButton = $attrValue.parent();\n\n if (attrValue.selected) {\n $attrValue.addClass('selected');\n $attrValue.siblings('.selected-assistive-text').text(msgs.assistiveSelectedText);\n } else {\n $attrValue.removeClass('selected');\n $attrValue.siblings('.selected-assistive-text').empty();\n }\n\n if (attrValue.url) {\n $swatchButton.attr('data-url', attrValue.url);\n } else {\n $swatchButton.removeAttr('data-url');\n }\n\n // Disable if not selectable\n $attrValue.removeClass('selectable unselectable');\n\n $attrValue.addClass(attrValue.selectable ? 'selectable' : 'unselectable');\n });\n}\n\n/**\n * Process attribute values associated with an attribute that does not have image swatches\n *\n * @param {Object} attr - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {Object[]} attr.values - Array of attribute value objects\n * @param {string} attr.values.value - Attribute coded value\n * @param {string} attr.values.url - URL to de/select an attribute value of the product\n * @param {boolean} attr.values.isSelectable - Flag as to whether an attribute value can be\n * selected. If there is no variant that corresponds to a specific combination of attribute\n * values, an attribute may be disabled in the Product Detail Page\n * @param {jQuery} $productContainer - DOM container for a given product\n */\nfunction processNonSwatchValues(attr, $productContainer) {\n var $attr = '[data-attr=\"' + attr.id + '\"]';\n var $defaultOption = $productContainer.find($attr + ' .select-' + attr.id + ' option:first');\n $defaultOption.attr('value', attr.resetUrl);\n\n attr.values.forEach(function (attrValue) {\n var $attrValue = $productContainer\n .find($attr + ' [data-attr-value=\"' + attrValue.value + '\"]');\n $attrValue.attr('value', attrValue.url)\n .removeAttr('disabled');\n\n if (!attrValue.selectable) {\n $attrValue.attr('disabled', true);\n }\n });\n}\n\n/**\n * Routes the handling of attribute processing depending on whether the attribute has image\n * swatches or not\n *\n * @param {Object} attrs - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {jQuery} $productContainer - DOM element for a given product\n * @param {Object} msgs - object containing resource messages\n */\nfunction updateAttrs(attrs, $productContainer, msgs) {\n // Currently, the only attribute type that has image swatches is Color.\n var attrsWithSwatches = ['color'];\n\n attrs.forEach(function (attr) {\n if (attrsWithSwatches.indexOf(attr.id) > -1) {\n processSwatchValues(attr, $productContainer, msgs);\n } else {\n processNonSwatchValues(attr, $productContainer);\n }\n });\n}\n\n/**\n * Updates the availability status in the Product Detail Page\n *\n * @param {Object} response - Ajax response object after an\n * attribute value has been [de]selected\n * @param {jQuery} $productContainer - DOM element for a given product\n */\nfunction updateAvailability(response, $productContainer) {\n var availabilityValue = '';\n var availabilityMessages = response.product.availability.messages;\n if (!response.product.readyToOrder) {\n availabilityValue = '
  • ' + response.resources.info_selectforstock + '
  • ';\n } else {\n availabilityMessages.forEach(function (message) {\n availabilityValue += '
  • ' + message + '
  • ';\n });\n }\n\n $($productContainer).trigger('product:updateAvailability', {\n product: response.product,\n $productContainer: $productContainer,\n message: availabilityValue,\n resources: response.resources\n });\n}\n\n/**\n * Generates html for product attributes section\n *\n * @param {array} attributes - list of attributes\n * @return {string} - Compiled HTML\n */\nfunction getAttributesHtml(attributes) {\n if (!attributes) {\n return '';\n }\n\n var html = '';\n\n attributes.forEach(function (attributeGroup) {\n if (attributeGroup.ID === 'mainAttributes') {\n attributeGroup.attributes.forEach(function (attribute) {\n html += '
    ' + attribute.label + ': ' +\n attribute.value + '
    ';\n });\n }\n });\n\n return html;\n}\n\n/**\n * @typedef UpdatedOptionValue\n * @type Object\n * @property {string} id - Option value ID for look up\n * @property {string} url - Updated option value selection URL\n */\n\n/**\n * @typedef OptionSelectionResponse\n * @type Object\n * @property {string} priceHtml - Updated price HTML code\n * @property {Object} options - Updated Options\n * @property {string} options.id - Option ID\n * @property {UpdatedOptionValue[]} options.values - Option values\n */\n\n/**\n * Updates DOM using post-option selection Ajax response\n *\n * @param {OptionSelectionResponse} optionsHtml - Ajax response optionsHtml from selecting a product option\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction updateOptions(optionsHtml, $productContainer) {\n // Update options\n $productContainer.find('.product-options').empty().html(optionsHtml);\n}\n\n/**\n * Dynamically creates Bootstrap carousel from response containing images\n * @param {Object[]} imgs - Array of large product images,along with related information\n * @param {jQuery} $productContainer - DOM element for a given product\n */\nfunction createCarousel(imgs, $productContainer) {\n var carousel = $productContainer.find('.carousel');\n $(carousel).carousel('dispose');\n var carouselId = $(carousel).attr('id');\n $(carousel).empty().append('
      ');\n for (var i = 0; i < imgs.length; i++) {\n $('
      \"'
      ').appendTo($(carousel).find('.carousel-inner'));\n $('
    1. ').appendTo($(carousel).find('.carousel-indicators'));\n }\n $($(carousel).find('.carousel-item')).first().addClass('active');\n $($(carousel).find('.carousel-indicators > li')).first().addClass('active');\n if (imgs.length === 1) {\n $($(carousel).find('.carousel-indicators, a[class^=\"carousel-control-\"]')).detach();\n }\n $(carousel).carousel();\n $($(carousel).find('.carousel-indicators')).attr('aria-hidden', true);\n}\n\n/**\n * Parses JSON from Ajax call made whenever an attribute value is [de]selected\n * @param {Object} response - response from Ajax call\n * @param {Object} response.product - Product object\n * @param {string} response.product.id - Product ID\n * @param {Object[]} response.product.variationAttributes - Product attributes\n * @param {Object[]} response.product.images - Product images\n * @param {boolean} response.product.hasRequiredAttrsSelected - Flag as to whether all required\n * attributes have been selected. Used partially to\n * determine whether the Add to Cart button can be enabled\n * @param {jQuery} $productContainer - DOM element for a given product.\n */\nfunction handleVariantResponse(response, $productContainer, isSizeAttr) {\n var isChoiceOfBonusProducts =\n $productContainer.parents('.choose-bonus-product-dialog').length > 0;\n var isVaraint;\n if (response.product.variationAttributes) {\n updateAttrs(response.product.variationAttributes, $productContainer, response.resources);\n isVaraint = response.product.productType === 'variant';\n if (isChoiceOfBonusProducts && isVaraint) {\n $productContainer.parent('.bonus-product-item')\n .data('pid', response.product.id);\n\n $productContainer.parent('.bonus-product-item')\n .data('ready-to-order', response.product.readyToOrder);\n }\n }\n\n // Update primary images\n if (!isSizeAttr) {\n var primaryImageUrls = response.product.images.large;\n createCarousel(primaryImageUrls, $productContainer);\n }\n\n // Update pricing\n if (!isChoiceOfBonusProducts) {\n var $priceSelector = $('.prices .price', $productContainer).length ?\n $('.prices .price', $productContainer) :\n $('.prices .price');\n $priceSelector.replaceWith(response.product.price.html);\n }\n\n // Update saving text\n var $savingSelector = $('.pdp-saving');\n\n if ($savingSelector.length) {\n $savingSelector.empty();\n\n if (response.product.savingPrice && response.product.savingPrice.html) {\n $savingSelector.html(response.product.savingPrice.html);\n }\n }\n\n // Update promotions\n $productContainer.find('.promotions').empty().html(response.product.promotionsHtml);\n\n updateAvailability(response, $productContainer);\n\n if (isChoiceOfBonusProducts) {\n var $selectButton = $productContainer.find('.select-bonus-product');\n $selectButton.trigger('bonusproduct:updateSelectButton', {\n product: response.product,\n $productContainer: $productContainer\n });\n } else {\n // Enable \"Add to Cart\" button if all required attributes have been selected\n $('body').trigger('product:updateAddToCart', {\n product: response.product,\n $productContainer: $productContainer\n }).trigger('product:statusUpdate', response.product);\n }\n\n // Update attributes\n $productContainer.find('.main-attributes').empty()\n .html(getAttributesHtml(response.product.attributes));\n}\n\n/**\n * @typespec UpdatedQuantity\n * @type Object\n * @property {boolean} selected - Whether the quantity has been selected\n * @property {string} value - The number of products to purchase\n * @property {string} url - Compiled URL that specifies variation attributes, product ID, options,\n * etc.\n */\n\n/**\n * Updates the quantity DOM elements post Ajax call\n * @param {UpdatedQuantity[]} quantities -\n * @param {jQuery} $productContainer - DOM container for a given product\n */\nfunction updateQuantities(quantities, $productContainer) {\n if ($productContainer.parent('.bonus-product-item').length <= 0) {\n var optionsHtml = quantities.map(function (quantity) {\n var selected = quantity.selected ? ' selected ' : '';\n return '';\n }).join('');\n getQuantitySelector($productContainer).empty().html(optionsHtml);\n }\n}\n\n/**\n * Updates DOM using post-option selection Ajax response\n *\n * @param {htmlString} badgesHtml - Ajax response badgesHtml from selecting a product option\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction updateBadges(badgesHtml, $productContainer) {\n // Updates product badges\n $productContainer.find('.product-badges').empty().html(badgesHtml);\n}\n\n/**\n * Updates DOM using post-option selection Ajax response\n *\n * @param {htmlString} specialOrder - Ajax response specialOrder from selecting a product option\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction updateSpecialOrder(specialOrder, $productContainer) {\n if (specialOrder.isSpecialOrder && specialOrder.specialOrderRenderedTemplate) {\n $productContainer.find('.special-order-container').empty().html(specialOrder.specialOrderRenderedTemplate);\n } else {\n $productContainer.find('.special-order-container').empty();\n }\n}\n\n/**\n * Updates DOM using post-option selection Ajax response\n *\n * @param {htmlString} v12eligibility - Ajax response v12eligibility from selecting a product option\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction updateV12FinanceCalculator(v12eligibility, $productContainer) {\n if (v12eligibility.eligible && v12eligibility.v12RenderedTemplate) {\n $productContainer.find('.v12-row').empty().html(v12eligibility.v12RenderedTemplate);\n } else {\n $productContainer.find('.v12-row').empty();\n }\n}\n\nfunction updateV12ModalValues(v12_cashPrice, v12_cashDeposit, v12_minDepositPercentage, v12_maxDepositPercentage, currencySymbol) {\n $('.v12-form #cashPrice').val(v12_cashPrice);\n $('.v12-form #cashDeposit').val(v12_cashDeposit);\n $('.v12-form #deposit').val(v12_minDepositPercentage);\n $('.v12-form #depRange').attr('min', v12_minDepositPercentage);\n $('.v12-form #depRange').attr('max', v12_maxDepositPercentage);\n $('.v12-form .body.v12').data('currency', currencySymbol);\n var $depRange = $('#depRange').val();\n\n if ($depRange) {\n $('.deposit-range-input').val($depRange);\n }\n\n $('#productsList').trigger('change');\n}\n\n/**\n * updates the product view when a product attribute is selected or deselected or when\n * changing quantity\n * @param {string} selectedValueUrl - the Url for the selected variation value\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction attributeSelect(selectedValueUrl, $productContainer, isSizeAttr) {\n if (selectedValueUrl) {\n $('body').trigger('product:beforeAttributeSelect', {\n url: selectedValueUrl,\n container: $productContainer\n });\n\n $.ajax({\n url: selectedValueUrl,\n method: 'GET',\n success: function (data) {\n handleVariantResponse(data, $productContainer, isSizeAttr);\n updateOptions(data.product.optionsHtml, $productContainer);\n updateQuantities(data.product.quantities, $productContainer);\n if (data.product.badges && data.product.badges.badgesRenderedTemplate) {\n updateBadges(data.product.badges.badgesRenderedTemplate, $productContainer);\n } else {\n $productContainer.find('.product-badges').empty();\n }\n\n if (data.product.specialOrder) {\n updateSpecialOrder(data.product.specialOrder, $productContainer);\n }\n\n if (data.product.v12eligibility) {\n updateV12FinanceCalculator(data.product.v12eligibility, $productContainer);\n }\n\n if (data.v12_cashDeposit && data.v12_cashPrice\n && data.v12_minDepositPercentage >= 0\n && data.v12_maxDepositPercentage\n && data.currencySymbol\n ) {\n updateV12ModalValues(data.v12_cashPrice, data.v12_cashDeposit, data.v12_minDepositPercentage, data.v12_maxDepositPercentage, data.currencySymbol);\n }\n\n $productContainer.find('.add-to-wish-list').toggleClass('d-none', data.product.wishlistItemExists);\n $productContainer.find('.remove-from-wish-list').toggleClass('d-none', !data.product.wishlistItemExists);\n\n updateProductStockAvailability($productContainer, data.product.id);\n getCountdownTimerStatus($productContainer, data.product.id);\n\n $('body').trigger('product:afterAttributeSelect', {\n data: data,\n container: $productContainer\n });\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n }\n}\n\nfunction updateProductStockAvailability($container, productID) {\n var productStockAvailabilityURL = $('input[name=productStockAvailabilityURL]').val();\n var $productStockAvailability = $container.find('.product-stock-availablity');\n $.ajax({\n url: productStockAvailabilityURL + '?pid=' + productID,\n method: 'GET',\n success: function (response) {\n $productStockAvailability.html(response);\n }\n });\n}\n\nfunction getCountdownTimerStatus($container, productID) {\n var isCountdownTimerEnabledURL = $('input[name=isCountdownTimerEnabledURL]').val();\n var $countdownTimer = $container.find('.countdown-wrapper');\n \n if (isCountdownTimerEnabledURL) {\n $.ajax({\n url: isCountdownTimerEnabledURL + '?pid=' + productID,\n method: 'GET',\n success: function (response) {\n $countdownTimer.html(response);\n if (response) {\n countdownHelper.init();\n }\n }\n });\n }\n}\n\n/**\n * Retrieves url to use when adding a product to the cart\n *\n * @return {string} - The provided URL to use when adding a product to the cart\n */\nfunction getAddToCartUrl() {\n return $('.add-to-cart-url').val();\n}\n\n/**\n * Parses the html for a modal window\n * @param {string} html - representing the body and footer of the modal window\n *\n * @return {Object} - Object with properties body and footer.\n */\nfunction parseHtml(html) {\n var $html = $('
      ').append($.parseHTML(html));\n\n var body = $html.find('.choice-of-bonus-product');\n var footer = $html.find('.modal-footer').children();\n\n return {\n body: body,\n footer: footer\n };\n}\n\n/**\n * Retrieves url to use when adding a product to the cart\n *\n * @param {Object} data - data object used to fill in dynamic portions of the html\n */\nfunction chooseBonusProducts(data) {\n $('.modal-body').spinner().start();\n\n if ($('#chooseBonusProductModal').length !== 0) {\n $('#chooseBonusProductModal').remove();\n }\n var bonusUrl;\n if (data.bonusChoiceRuleBased) {\n bonusUrl = data.showProductsUrlRuleBased;\n } else {\n bonusUrl = data.showProductsUrlListBased;\n }\n\n var htmlString = '' +\n '
      ' +\n '' +\n '
      ' +\n '' +\n '
      ' +\n '
      ' +\n '
      ' +\n ' ' + data.labels.selectprods + '' +\n '

      ' + data.labels.description + '

      ' +\n '
      ' +\n ' ' +\n '
      ' +\n '
      ' +\n '
      ' +\n '
      ' +\n '
      ' +\n '
      ';\n $('body').append(htmlString);\n $('.modal-body').spinner().start();\n\n $.ajax({\n url: bonusUrl,\n method: 'GET',\n dataType: 'json',\n success: function (response) {\n var parsedHtml = parseHtml(response.renderedTemplate);\n $('#chooseBonusProductModal .modal-body').empty();\n $('#chooseBonusProductModal .enter-message').text(response.enterDialogMessage);\n $('#chooseBonusProductModal .modal-header .close .sr-only').text(response.closeButtonText);\n $('#chooseBonusProductModal .modal-body').html(parsedHtml.body);\n $('#chooseBonusProductModal .modal-footer').html(parsedHtml.footer);\n $('#chooseBonusProductModal').modal('show');\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n}\n\n/**\n * Updates the Mini-Cart quantity value after the customer has pressed the \"Add to Cart\" button\n * @param {string} response - ajax response from clicking the add to cart button\n */\nfunction handlePostCartAdd(response) {\n $('.minicart').trigger('count:update', response);\n var messageType = response.error ? 'alert-danger' : 'alert-success';\n // show add to cart toast\n if (response.newBonusDiscountLineItem &&\n Object.keys(response.newBonusDiscountLineItem).length !== 0) {\n chooseBonusProducts(response.newBonusDiscountLineItem);\n } else {\n if ($('.add-to-cart-messages').length === 0) {\n $('body').append(\n '
      '\n );\n }\n\n $('.add-to-cart-messages').append(\n '
      ' +\n response.message +\n '
      '\n );\n\n setTimeout(function () {\n $('.add-to-basket-alert').remove();\n }, 5000);\n }\n}\n\n/**\n * Retrieves the bundle product item ID's for the Controller to replace bundle master product\n * items with their selected variants\n *\n * @return {string[]} - List of selected bundle product item ID's\n */\nfunction getChildProducts() {\n var childProducts = [];\n $('.bundle-item').each(function () {\n childProducts.push({\n pid: $(this).find('.product-id').text(),\n quantity: parseInt($(this).find('label.quantity').data('quantity'), 10)\n });\n });\n\n return childProducts.length ? JSON.stringify(childProducts) : [];\n}\n\n/**\n * Hides the finance calculator modal if the specified target element\n * is within the modal's DOM hierarchy.\n *\n * @param {HTMLElement} target - The DOM element to check against the finance calculator modal.\n */\nfunction hideModalIfInFinanceCalculator(target) {\n if (target && $(target).length && $(target).closest('#financeCalculatorModal').length) {\n $('#financeCalculatorModal').modal('hide');\n }\n}\n\n/**\n * Retrieve product options\n *\n * @param {jQuery} $productContainer - DOM element for current product\n * @return {string} - Product options and their selected values\n */\nfunction getOptions($productContainer) {\n var options = $productContainer\n .find('.product-option')\n .map(function () {\n var $elOption = $(this).find('.options-select');\n var urlValue = $elOption.val();\n var selectedValueId = $elOption.find('option[value=\"' + urlValue + '\"]')\n .data('value-id');\n return {\n optionId: $(this).data('option-id'),\n selectedValueId: selectedValueId\n };\n }).toArray();\n\n return JSON.stringify(options);\n}\n\n/**\n * Makes a call to the server to report the event of adding an item to the cart\n *\n * @param {string | boolean} url - a string representing the end point to hit so that the event can be recorded, or false\n */\nfunction miniCartReportingUrl(url) {\n if (url) {\n $.ajax({\n url: url,\n method: 'GET',\n success: function (response) {\n $('.minicart .klaviyo').html(response);\n },\n error: function () {\n // no reporting urls hit on the server\n }\n });\n }\n}\n\nmodule.exports = {\n attributeSelect: attributeSelect,\n methods: {\n editBonusProducts: function (data) {\n chooseBonusProducts(data);\n },\n miniCartReportingUrl: miniCartReportingUrl\n },\n\n focusChooseBonusProductModal: function () {\n $('body').on('shown.bs.modal', '#chooseBonusProductModal', function () {\n $('#chooseBonusProductModal').siblings().attr('aria-hidden', 'true');\n $('#chooseBonusProductModal .close').focus();\n });\n },\n\n onClosingChooseBonusProductModal: function () {\n $('body').on('hidden.bs.modal', '#chooseBonusProductModal', function () {\n $('#chooseBonusProductModal').siblings().attr('aria-hidden', 'false');\n });\n },\n\n trapChooseBonusProductModalFocus: function () {\n $('body').on('keydown', '#chooseBonusProductModal', function (e) {\n var focusParams = {\n event: e,\n containerSelector: '#chooseBonusProductModal',\n firstElementSelector: '.close',\n lastElementSelector: '.add-bonus-products'\n };\n focusHelper.setTabNextFocus(focusParams);\n });\n },\n\n colorAttribute: function () {\n $(document).on('click', '[data-attr=\"color\"] button', function (e) {\n e.preventDefault();\n\n if ($(this).attr('disabled')) {\n return;\n }\n var $productContainer = $(this).closest('.set-item');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.product-detail');\n }\n\n attributeSelect($(this).attr('data-url'), $productContainer);\n });\n },\n\n selectAttribute: function () {\n $(document).on('change', 'select[class*=\"select-\"], .options-select', function (e) {\n e.preventDefault();\n\n var $productContainer = $(this).closest('.set-item');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.product-detail');\n }\n attributeSelect(e.currentTarget.value, $productContainer);\n });\n },\n\n availability: function () {\n $(document).on('change', '.quantity-select', function (e) {\n e.preventDefault();\n\n var $productContainer = $(this).closest('.product-detail');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.modal-content').find('.product-quickview');\n }\n\n if ($('.bundle-items', $productContainer).length === 0) {\n attributeSelect($(e.currentTarget).find('option:selected').data('url'),\n $productContainer);\n }\n });\n },\n openBisnModal: function () {\n $(document).on('click', 'button.back-in-stock', function (e) {\n $('body').trigger('effect:Ripple', {\n button: $(this),\n event: e,\n afterAnimationFinish: function () {\n $('#bisnModal').modal('show');\n }\n });\n });\n },\n notifyBackInStock: function () {\n $('.js-back-in-stock-form').submit(function (e) {\n e.preventDefault();\n var productID = $('.product-detail.product-wrapper').attr('data-pid');\n $('.js-bis-product-id').val(productID);\n var form = $(this);\n var url = form.attr('action');\n form.spinner().start();\n fetch(url, {\n method: 'POST',\n body: form.serialize(),\n headers: {\n 'Content-type': 'application/x-www-form-urlencoded'\n }\n })\n .then(res => res.json())\n .then(data => {\n form.spinner().stop();\n if (data && data.success) {\n $('input[name$=dwfrm_backInStock_email]').val('');\n $('#bisnModal').modal('hide');\n $('#bisnModalSuccess').modal('show');\n } else {\n $('.js-back-in-stock-msg').text(data.msg).addClass('text-danger').removeClass('text-success');\n }\n })\n .catch(error => {\n $('.js-back-in-stock-msg').text(error).addClass('text-danger').removeClass('text-success');\n });\n\n return false;\n });\n },\n addToCart: function () {\n $(document).on('click', 'button.add-to-cart, button.add-to-cart-global', function (e) {\n var addToCart = $('.add-to-cart');\n var readyToOrder = addToCart.attr('data-readytoorder');\n var addToCartUrl;\n var pid;\n var pidsObj;\n var setPids;\n var v12productId = $('.v12-form').find('#productId') ? $('.v12-form').find('#productId').val() : null;\n var v12productGuid = $('.v12-form').find('#productGuid') ? $('.v12-form').find('#productGuid').val() : null;\n var v12productValue = $('.v12-form').find('#productValue') ? $('.v12-form').find('#productValue').val() : null;\n var v12depositPercentage = $('.v12-form').find('#depRange') ? $('.v12-form').find('#depRange').val() : null;\n var isSpecialOrder = $('#isSpecialOrder').val();\n var specialOrderInput = $('#special-order-text');\n var specialOrder = specialOrderInput && isSpecialOrder ? specialOrderInput.val() : null;\n var errorMessages = document.querySelectorAll('.error-msg');\n var hasError = false;\n errorMessages.forEach(errMsg => {\n errMsg.style.display = 'none';\n errMsg.classList.remove('target');\n\n // If the order is not ready to be placed we display an error\n if (readyToOrder !== 'true') {\n errMsg.style.display = 'inline';\n hasError = true;\n }\n if (isSpecialOrder === 'true') {\n if (!specialOrder) {\n errMsg.style.display = 'inline';\n hasError = true;\n } else if (specialOrder) {\n var pattern = /^[\\u0020-\\u007E]*$/;\n var hasRegExError = !specialOrder.match(pattern);\n if (hasRegExError) {\n specialOrderInput.addClass('is-invalid');\n hasError = true;\n } else {\n specialOrderInput.removeClass('is-invalid');\n }\n }\n }\n if (hasError) {\n errMsg.classList.add('target');\n }\n });\n\n $('body').trigger('effect:Ripple', {\n button: $(this),\n event: e\n });\n\n if (hasError) {\n document.querySelector('.target').scrollIntoView({\n behavior: 'smooth'\n });\n return;\n }\n\n $('body').trigger('product:beforeAddToCart', this);\n\n if ($('.set-items').length && $(this).hasClass('add-to-cart-global')) {\n setPids = [];\n\n $('.product-detail').each(function () {\n if (!$(this).hasClass('product-set-detail')) {\n setPids.push({\n pid: $(this).find('.product-id').text(),\n qty: $(this).find('.quantity-select').val(),\n options: getOptions($(this))\n });\n }\n });\n pidsObj = JSON.stringify(setPids);\n }\n\n pid = getPidValue($(this));\n\n var $productContainer = $(this).closest('.product-detail');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.quick-view-dialog').find('.product-detail');\n }\n\n addToCartUrl = getAddToCartUrl();\n\n var form = {\n pid: pid,\n pidsObj: pidsObj,\n childProducts: getChildProducts(),\n quantity: getQuantitySelected($(this))\n };\n\n if (specialOrder) {\n form.specialOrderMsg = specialOrder;\n }\n\n if (v12productId) {\n form.v12productId = v12productId;\n }\n\n if (v12productGuid) {\n form.v12productGuid = v12productGuid;\n }\n\n if (v12productValue) {\n form.v12productValue = v12productValue;\n }\n\n if (v12depositPercentage) {\n form.v12depositPercentage = v12depositPercentage;\n }\n\n if (!$('.bundle-item').length) {\n form.options = getOptions($productContainer);\n }\n\n $(this).trigger('updateAddToCartFormData', form);\n if (addToCartUrl) {\n $.ajax({\n url: addToCartUrl,\n method: 'POST',\n data: form,\n success: function (data) {\n handlePostCartAdd(data);\n $('body').trigger('product:afterAddToCart', data);\n $.spinner().stop();\n\n //if there are no bonus products, show minicart\n if (!data.newBonusDiscountLineItem.bonuspids) {\n var minicartTime = $('.minicart-total').attr('data-minicartshowtime');\n if (minicartTime) {\n $('.minicart').trigger('open');\n setTimeout(function () {\n $('.minicart .popover').removeClass('show');\n }, minicartTime);\n }\n }\n\n miniCartReportingUrl(data.reportingURL);\n hideModalIfInFinanceCalculator(e.currentTarget);\n },\n error: function () {\n $.spinner().stop();\n }\n });\n }\n });\n },\n selectBonusProduct: function () {\n $(document).on('click', '.select-bonus-product', function (e) {\n var $choiceOfBonusProduct = $(this).parents('.choice-of-bonus-product');\n var pid = $(this).data('pid');\n var maxPids = $('.choose-bonus-product-dialog').data('total-qty');\n // submittedQty is set to 1 as current implementation only allows 1 bonus product to be selected\n var submittedQty = 1;\n var totalQty = 0;\n $.each($('#chooseBonusProductModal .selected-bonus-products .selected-pid'), function () {\n totalQty += $(this).data('qty');\n });\n totalQty += submittedQty;\n var optionID = $choiceOfBonusProduct.find('.product-option').data('option-id');\n var valueId = $choiceOfBonusProduct.find('.options-select option:selected').data('valueId');\n if (totalQty <= maxPids) {\n var selectedBonusProductHtml = '' +\n '
      ' +\n '
      ' +\n $choiceOfBonusProduct.find('.product-name').html() +\n '
      ' +\n '
      ' +\n '
      ';\n $('#chooseBonusProductModal .selected-bonus-products').append(selectedBonusProductHtml);\n $('.pre-cart-products').html(totalQty);\n $('.selected-bonus-products .bonus-summary').removeClass('alert-danger');\n } else {\n $('.selected-bonus-products .bonus-summary').addClass('alert-danger');\n }\n $(e.currentTarget).find('input').prop('checked', true);\n $('.choice-of-bonus-product').removeClass('selected-item');\n $('input:checked').closest('.choice-of-bonus-product').addClass('selected-item');\n $('.modal-footer .error-msg').addClass('d-none');\n });\n },\n removeBonusProduct: function () {\n $(document).on('click', '.selected-pid', function () {\n $(this).remove();\n var $selected = $('#chooseBonusProductModal .selected-bonus-products .selected-pid');\n var count = 0;\n if ($selected.length) {\n $selected.each(function () {\n count += parseInt($(this).data('qty'), 10);\n });\n }\n\n $('.pre-cart-products').html(count);\n $('.selected-bonus-products .bonus-summary').removeClass('alert-danger');\n });\n },\n enableBonusProductSelection: function () {\n $('body').on('bonusproduct:updateSelectButton', function (e, response) {\n $('button.select-bonus-product', response.$productContainer).attr('disabled',\n (!response.product.readyToOrder || !response.product.available));\n var pid = response.product.id;\n $('button.select-bonus-product', response.$productContainer).data('pid', pid);\n });\n },\n showMoreBonusProducts: function () {\n $(document).on('click', '.show-more-bonus-products', function () {\n var url = $(this).data('url');\n $('.modal-content').spinner().start();\n $.ajax({\n url: url,\n method: 'GET',\n success: function (html) {\n var parsedHtml = parseHtml(html);\n $('.modal-body').append(parsedHtml.body);\n $('.show-more-bonus-products:first').remove();\n $('.modal-content').spinner().stop();\n },\n error: function () {\n $('.modal-content').spinner().stop();\n }\n });\n });\n },\n addBonusProductsToCart: function () {\n $(document).on('click', '.add-bonus-products', function () {\n var $readyToOrderBonusProducts = $('.choose-bonus-product-dialog .selected-pid');\n if (!$readyToOrderBonusProducts.length) {\n $('.modal-footer .modal-error-msg').removeClass('d-none');\n return;\n }\n var queryString = '?pids=';\n var url = $('.choose-bonus-product-dialog').data('addtocarturl');\n var pidsObject = {\n bonusProducts: []\n };\n\n $.each($readyToOrderBonusProducts, function () {\n var qtyOption =\n parseInt($(this)\n .data('qty'), 10);\n\n var option = null;\n if (qtyOption > 0) {\n if ($(this).data('optionid') && $(this).data('option-selected-value')) {\n option = {};\n option.optionId = $(this).data('optionid');\n option.productId = $(this).data('pid');\n option.selectedValueId = $(this).data('option-selected-value');\n }\n pidsObject.bonusProducts.push({\n pid: $(this).data('pid'),\n qty: qtyOption,\n options: [option]\n });\n pidsObject.totalQty = qtyOption;\n }\n });\n queryString += JSON.stringify(pidsObject);\n queryString = queryString + '&uuid=' + $('.choose-bonus-product-dialog').data('uuid');\n queryString = queryString + '&pliuuid=' + $('.choose-bonus-product-dialog').data('pliuuid');\n $.spinner().start();\n $.ajax({\n url: url + queryString,\n method: 'POST',\n success: function (data) {\n $.spinner().stop();\n if (data.error) {\n $('#chooseBonusProductModal').modal('hide');\n if ($('.add-to-cart-messages').length === 0) {\n $('body').append('
      ');\n }\n $('.add-to-cart-messages').append(\n '
      ' +\n data.errorMessage + '
      '\n );\n setTimeout(function () {\n $('.add-to-basket-alert').remove();\n }, 3000);\n } else {\n $('body').trigger('product:afterAddToCart');\n var minicartTime = $('.minicart-total').attr('data-minicartshowtime');\n if (minicartTime) {\n $('.minicart').trigger('open');\n setTimeout(function () {\n $('.minicart .popover').removeClass('show');\n }, minicartTime);\n }\n $('.configure-bonus-product-attributes').html(data);\n $('.bonus-products-step2').removeClass('hidden-xl-down');\n $('#chooseBonusProductModal').data('withGift', 'true');\n $('#chooseBonusProductModal').modal('hide');\n\n if ($('.add-to-cart-messages').length === 0) {\n $('body').append('
      ');\n }\n $('.minicart-quantity').html(data.totalQty);\n $('.minicart-link').attr({\n 'aria-label': data.minicartCountOfItems,\n title: data.minicartCountOfItems\n });\n $('.add-to-cart-messages').append(\n '
      ' +\n data.msgSuccess + '
      '\n );\n setTimeout(function () {\n $('.add-to-basket-alert').remove();\n if ($('.cart-page').length) {\n location.reload();\n }\n }, 1500);\n }\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n },\n\n proceedWithoutGift: function () {\n $(document).on('click', '.proceed-without-gift button', function () {\n $('#chooseBonusProductModal').data('withGift', 'false');\n $('#chooseBonusProductModal').modal('hide');\n var minicartTime = $('.minicart-total').attr('data-minicartshowtime');\n if (minicartTime) {\n $('.minicart').trigger('open');\n setTimeout(function () {\n $('.minicart .popover').removeClass('show');\n }, minicartTime);\n }\n });\n },\n\n getPidValue: getPidValue,\n getQuantitySelected: getQuantitySelected,\n updateProductStockAvailability: updateProductStockAvailability,\n removeMainProductBonusProductModal: removeMainProductBonusProductModal,\n chooseBonusProducts: chooseBonusProducts\n};\n","'use strict';\n\nmodule.exports = {\n init: function () {\n // Enter the times for the timed banner to start and end below\n var cContainer = $('.countdown');\n \n var cStartTime = cContainer.attr(\"data-start-time\"),\n cEndTime = cContainer.attr(\"data-end-time\");\n \n if ($('.countdownTimer').length) {\n var pad = function(n, len) { // leading 0's\n var s = n.toString();\n return (new Array((len - s.length + 1)).join('0')) + s;\n };\n \n if (cEndTime < 0 || cEndTime > 23 || cStartTime < 0 || cStartTime >= 23) {\n console.warn('Time for countdown timer should be set between 0 and 23');\n }\n \n var timeNow = new Date();\n var nextDay = new Date(timeNow);\n nextDay.setDate(nextDay.getDate() + 1);\n nextDay = nextDay.toDateString().split(' ');\n nextDay = nextDay[1] + ' ' + nextDay[2];\n \n if ((timeNow.getHours() < cEndTime) && (timeNow.getHours() >= cStartTime)) {\n changeToTimer();\n }\n \n if (cEndTime > cStartTime && cEndTime <= 23 && cStartTime >= 0) {\n window.setInterval(\n function countDown() {\n var now = new Date(),\n hrs,\n mins,\n str,\n target;\n \n if (now.getDay() >= 0) {\n target = cEndTime; // 12:00 hrs is default cut-off point\n \n if (now.getHours() == cStartTime) {\n changeToTimer();\n }\n \n if ((now.getHours() < target) && (now.getHours() >= cStartTime)) { // don't do anything if we're past the cut-off point\n hrs = (target - 1) - now.getHours();\n if (hrs < 0) hrs = 0;\n mins = 59 - now.getMinutes();\n if (mins === 0 || mins < 0) {\n cContainer.hide();\n }\n str = pad(hrs, 1) + ' hrs ' + pad(mins, 1) + ' mins ';\n $('.countdownTimer').html(str);\n $('.nextDay').html(nextDay);\n } \n } else {\n cContainer.hide();\n }\n }, 1000\n );\n }\n }\n /**\n * Show timer\n */\n function changeToTimer() {\n cContainer.fadeIn('slow');\n }\n }\n};","'use strict';\nvar base = require('./base');\nvar focusHelper = require('../components/focus');\n\n/**\n * Generates the modal window on the first call.\n *\n */\nfunction getModalHtmlElement() {\n if ($('#quickViewModal').length !== 0) {\n $('#quickViewModal').remove();\n }\n var htmlString = ''\n + '
      '\n + ''\n + '
      '\n + ''\n + '
      '\n + '
      '\n + ' '\n + ' '\n + '
      '\n + '
      '\n + '
      '\n + '
      '\n + '
      '\n + '
      ';\n $('body').append(htmlString);\n}\n\n/**\n * @typedef {Object} QuickViewHtml\n * @property {string} body - Main Quick View body\n * @property {string} footer - Quick View footer content\n */\n\n/**\n * Parse HTML code in Ajax response\n *\n * @param {string} html - Rendered HTML from quickview template\n * @return {QuickViewHtml} - QuickView content components\n */\nfunction parseHtml(html) {\n var $html = $('
      ').append($.parseHTML(html));\n\n var body = $html.find('.product-quickview');\n var footer = $html.find('.modal-footer').children();\n\n return { body: body, footer: footer };\n}\n\n/**\n * replaces the content in the modal window on for the selected product variation.\n * @param {string} selectedValueUrl - url to be used to retrieve a new product model\n */\nfunction fillModalElement(selectedValueUrl) {\n $('.modal-body').spinner().start();\n $.ajax({\n url: selectedValueUrl,\n method: 'GET',\n dataType: 'json',\n success: function (data) {\n var parsedHtml = parseHtml(data.renderedTemplate);\n\n $('.modal-body').empty();\n $('.modal-body').html(parsedHtml.body);\n $('.modal-footer').html(parsedHtml.footer);\n $('.full-pdp-link').text(data.quickViewFullDetailMsg);\n $('#quickViewModal .full-pdp-link').attr('href', data.productUrl);\n $('#quickViewModal .size-chart').attr('href', data.productUrl);\n $('#quickViewModal .modal-header .close .sr-only').text(data.closeButtonText);\n $('#quickViewModal .enter-message').text(data.enterDialogMessage);\n $('#quickViewModal').modal('show');\n $('body').trigger('quickview:ready');\n\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n}\n\nmodule.exports = {\n showQuickview: function () {\n $('body').on('click', '.quickview', function (e) {\n e.preventDefault();\n var selectedValueUrl = $(this).closest('a.quickview').attr('href');\n $(e.target).trigger('quickview:show');\n getModalHtmlElement();\n fillModalElement(selectedValueUrl);\n });\n },\n focusQuickview: function () {\n $('body').on('shown.bs.modal', '#quickViewModal', function () {\n $('#quickViewModal .close').focus();\n });\n },\n trapQuickviewFocus: function () {\n $('body').on('keydown', '#quickViewModal', function (e) {\n var focusParams = {\n event: e,\n containerSelector: '#quickViewModal',\n firstElementSelector: '.full-pdp-link',\n lastElementSelector: '.add-to-cart-global',\n nextToLastElementSelector: '.modal-footer .quantity-select'\n };\n focusHelper.setTabNextFocus(focusParams);\n });\n },\n availability: base.availability,\n addToCart: base.addToCart,\n showSpinner: function () {\n $('body').on('product:beforeAddToCart', function (e, data) {\n $(data).closest('.modal-content').spinner().start();\n });\n },\n hideDialog: function () {\n $('body').on('product:afterAddToCart', function () {\n $('#quickViewModal').modal('hide');\n });\n },\n beforeUpdateAttribute: function () {\n $('body').on('product:beforeAttributeSelect', function () {\n $('.modal.show .modal-content').spinner().start();\n });\n },\n updateAttribute: function () {\n $('body').on('product:afterAttributeSelect', function (e, response) {\n if ($('.modal.show .product-quickview>.bundle-items').length) {\n $('.modal.show').find(response.container).data('pid', response.data.product.id);\n $('.modal.show').find(response.container)\n .find('.product-id').text(response.data.product.id);\n } else if ($('.set-items').length) {\n response.container.find('.product-id').text(response.data.product.id);\n } else {\n $('.modal.show .product-quickview').data('pid', response.data.product.id);\n $('.modal.show .full-pdp-link')\n .attr('href', response.data.product.selectedProductUrl);\n }\n });\n },\n updateAddToCart: function () {\n $('body').on('product:updateAddToCart', function (e, response) {\n // update local add to cart (for sets)\n $('button.add-to-cart', response.$productContainer).attr('disabled',\n (!response.product.readyToOrder || !response.product.available));\n\n // update global add to cart (single products, bundles)\n var dialog = $(response.$productContainer)\n .closest('.quick-view-dialog');\n\n $('.add-to-cart-global', dialog).attr('disabled',\n !$('.global-availability', dialog).data('ready-to-order')\n || !$('.global-availability', dialog).data('available')\n );\n });\n },\n updateAvailability: function () {\n $('body').on('product:updateAvailability', function (e, response) {\n // bundle individual products\n $('.product-availability', response.$productContainer)\n .data('ready-to-order', response.product.readyToOrder)\n .data('available', response.product.available)\n .find('.availability-msg')\n .empty()\n .html(response.message);\n\n\n var dialog = $(response.$productContainer)\n .closest('.quick-view-dialog');\n\n if ($('.product-availability', dialog).length) {\n // bundle all products\n var allAvailable = $('.product-availability', dialog).toArray()\n .every(function (item) { return $(item).data('available'); });\n\n var allReady = $('.product-availability', dialog).toArray()\n .every(function (item) { return $(item).data('ready-to-order'); });\n\n $('.global-availability', dialog)\n .data('ready-to-order', allReady)\n .data('available', allAvailable);\n\n $('.global-availability .availability-msg', dialog).empty()\n .html(allReady ? response.message : response.resources.info_selectforstock);\n } else {\n // single product\n $('.global-availability', dialog)\n .data('ready-to-order', response.product.readyToOrder)\n .data('available', response.product.available)\n .find('.availability-msg')\n .empty()\n .html(response.message);\n }\n });\n }\n};\n","'use strict';\nvar pageHelpers = require('../helpers/pageHelpers');\nvar v12Tile = require('../components/v12Tile');\nvar debounce = require('lodash/debounce');\nvar utils = require('../utils/utils');\n\n/**\n * Update DOM elements with Ajax results\n *\n * @param {Object} $results - jQuery DOM element\n * @param {string} selector - DOM element to look up in the $results\n * @return {undefined}\n */\nfunction updateDom($results, selector) {\n var $updates = $results.find(selector);\n\n $(selector).each(function () {\n var $this = $(this);\n\n // if not in a slot recommender\n if (!$this.parents('[id*=cq_recomm_slot]').length) {\n $this.empty().html($updates.html());\n }\n });\n\n v12Tile.updateTileV12();\n}\n\n/**\n * Keep refinement panes expanded/collapsed after Ajax refresh\n *\n * @param {Object} $results - jQuery DOM element\n * @return {undefined}\n */\nfunction handleRefinements($results) {\n $('.refinement.active').each(function () {\n $(this).removeClass('active');\n var activeDiv = $results.find('.' + $(this)[0].className.replace(/ /g, '.'));\n activeDiv.addClass('active');\n activeDiv.find('button.title').attr('aria-expanded', 'true');\n });\n\n updateDom($results, '.refinements');\n}\n\n/**\n * Parse Ajax results and updated select DOM elements\n *\n * @param {string} response - Ajax response HTML code\n * @return {undefined}\n */\nfunction parseResults(response) {\n var $results = $(response);\n var specialHandlers = {\n '.refinements': handleRefinements\n };\n\n // Update DOM elements that do not require special handling\n [\n '.grid-header',\n '.header-bar',\n '.header.page-title',\n '.product-grid',\n '.show-more',\n '.filter-bar'\n ].forEach(function (selector) {\n updateDom($results, selector);\n });\n\n Object.keys(specialHandlers).forEach(function (selector) {\n specialHandlers[selector]($results);\n });\n}\n\n/**\n * This function retrieves another page of content to display in the content search grid\n * @param {JQuery} $element - the jquery element that has the click event attached\n * @param {JQuery} $target - the jquery element that will receive the response\n * @return {undefined}\n */\nfunction getContent($element, $target) {\n var showMoreUrl = $element.data('url');\n $.spinner().start();\n $.ajax({\n url: showMoreUrl,\n method: 'GET',\n success: function (response) {\n $target.append(response);\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n}\n\n/**\n * Update sort option URLs from Ajax response\n *\n * @param {string} response - Ajax response HTML code\n * @return {undefined}\n */\nfunction updateSortOptions(response) {\n var $tempDom = $('
      ').append($(response));\n var sortOptions = $tempDom.find('.grid-footer').data('sort-options').options;\n sortOptions.forEach(function (option) {\n $('option.' + option.id).val(option.url);\n });\n\n v12Tile.updateTileV12();\n}\n\n/**\n * Checks if the element is in the visible part of the page/ visible in the view port\n * @param {*} elem element\n * @returns boolean\n */\nfunction triggerLazyLoading(elem) {\n // Getting innerHeight as for PD page $(window).height returns document height\n if (elem.length) {\n var windowInnerHeight = window.innerHeight;\n var headerHeight = $('.js-sort-panel').height();\n var docViewTop = $(window).scrollTop();\n var docViewBottom = docViewTop + windowInnerHeight;\n\n var elemTop = elem.first().offset().top - headerHeight - 200;\n var elemBottom = elemTop + elem.first().height();\n\n return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop));\n }\n}\n\n/**\n * Generates refinement url based on selected filters.\n * @param {Array} selectedFilters - selected filters\n * @returns {string} - final url.\n */\nfunction generateRefineUrl(selectedFilters) {\n var baseUrl = $('.refinement-bar').attr('data-baseurl') + '?';\n var filterAttributes = {};\n var refinementId = '';\n var previousRefinementId = '';\n var refinementValue = '';\n var finalUrl = '';\n var categoryRefinement, priceRefinement;\n\n // First check if we're making a search or just navigating through site\n var queryString = window.location.search;\n var urlParams = new URLSearchParams(queryString);\n var searchQuery = urlParams.get('q') ? 'q=' + urlParams.get('q') + '&' : '';\n\n $.each(selectedFilters, function (index) {\n refinementId = selectedFilters[index].attributes.name.value;\n if (index > 0) {\n previousRefinementId = selectedFilters[index-1].attributes.name.value;\n // If previous refinement equals to current, group values\n if (refinementId === previousRefinementId) {\n refinementValue = selectedFilters[index].attributes.value.value;\n filterAttributes[refinementId] += '|'+refinementValue;\n }\n // If not, create a new key - value\n else {\n refinementValue = selectedFilters[index].attributes.value.value;\n filterAttributes[refinementId] = refinementValue;\n }\n } else {\n refinementValue = selectedFilters[index].attributes.value.value;\n filterAttributes[refinementId] = refinementValue;\n }\n });\n\n // Generate URL\n var count = 0;\n Object.entries(filterAttributes).forEach(([key, value]) => {\n if (key === 'price') {\n priceRefinement = 'pRef=' + encodeURIComponent(value) + '&';\n } else {\n count++;\n finalUrl += 'prefn' + (count) + '=' + encodeURIComponent(key) + '&prefv' + (count) + '=' + encodeURIComponent(value) + '&';\n }\n });\n\n var categoryId = $('input.category-id').val();\n categoryRefinement = categoryId ? 'cgid=' + categoryId + '&' : '';\n priceRefinement= priceRefinement ? priceRefinement : '';\n finalUrl = baseUrl + searchQuery + categoryRefinement + priceRefinement + finalUrl;\n\n return finalUrl.endsWith('&') ? finalUrl.substring(0, finalUrl.length - 1) : finalUrl;\n}\n\n/**\n * Appends the selected sorting option to a given URL\n * @param {string} url - the URL to append the sorting option to\n * @returns {string} - the modified URL with the sorting option appended\n */\nfunction appendSortingOptionToUrl(url) {\n if (url.includes('srule')) {\n return url;\n }\n\n var $selectedSortingOption = $('#sortBy option:selected');\n\n if ($selectedSortingOption.length > 0) {\n var sortingOption = $selectedSortingOption.data('id');\n\n if (sortingOption) {\n return utils.appendParamToURL(url, 'srule', sortingOption);\n }\n }\n\n return url;\n}\n\nfunction generateDisplayUrl(finalUrl) {\n var displayUrl = '';\n\n if (finalUrl.includes('cgid=')) {\n displayUrl = '?cgid=' + finalUrl.split('cgid=')[1];\n } else if (finalUrl.includes('?q=')) {\n displayUrl = '?q=' + finalUrl.split('?q=')[1];\n }\n\n return displayUrl;\n}\n\n/**\n * Insert slots content to Product Grid\n */\nfunction insertContentTiles() {\n var contentSlot1 = $('.js-plp-content-slot-1');\n var contentSlot2 = $('.js-plp-content-slot-2');\n if (contentSlot1.length === 0 && contentSlot2.length === 0) return;\n\n var slotToPos6 = contentSlot1.detach();\n var slotToPos11 = contentSlot2.detach();\n if (contentSlot1.length > 0) {\n $('.product-grid>.tile-container:eq(4)').after(slotToPos6);\n }\n if (contentSlot2.length > 0) {\n $('.product-grid>.tile-container:eq(9)').after(slotToPos11);\n }\n}\n\nfunction updateVimeoScale() {\n var $vimeoScale = $('.js-crop-full-width, .js-crop-full-height');\n $vimeoScale.each(function (index) {\n var containerWidth,\n containerHeight,\n newVimeoWidth,\n newVimeoHeight,\n vimeoWidth,\n vimeoHeight;\n\n var vimeoItem = $vimeoScale[index];\n if ($(vimeoItem).hasClass('js-crop-full-height') && $(vimeoItem).closest('.content__container')) {\n // Content Tile (PLP)\n containerHeight = $(vimeoItem).closest('.tile-container').height();\n containerWidth = $(vimeoItem).closest('.tile-container').width();\n\n vimeoHeight = $(vimeoItem).find('iframe').attr('height');\n vimeoWidth = $(vimeoItem).find('iframe').attr('width');\n newVimeoWidth = (containerHeight * vimeoWidth) / vimeoHeight;\n newVimeoHeight = containerHeight;\n\n $(vimeoItem).find('iframe').css('left', '-' + ((newVimeoWidth - containerWidth) / 2) + 'px');\n\n $(vimeoItem).css('width', containerWidth);\n $(vimeoItem).css('height', containerHeight);\n $(vimeoItem).find('iframe').css('width', newVimeoWidth);\n $(vimeoItem).find('iframe').css('height', newVimeoHeight);\n }\n });\n}\n\n/**\n * Resets the category read more toggle\n */\nfunction resetCategoryReadMore() {\n var $jsCollapsedTextToggler = $('.js-collapsed-text-toggler');\n $jsCollapsedTextToggler.hide().text($jsCollapsedTextToggler.data('readmore'));\n $('.category-banner__content').removeClass('show-read-more');\n $('.category-banner__description').addClass('collapsed-text').removeAttr('style');\n}\n\n/**\n * Initializes the category read more functionality\n * @param {Object} $catDescription - jQuery object of the category description\n */\nfunction initCategoryReadMore($catDescription) {\n var collapsedElement = $catDescription[0];\n\n if (collapsedElement.offsetHeight < collapsedElement.scrollHeight || collapsedElement.offsetWidth < collapsedElement.scrollWidth) {\n // show read more button and change collaped h2 elements styling\n $('.category-banner__content').addClass('show-read-more');\n $('.category-banner__description').css('max-height', collapsedElement.scrollHeight);\n $('.js-collapsed-text-toggler').show();\n\n $(document).off('click', '.js-collapsed-text-toggler').on('click', '.js-collapsed-text-toggler', function () {\n var $this = $(this);\n\n if ($catDescription.hasClass('collapsed-text')) {\n $catDescription.removeClass('collapsed-text');\n $this.text($this.data('readless'));\n } else {\n $catDescription.addClass('collapsed-text');\n $this.text($this.data('readmore'));\n }\n });\n }\n}\n\n/**\n * Truncates the category description and adds a read more link\n * @param {boolean} isWindowResize - whether the window has been resized\n */\nfunction truncateCategoryDescription(isWindowResize) {\n var $catDescription = $('.category-banner__description');\n\n if ($catDescription.length) {\n resetCategoryReadMore();\n\n if (isWindowResize) {\n // we need to wait the amount of time it takes for the CSS Transition to finish\n setTimeout(function () {\n initCategoryReadMore($catDescription);\n }, 1000);\n } else {\n initCategoryReadMore($catDescription);\n }\n }\n}\n\n/**\n * Updates the clear button on mobile view\n * @param {jQuery} $btnElClear - the clear button element\n * @param {number} refCount - the refinement count\n */\nfunction updateClearBtnMobile($btnElClear, refCount) {\n $btnElClear = $btnElClear || $('.js-reset-filters-mobile');\n\n // Get refinement count from desktop\n if (refCount === undefined) {\n var $refCountEl = $('.js-reset-filters');\n\n if ($refCountEl.length > 0) {\n var refCountArr = $refCountEl.html().match(/\\((\\d+)\\)/);\n refCount = refCountArr && refCountArr.length > 1 ? parseInt(refCountArr[1], 10) : undefined;\n } else {\n // if filter element is not present, there is no filter applied to search results\n refCount = 0;\n }\n }\n\n if ($btnElClear && refCount !== undefined) {\n var btnOldTextClear = $btnElClear.html();\n var btnNewTextClear = btnOldTextClear.replace(/\\d+/g, refCount);\n $btnElClear.html(btnNewTextClear);\n $btnElClear.attr('data-ref-count', refCount);\n }\n}\n\n/**\n * Updates the apply button on mobile view\n * @param {jQuery} $btnElApply - the apply button element (optional)\n */\nfunction updateApplyBtnMobile($btnElApply) {\n $btnElApply = $btnElApply || $('.js-apply-filters-mobile');\n\n if ($btnElApply.length > 0) {\n var $btnElClear = $('.js-reset-filters-mobile');\n\n // If there is no filter applied, show the total products\n if ($btnElClear && $btnElClear.length > 0 && $btnElClear.attr('data-ref-count') === '0') {\n $btnElApply.html($btnElApply.attr('data-message'));\n return;\n }\n\n var $itemsCount = $('.items-count');\n var itemsCountArr = $itemsCount && $itemsCount.length > 0 ? $itemsCount.html().match(/(\\d+)/) : null;\n var itemsCount = itemsCountArr && itemsCountArr.length > 0 ? itemsCountArr[1] : null;\n\n // If the items count is greater than 999, add a comma to the number\n if (itemsCount && !itemsCount.includes(',') && itemsCount.length > 3) {\n itemsCount = itemsCount.replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\n }\n\n if (itemsCount) {\n var btnOldTextApply = $btnElApply.html();\n // Replace the number in the view button text with the items count\n var btnNewTextApply = btnOldTextApply.replace(/(\\d{1,3}(?:,\\d{3})*)/, itemsCount);\n $btnElApply.html(btnNewTextApply);\n $btnElApply.attr('data-message', btnNewTextApply);\n }\n }\n}\n\nvar initialScreenWidth = $(window).width();\n\n/**\n * Gets the initial screen width\n * @returns {number} initialScreenWidth - the initial screen width\n */\nfunction getInitialScreenWidth() {\n return initialScreenWidth;\n}\n\n/**\n * Sets the initial screen width\n * @param {number} newScreenWidth - the new screen width\n */\nfunction setInitialScreenWidth(newScreenWidth) {\n initialScreenWidth = newScreenWidth;\n}\n\nmodule.exports = {\n lazyLoading: function () {\n $(document).ready(function () {\n var showMoreBtn = $('.js-show-more-btn[data-url]');\n var trigerLazy = triggerLazyLoading(showMoreBtn);\n if (showMoreBtn.length != 0 && trigerLazy) {\n showMoreBtn.first().trigger('click');\n }\n });\n\n $(window).on('scroll', debounce(function () {\n var showMoreBtn = $('.js-show-more-btn[data-url]');\n var lazyLoadAvailable = $('input[name$=lazyLoadAvailable]').val();\n\n var trigerLazy = triggerLazyLoading(showMoreBtn);\n\n if (showMoreBtn.length != 0 && trigerLazy && lazyLoadAvailable == 'true') {\n // Run it once only\n $('input[name$=lazyLoadAvailable]').val('false');\n showMoreBtn.first().trigger('click');\n }\n }, 200));\n },\n\n filter: function () {\n // Display refinements bar when Menu icon clicked\n $('.container').on('click', 'button.filter-results', function () {\n $('.refinement-bar, .modal-background').show();\n $('.refinement-bar').siblings().attr('aria-hidden', true);\n $('.refinement-bar').closest('.row').siblings().attr('aria-hidden', true);\n $('.refinement-bar').closest('.tab-pane.active').siblings().attr('aria-hidden', true);\n $('.refinement-bar').closest('.container.search-results').siblings().attr('aria-hidden', true);\n $('.refinement-bar .close').focus();\n });\n },\n\n closeRefinements: function () {\n // Refinements close button\n $('.container').on('click', '.refinement-bar button.close, .modal-background', function () {\n $('.refinement-bar, .modal-background').hide();\n $('.refinement-bar').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.row').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.tab-pane.active').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.container.search-results').siblings().attr('aria-hidden', false);\n $('.btn.filter-results').focus();\n });\n },\n\n sort: function () {\n // Handle sort order menu selection\n $('.container').on('change', '[name=sort-order]', function (e) {\n e.preventDefault();\n\n var $label = $(this).siblings('.sort-label');\n var text = $(this).find('option:selected').text();\n var $tempSelect = $('