1"use strict";(self["FC.EcomwebpackJsonp"]=self["FC.EcomwebpackJsonp"]||[]).push([[617],{37634:(e,t,r)=>{var n=r(31542);t.createRoot=n.createRoot,t.hydrateRoot=n.hydrateRoot},2190:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var n=r(27378),a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},a.apply(this,arguments)},c=function(e,t,r,n){return new(r||(r=Promise))((function(a,c){function o(e){try{l(n.next(e))}catch(e){c(e)}}function u(e){try{l(n.throw(e))}catch(e){c(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,u)}l((n=n.apply(e,t||[])).next())}))},o=function(e,t){var r,n,a,c,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return c={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function u(c){return function(u){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==c[0]&&2!==c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}
1if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}},u=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,c=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=c.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=c.return)&&r.call(c)}finally{if(a)throw a.error}}return o};const l=function(e){var t=e.initialPanelTag,r=void 0===t?"newest":t,l=(0,n.useRef)(r),i=(0,n.useRef)(1),s=u((0,n.useState)(!1),2),f=s[0],d=s[1],p=(0,n.useRef)(null),v=(0,n.useRef)(null),h=(0,n.useRef)(null),y=u((0,n.useState)(0),2),w=y[0],m=y[1],g=u((0,n.useState)(""),2),b=g[0],S=g[1],E=u((0,n.useState)([]),2),_=E[0],k=E[1],R=u((0,n.useState)(!1),2),T=R[0],x=R[1];(0,n.useEffect)((function(){var e;p.current=document.querySelector("#reviews-sort-order-select"),v.current=document.querySelectorAll(".load-more__link"),h.current=document.querySelector(".product-reviews__pagination"),(null===(e=h.current)||void 0===e?void 0:e.dataset)&&(m(parseInt(h.current.dataset.totalItems||"0")),S(h.current.dataset.loadMore||"")),p.current&&k(Array.from(p.current.options).map((function(e){return{panelTag:e.value,content:""}}))),d(!0)}),[]);var q=function(e,t){return c(void 0,void 0,void 0,(function(){var r,n,a;return o(this,(function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),r=function(e){return"".concat(e).concat(e.includes("?")?"&":"?","ajax_context=").concat(window.location.pathname)}("/_review/gettab/".concat(e,"/").concat(t)),[4,fetch(r)];case 1:if(!(n=c.sent()).ok)throw new Error("Network response was not ok");return[4,n.text()];case 2:return[2,c.sent().replace(/<ul[^>]*>/,"").replace(/<\/ul>/,"")];case 3:return a=c.sent(),console.error("Error fetching reviews:",a),[2,""];case 4:return[2]}}
1))}))},L=function(e,t){return c(void 0,void 0,void 0,(function(){var r,n,c;return o(this,(function(o){switch(o.label){case 0:return[4,q(e,t)];case 1:return(r=o.sent())?(n=document.createRange().createContextualFragment(r),c=n.querySelectorAll(".product-review-item").length,i.current=t,function(e){if(h.current&&b){var t=b.replace("{0}",e.toString()).replace("{1}",w.toString());h.current.innerHTML=t,h.current.dataset.currentItems=e.toString()}}(c),v.current&&v.current.forEach((function(e){e.hidden=c>=w})),k((function(t){return t.map((function(t){return t.panelTag===e?a(a({},t),{content:r}):t}))})),[2]):[2]}}))}))},A=function(e){L(e,1),l.current=e,document.querySelectorAll(".product-reviews__panel").forEach((function(e){e.classList.remove("product-reviews__panel--visible")}));var t=document.querySelector('.product-reviews__panel[data-panel-tag="'.concat(e,'"]'));t&&t.classList.add("product-reviews__panel--visible")},j=function(e){L(l.current,1);var t=e.target.value;l.current=t,A(t)};return(0,n.useEffect)((function(){if(f&&_.length)return A(_[0].panelTag),_.slice(1).forEach((function(e){L(e.panelTag,1)})),p.current&&p.current.addEventListener("change",j),v.current&&v.current.forEach((function(e){e.addEventListener("click",(function(e){var t,r;e.preventDefault(),t=l.current,r=i.current+1,c(void 0,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:x(!0),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,L(t,r)];case 2:return n.sent(),[3,5];case 3:return e=n.sent(),console.error("Error loading more reviews:",e),[3,5];case 4:return x(!1),[7];case 5:return[2]}}
1))}))}))})),function(){p.current&&p.current.removeEventListener("change",j)}}),[f]),n.createElement(n.Fragment,null,_.map((function(e){return n.createElement("ul",{key:e.panelTag,className:"product-reviews__panel ".concat(e.panelTag," ").concat(e.panelTag===l.current?"product-reviews__panel--visible":""),"data-panel-tag":e.panelTag,dangerouslySetInnerHTML:{__html:e.content}})})),T&&n.createElement("div",{className:"ajax-loader"}))}},57791:(e,t,r)=>{r.r(t);var n=r(27378),a=r(37634),c=r(2190);document.querySelectorAll('[data-module="ProductReviewSection"]').forEach((function(e){a.createRoot(e).render(n.createElement(c.default,null))}))}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.