1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1402],{41402:(e,t,n)=>{n.d(t,{$W:()=>U,Yx:()=>J,oO:()=>P});var l=n(85714),r=n(39324),i=n.n(r),o=n(26701);n(42498);var a=n(28487),s=n.n(a);n(33280);var c=n(28388);n(59303);var u=n(87486),d=n(62671),f=n(70438),g=n(48848),p=n(19334);let{publicRuntimeConfig:{DATA_URL:h}}=i()();async function v(e){let t=["country-code=US","currency=USD","count=1","refine=cgid=".concat(encodeURIComponent(e)),"refine_1=".concat(encodeURIComponent("c_displayOn=standard_usd")),"refine_2=".concat(encodeURIComponent("c_allowedCountries=ALL|US")),"expand=variations"];try{var n,r,i;let o=await (0,l.A)("/browse/product_search?".concat(t.join("&")))||{},a=null===(n=o.hits)||void 0===n?void 0:n[0],s=function(e){let{defaultColorCode:t,displayLaydownImages:n,masterProductId:l}=e.c_customData.hitProductProperties,{hasOnfig:r}=e.c_customData.aggregatedDetails.colors.find(e=>e.colorCode===t)||{};return"https://www.jcrew.com/s7-img-facade/".concat(l,"_").concat(t).concat(!n&&r?"_m":"")}(a),c=(null===(i=o.refinements)||void 0===i?void 0:null===(r=i.find(e=>"cgid"===e.attribute_id))||void 0===r?void 0:r.values)||[],u=function e(t,n){for(let l=0;l<t.length;l++)if(t[l].value===n)return t[l];else if(t[l].hasOwnProperty("values")){let r=e(t[l].values,n);if(r)return r}return null}(c,e)||{};return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=e.value||"",l=e.label||"",r=n.replace(/\|/g,"/"),i=n.split("|")[0],o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})},a={boys:"Boys'",girls:"Girls'",womens:"Women's",women:"Women's ",mens:"Men's",men:"Men's ",home:"Home"},s="Shop ".concat("sale"===i?"".concat(o(a[l.toLowerCase()]||"")," Sale"):"".concat(a[i]||i," ").concat(o(l)));return{id:n,urlTargetBlank:!1,url:"/plp/".concat(r),alt:s,gender:a[i],category:o(l),image:{xl:t,sm:t}}}(u,s)}catch(t){return s().info("fetchCategoryProduct",{message:"Cannot fetch product for ".concat(e),err:t}),{}}}let m=async()=>{try{let e=(0,p.lE)(g.A.FORMATTED_CATEGORY_RECS_DATA);if(e)return e;let t=w();if(!t||t.length<6)return y(t,6);let n=t.slice(0,6),l=await b(n);if(!(l=null==l?void 0:l.filter(e=>e.id&&e.image))||l.length<6)return y(null==l?void 0:l.map(e=>e.id),6);return C(l),{iterables:l}}catch(e){return s().info("updateCategoryRecs",{message:"Cannot update category recs",err:e}),{iterables:[]}}},w=()=>{let e=(0,c.getItemLocalStorage)({key:g.A.CATEGORY_VISITS_DATA})||[];return f.sbv(e.map(e=>{var t;return null==e?void 0:null===(t=e.category)||void 0===t?void 0:t.replace(/\//g,"|")}).filter(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",[t="",n=""]=e.split("|")||[];return t.length>=4&&n&&!/\d/.test(t)}))},y=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,{categories:n=[]}=await (0,l.A)("".concat(h,"/browse/categories/womens|categories|clothing"))||{},r=f.sbv([...e,...n.map(e=>e.id)]),i=r.slice(0,t),o=await b(i),a=t-(o=o.filter(e=>e.id&&e.image)).length;if(a>0){let e=r.slice(t,t+a),n=await b(e);o.push(...n)}return C(o),{iterables:o}},b=async e=>Promise.all(e.map(v)),C=e=>{(0,p.jx)(g.A.FORMATTED_CATEGORY_RECS_DATA,{iterables:e})},D=(e,t,n)=>{let[l,r,i,o]=["womens","mens","crewCuts","default"];if(!t)return[o,o];let a=Object.entries(e).sort((e,t)=>t[1]-e[1]||Number(t[0]===l)||-Number(e[0]===l)||Number(t[0]===r)||-1),s=a[0][0],c=a[1][0];return n?[s,s]:(a[0][1]>70&&(c=s),s===i&&([s,c]=[c,s],s===i&&(s=l)),[s,c])},A=e=>{if(e)return[];let t=window.localStorage.getItem("category-visits")||'{ "data": "[]" }';return JSON.parse(decodeURIComponent(JSON.parse(t).data))},_=e=>{let{size:t}=e;return 6-t},O=e=>{let t=e.slice(),n=new Set;for(;_(n)&&t.length;){let{category:e}=t.pop();n.add(e)}return n},S=e=>{let{numbeOfCategories:t,gender:n,categoriesSet:l,iterables:r}=e,i=new Set(l);if(!r[n])return i;let o=0,a=t+i.size;for(;a>i.size&&r[n][o];)i.add(r[n][o].text),o++;return i},T=e=>{let{firstGender:t,secondGender:n,visitedCategoriesToDisplay:l,iterables:r}=e,i=Math.ceil(_(l)/2),o=Math.floor(_(l)/2),a=S({numbeOfCategories:i,gender:t,categoriesSet:l,iterables:r});return S({numbeOfCategories:o,gender:n,categoriesSet:a,iterables:r})},E=(e,t,n)=>{let l=new Set(e),r=Array.from(l),i=[];return r.map(e=>{let r;if(t[e])return t[e];let o=e=>!l.has(e)&&!i.includes(e),a=n.default.find(e=>{let{text:t}=e;return o(t)});return a&&t[a.text]?(r=a.text,i.push(a.text)):r=Object.keys(t).find(e=>o(e)&&i.push(e)),t[r]})},k=e=>{let{block:t,selectedGender:n}=e,{featured:l={},iterables:r={}}=t,i=(0,d.xE)(l[n],l.default,l.womens),o=(0,d.fT)([r[n],r.default,r.womens]);return{...t,featured:i||{},iterables:o||[]}},x={newsdashboard:e=>
1{let t,{block:n,genderScores:l,selectedGender:r,otherGender:i,isLoggedIn:o}=e,a=l[i],{crewCuts:s}=l,{featured:c={},iterables:u={},iterables:{max:f=10}}=n,g=f-1,p=Math.floor((f-2)/2),h={...c[r]||c.default||{}},v=[...u[r]||u.default||[]],m=[...u.crewCuts||[]],w=[...u.promo||[]];if(a>=20&&u[i]){t=!0;let e=[...u[i]];if((0,d.D)(c[i])){let t=c[i],n=t.signedInOverride||{},l=(0,d.D)({...t,...n});e.unshift(l||t)}v.splice(p,0,...e.slice(0,p))}if(s>=20&&m.length){let e=t?2*p:p;if((0,d.D)(c.crewCuts)){let{crewCuts:e,crewCuts:{signedInOverride:t={}}}=c,n=(0,d.D)({...e,...t});m.unshift(n||e)}v.splice(e,0,...m.slice(0,p))}if(t&&v.slice(0,f).length%2){let e=u[r].find(e=>!v.slice(0,f).includes(e));if(e){let{signedInOverride:t={}}=e,n=(0,d.D)({...e,...t});v.splice(p,0,n||e)}}return w.length&&w.forEach(e=>{let t,{position:n,signedInOverride:l}=e;o&&(t=(0,d.D)({...e,...l})),v.splice(n>g?g:n,0,t||e)}),{...n,featured:h,iterables:v.slice(0,f)}},categoryrecs:e=>{let{block:t,categoriesData:{categories:n={}},genderScores:l,overridePersonalization:r}=e,{featured:i={},iterables:o={}}=t,a=A(r),[s,c]=D(l,!!a.length||r,r),u=T({firstGender:s,secondGender:c,visitedCategoriesToDisplay:O(a),iterables:o}),d=Object.keys(n).length||"categoryrecs"!==t.blockType?E(u,n,o):[];return{...t,featured:i.default,iterables:d}},oneup:e=>{let{block:t,genderScores:n,selectedGender:l}=e,{featured:r={}}=t,i=n[l]>=60?(0,d.D)(r[l]):(0,d.D)(r.default);return i?{...t,featured:i}:null},twoup:e=>{let{block:t,genderScores:n,selectedGender:l,otherGender:r}=e,{iterables:i={}}=t,o=n[l],a=n.crewCuts,s=[];if(!(0,d.Jq)(i)){let[e,t]=i[l]||[],[n,c]=i.default||[],[u,d]=i.crewCuts||[],[f,g]=i[r]||[];s.push(e||n||u||f||{}),a>o&&d?s.push(d):o<70&&g?s.push(g):s.push(t||c||d||{})}return{...t,iterables:(0,d.fT)([s,i])||[]}},columntouts:e=>{let t,{block:n,genderScores:l,selectedGender:r,otherGender:i,isLoggedIn:o}=e,a=l[i],{crewCuts:s}=l,{iterables:c={},iterables:{max:u=10}}=n,f=u-1,g=Math.floor((u-2)/2),p=[...c[r]||c.default||[]],h=[...c.crewCuts||[]],v=[...c.promo||[]];if(a>=20&&c[i]){t=!0;let e=[...c[i]];p.splice(g,0,...e.slice(0,g))}if(s>=20&&h.length){let e=t?2*g:g;p.splice(e,0,...h.slice(0,g))}if(t&&p.slice(0,u).length%2){let e=c[r].find(e=>!p.slice(0,u).includes(e));e&&p.splice(g,0,e)}let{featured:m={}}=n,w=(0,d.D)(m[r]);return v.length&&v.forEach((e,t)=>{var n,l,i,a,s,c;let u,g,h,{position:m,signedInOverride:w={}}=e;g=m,window.innerWidth<768&&(null===(s=v[t].extraData)||void 0===s?void 0:s.positionMobile)!==void 0&&(g=null===(c=v[t].extraData)||void 0===c?void 0:c.positionMobile),u=g>f?f:g,o&&(h=(0,d.D)({...e,...w})),((null===(n=v[t].copyLines[0])||void 0===n?void 0:n.tag)!=="womens"||"womens"!==r)&&((null===(l=v[t].copyLines[0])||void 0===l?void 0:l.tag)!=="mens"||"mens"!==r)&&(null===(i=v[t].copyLines[0])||void 0===i?void 0:i.tag)!==""&&(null===(a=v[t].copyLines[0])||void 0===a?void 0:a.tag)||p.splice(u,0,h||e)}),{...n,iterables:p.slice(0,u),featured:w}},hpslideshow:e=>{let t,{block:n,genderScores:l,selectedGender:r,otherGender:i,isLoggedIn:o}=e,a=l[i],{crewCuts:s}=l,{iterables:c={},iterables:{max:u=10}}=n,f=u-1,g=Math.floor((u-2)/2),p=[...c[r]||c.default||[]],h=[...c.crewCuts||[]],v=[...c.promo||[]];if(a>=20&&c[i]){t=!0;let e=[...c[i]];p.splice(g,0,...e.slice(0,g))}if(s>=20&&h.length){let e=t?2*g:g;p.splice(e,0,...h.slice(0,g))}if(t&&p.slice(0,u).length%2){let e=c[r].find(e=>!p.slice(0,u).includes(e));e&&p.splice(g,0,e)}return v.length&&v.forEach(e=>{let t,{position:n,signedInOverride:l={}}=e;o&&(t=(0,d.D)({...e,...l})),p.splice(n>f?f:n,0,t||e)}),{...n,iterables:p.slice(0,u)}}},R=e=>{let{block:t,genderScores:n,selectedGender:l,otherGender:r,isLoggedIn:i,categoriesData:o,overridePersonalization:a}=e;return(x[null==t?void 0:t.blockType]||k)({block:t,genderScores:n,selectedGender:l,otherGender:r,isLoggedIn:i,categoriesData:o,overridePersonalization:a})};n(61505);let{publicRuntimeConfig:{CMS_URL:M}}=i()(),L=function(){let{pageVersion:e={blocks:[]},page:t=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:o.BOy,pageVersion:e,page:t}},P=(e,t,n,l)=>(r,i)=>{let{blocks:o=[]}=e,{anonUser:a,fromCookie:s}=t,{creativePage:{categoriesData:{json:f}}}=i(),g=!a&&!s&&void 0!==a&&void 0!==s,p=n||(0,u.L$)(),h=(0,c.getCookieByName)({name:"personalization"})||(p.womens>=p.mens?"womens":"mens"),v="womens"===h?"mens":"womens",m=null==o?void 0:o.map(e=>{let{blockType:t,usePersonalization:l,featured:r={},iterables:i={}}=e;return l?R({block:e,genderScores:p,selectedGender:h,otherGender:v,isLoggedIn:g,categoriesData:f,overridePersonalization:n}):{...e,featured:(0,d.D)(r.default)||(0,d.D)(r.womens)||(0,d.ny)({content:r.default,blockType:t})||{},iterables:(0,d.Jq)(i.default)||(0,d.Jq)(i.womens)||[]}}).filter(e=>null!==e);r(L({page:l||"homepage",pageVersion:{...e,blocks:m||[]}}))},I=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{json:e,type:o.eql}},N=e=>({error:e,type:o.b5x}),j=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return{value:e,type:o.NOn}},U=()=>async(e,t)=>{let{creativePage:{categoriesData:n},configuration:{fetchPersonalizedCategoryRecs:r}}=t();return(null==n?void 0:n.date)||r?Promise.resolve():(0,l.A)("".concat(M,"/api/categories"),{credentials:"omit"}).then(t=>e(I(t))).catch(t=>(s().error("fetchCategoriesData",{message:"Failed to fetch categories data",error:t}),e(N(t))))},J=()=>async(e,t)=>{let{configuration:{fetchPersonalizedCategoryRecs:n},creativePage:{categoriesData:{iterables:l=[]}={},isFetching:r}}=t();l.length||!n||r||(e(j()),e(I(await m())))}},62671:(e,t,n)=>{n.d(t,{D:()=>r,Jq:()=>i,fT:()=>a,ny:()=>s,xE:()=>o});let l=(e,t)=>
1t.some(t=>e[t]),r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{image:t,backgroundColor:n,video:r,headlines:i}=e,o=!!r&&r.sources&&l(r.sources,["mp4","webm","ogg"]),a=!!t&&!!Object.keys(t).length&&l(t,["xl","lg","md","sm"]),s=!!(null==i?void 0:i.length)&&(null==i?void 0:i.every(e=>{let{text:t}=e;return t}));return(o||a||!!n||s)&&e},i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],{strict:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Array.isArray(e),l=!!e.length,i=n&&e.every(e=>!!r(e));return n&&l&&(!t||i)&&e},o=function(){for(var e,t=arguments.length,n=Array(t),l=0;l<t;l++)n[l]=arguments[l];return(null==n?void 0:null===(e=n.find)||void 0===e?void 0:e.call(n,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(e)}))||!1},a=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],{strict:n=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(null==t?void 0:null===(e=t.find)||void 0===e?void 0:e.call(t,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return i(e,{strict:n})}))||!1},s=e=>{let{content:t,blockType:n}=e;return"wordcloud"===n&&t}}}]);
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.