(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6511],{82583:function(e,t,n){"use strict";n.d(t,{Ee:function(){return m},GR:function(){return p},LA:function(){return h},LL:function(){return g},Ue:function(){return l},aJ:function(){return d},bd:function(){return u},w2:function(){return f}});var o=n(68314),r=n(91586),i=n(50085),a=n(64112),s=n(63706),c=n.n(s),l=function(e){return c().defaults.baseURL=r.api.checkout.endpoint,function(t){return new Promise((function(n,o){var r={locale:e.locale,method:e.method,engineGuid:e.engineGuid,couponCode:e.couponCode,customer:e.customer,items:e.items,callbackSuccess:e.callbackSuccess,callbackCancel:e.callbackCancel};return t({type:a.axk,payload:{method:e.method,engineGuid:e.engineGuid,couponCode:e.couponCode,items:e.items}}),i.B("begin_checkout",{currency:"GBP",value:e.cartTotal}),c().post("/checkout",r).then((function(e){t({type:a.P8G,payload:e.data.checkout}),n(e.data.checkout)})).catch((function(e){t({type:a.d_c,payload:{error:e}}),o(e)}))}))}},d=function(e){return c().defaults.baseURL=r.api.checkout.endpoint,function(t){return new Promise((function(n,r){i.B("add_to_cart",{currency:"GBP",value:e.cartTotal,items:e.items.map((function(e){return(0,o.Z)({item_id:e.guid,item_name:e.name},e)}))}),t({type:a.WMT,payload:(0,o.Z)({},e)}),n(e)}))}},u=function(e){return c().defaults.baseURL=r.api.checkout.endpoint,function(t){return new Promise((function(n,r){t({type:a.FR7,payload:(0,o.Z)({},e)}),n(e)}))}},p=function(e){return c().defaults.baseURL=r.api.checkout.endpoint,function(t){return new Promise((function(n,r){t({type:a.Y_M,payload:(0,o.Z)({},e)}),n(e)}))}},h=function(){return function(e){return new Promise((function(t,n){e({type:a.tN$}),t()}))}},m=function(){return c().defaults.baseURL=r.api.checkout.endpoint,function(e){return new Promise((function(t,n){e({type:a.wy1}),t()}))}},g=function(){return c().defaults.baseURL=r.api.checkout.endpoint,function(e){return new Promise((function(t,n){e({type:a.qX1}),t()}))}},f=function(e){return c().defaults.baseURL=r.api.admin.endpoint,function(t){return new Promise((function(n){return t({type:a.UKM,payload:e}),n(e)}))}}},11907:function(e,t,n){"use strict";n.d(t,{Rm:function(){return g},YR:function(){return p},qC:function(){return h},s6:function(){return m},yC:function(){return f}});var o=n(68314),r=n(84985),i=n(91586),a=n(64112),s=n(63706),c=n.n(s),l=n(20851),d=n(70402),u=d.transformHits,p=(d.checkWebPSupport,function(e){var t=e.hostname,n=e.slug,o=e.password;return c().defaults.baseURL=i.api.admin.endpoint,function(e){return new Promise((function(r,i){e({type:a.wXe,payload:{hostname:t,slug:n,password:o}}),c().post("/engines/authenticate",{hostname:t,slug:n,password:o}).then((function(t){var n=t.data.valid;return e({type:a.rMh,payload:{valid:n}}),r(n)})).catch((function(e){return i(e)}))}))}}),h=function(e){return c().defaults.baseURL=i.api.search.endpoint,function(t){return new Promise((function(t,n){return c().post("/getFacesInPhoto",{photo:e}).then((function(e){t(e.data)})).catch((function(e){}))}))}},m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return c().defaults.baseURL=i.api.search.endpoint,function(t){return new Promise((function(n,o){return t({type:a.A5m,payload:{selfie:e.blob,threshold:e.threshold,engines:e.engines}}),c().post("/galleries/searchByImage",{selfie:e.blob,threshold:e.threshold,engines:e.engines}).then((function(e){t({type:a.r$U,payload:{matches:e.data.results}}),n(e.data)})).catch((function(e){t({type:a.O1z,payload:{error:e}})}))}))}},g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={requestId:e.requestId?e.requestId:null,images:e.images?e.images:null,collections:e.collections?e.collections:null,colors:e.colors?e.colors:null,colorMinPercent:e.colorMinPercent?e.colorMinPercent:null,helmetColors:e.helmetColors?e.helmetColors:null,wheelColors:e.wheelColors?e.wheelColors:null,sessions:e.sessions?e.sessions:null,text:e.text?e.text:null,folder:e.folder?e.folder:null,session:e.session?e.session:null,timestamp_from:e.timestamp_from?e.timestamp_from:null,timestamp_to:e.timestamp_to?e.timestamp_to:null,hours_from:e.hours_from?e.hours_from:null,mins_from:e.mins_from?e.mins_from:null,hours_to:e.hours_to?e.hours_to:null,mins_to:e.mins_to?e.mins_to:null},n=l.stringify(t,{skipNull:!0,skipEmptyString:!0}),o=window.location.protocol+"//"+window.location.host+window.location.pathname+"".concat(n?"?".concat(n):"");window.history.pushState({path:o},"",o)},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return c().defaults.baseURL=i.api.search.endpoint,function(t){return new Promise((function(n,i){return g(e),t({type:a.fYo,payload:(0,r.Z)((0,o.Z)({},e),{refresh:e.refresh})}),delete e.refresh,delete e.page,e.device=window.innerWidth<=600?"mobile":"desktop",e.format="jpg",c().post("/galleries/search",(0,r.Z)((0,o.Z)({},e),{groups:e.groups||[],requestId:e.requestId?e.requestId:void 0,hostname:window.location.hostname,images:e.images&&e.images.length>0?JSON.stringify(e.images):void 0,selfie:e.selfie?e.selfie:void 0,collections:e.collections&&e.collections.length>0?JSON.stringify(e.collections):void 0,colors:e.colors&&e.colors.length>0?JSON.stringify(e.colors):void 0,colorMinPercent:e.colorMinPercent?e.colorMinPercent:void 0,helmetColors:e.helmetColors&&e.helmetColors.length>0?JSON.stringify(e.helmetColors):void 0,wheelColors:e.wheelColors&&e.wheelColors.length>0?JSON.stringify(e.wheelColors):void 0,sessions:e.sessions&&e.sessions.length>0?JSON.stringify(e.sessions):void 0})).then((function(o){u(o.data.photos?o.data.photos:o.data).then((function(r){t({type:a.mfO,payload:{refresh:e.refresh,content:r,videos:o.data.videos?o.data.videos:[]}}),n(r)}))})).catch((function(e){t({type:a.HkW,payload:{error:e}}),i()}))}))}}},50085:function(e,t,n){"use strict";n.d(t,{B:function(){return i},L:function(){return r}});var o=n(91586),r=function(e){window.gtag("config",o.ga.code,{page_path:e})},i=function(e,t){window.gtag("event",e,t)}},17042:function(e,t,n){"use strict";n.d(t,{h:function(){return s}});var o=n(91586),r=n(64112),i=n(63706),a=n.n(i),s=function(e){return a().defaults.baseURL=o.api.admin.endpoint,function(t){return new Promise((function(n,o){var i={params:{hostname:e.hostname,guid:e.guid}};return t({type:r.weL,payload:{guid:e.guid}}),a().get("/orders",i).then((function(e){t({type:r.oLn,payload:e.data.order}),n(e.data.order)})).catch((function(e){t({type:r.kHW,payload:{error:e}}),o(e)}))}))}}},70402:function(e,t,n){"use strict";n.r(t),n.d(t,{asyncForEach:function(){return d},checkWebPSupport:function(){return x},containsText:function(){return b},downloadCSV:function(){return g},getCountryInfoByName:function(){return l},getSymbol:function(){return p},secondsToHms:function(){return u},slugify:function(){return f},transformHits:function(){return m}});var o=n(31169),r=n(68314),i=n(84985),a=n(13565),s=n(63706),c=n.n(s),l=function(e){return new Promise((function(t){return c().get("https://restcountries.com/v2/name/".concat(e)).then((function(e){return t(e.data)}))}))},d=function(){var e=(0,o.Z)((function(e,t){var n;return(0,a.__generator)(this,(function(o){switch(o.label){case 0:n=0,o.label=1;case 1:return n<e.length?[4,t(e[n],n,e)]:[3,4];case 2:o.sent(),o.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}(),u=function(e){e=Number(e);var t=Math.floor(e/3600),n=Math.floor(e%3600/60),o=Math.floor(e%3600%60),r="";return r=(r=r+t.toString().padStart(2,"0")+":")+n.toString().padStart(2,"0")+":",r+=o.toString().padStart(2,"0")},p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"gbp",t=e.toUpperCase();switch(e.toLowerCase()){case"gbp":t="\xa3";break;case"eur":t="\u20ac";break;case"sek":t="kr";break;case"usd":case"cad":case"mxn":t="$";break;case"zar":t="R"}return t},h=function(e){return new Promise((function(t){if(e.height&&e.width)return t({height:e.height,width:e.width,thumbnail:e.thumbnail});var n=new Image;n.onload=function(){var o=n.height,r=n.width;return t({height:o,width:r,thumbnail:e.thumbnail})},n.onerror=function(){return t({height:778,width:1e3,thumbnail:"/images/image-load-error.png"})},n.src=e.thumbnail}))},m=function(e){return new Promise((function(t){var n=[],o=!0,a=!1,s=void 0;try{for(var c,l=e.hits[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var d=c.value,u=h(d.image);n.push(u)}}catch(p){a=!0,s=p}finally{try{o||null==l.return||l.return()}finally{if(a)throw s}}window.innerWidth,Promise.all(n).then((function(n){var o=e.hits.map((function(e,t){return(0,i.Z)((0,r.Z)({},e),{image:(0,i.Z)((0,r.Z)({},e.image),{height:n[t].height,width:n[t].width,thumbnail:n[t].thumbnail,thumbnailHeight:n[t].height,thumbnailWidth:n[t].width})})}));return e=(0,i.Z)((0,r.Z)({},e),{hits:o}),t(e)})).catch((function(e){return t()}))}))};var g=function(e){var t,n,o,r=function(e){var t,n,o,r,i,a;return null!=(a=e.data||null)&&a.length?(r=e.columnDelimiter||",",i=e.lineDelimiter||"\n",o=Object.keys(a[0]),t="",t+=o.join(r),t+=i,a.forEach((function(e){n=0,o.forEach((function(o){n>0&&(t+=r),t+=e[o],n++})),t+=i})),t):null}({data:e.data});null!=r&&(n=e.filename||"data.csv",r.match(/^data:text\/csv/i)||(r="data:text/csv;charset=utf-8,"+r),t=encodeURI(r),(o=document.createElement("a")).setAttribute("href",t),o.setAttribute("download",n),o.click())},f=function(e){return e.split("").map((function(e,t){return e.replace(new RegExp("\xe3\xe0\xe1\xe4\xe2\u1ebd\xe8\xe9\xeb\xea\xec\xed\xef\xee\xf5\xf2\xf3\xf6\xf4\xf9\xfa\xfc\xfb\xf1\xe7\xb7/_,:;".charAt(t),"g"),"aaaaaeeeeeiiiiooooouuuunc------".charAt(t))})).toString().toLowerCase().trim().replace(/\s+/g,"-").replace(/&/g,"-y-").replace(/[^\w-]+/g,"").replace(/--+/g,"-")},x=function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))&&0==e.toDataURL("image/webp").indexOf("data:image/webp")},b=function(e,t){return e.toLowerCase().indexOf(t.toLowerCase())>-1}},28210:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});n(16863);var o=n(66780),r=n(54602),i=n(96006),a=(0,o.Z)((function(e){return{root:{color:"white",backgroundColor:i.Z[500],"&:hover":{backgroundColor:i.Z[700]}}}}))(r.Z)},91586:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=(0,(0,n(94518).Z)(n(87856)).default)().publicRuntimeConfig;e.exports={env:o.ENVIRONMENT,api:{admin:{endpoint:o.NEXT_PUBLIC_ADMIN_API_ENDPOINT},workspaces:{endpoint:o.NEXT_PUBLIC_WORKSPACES_API_ENDPOINT},checkout:{endpoint:o.NEXT_PUBLIC_CHECKOUT_API_ENDPOINT},search:{endpoint:o.NEXT_PUBLIC_SEARCH_API_ENDPOINT},analytics:{endpoint:o.NEXT_PUBLIC_ANALYTICS_API_ENDPOINT}},cdn:{endpoint:o.NEXT_PUBLIC_CLOUDFRONT_ENDPOINT},imgix:{media:{endpoint:o.NEXT_PUBLIC_IMGIX_MEDIA_ENDPOINT}},ga:{code:"G-4Z9S4YYVP1"},stripe:{publishable_key:o.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY}}},22318:function(e,t,n){"use strict";n.d(t,{y:function(){return p}});var o=n(849),r=n(16863),i=n(12383),a=n.n(i),s=n(22516),c=n(20321),l=n(79315),d=(0,c.Z)((function(e){return{root:{backgroundColor:e.palette.background.default},content:{backgroundColor:e.palette.background.default,height:"100%"}}})),u=function(e){var t=e.themeMode,n=e.themeToggler,i=e.children,a=e.className,c=d();return(0,o.jsxs)("div",{className:(0,s.Z)(c.root,a),children:[(0,o.jsx)(l.mh,{}),(0,o.jsx)("main",{className:c.content,children:r.cloneElement(i,{themeMode:t,themeToggler:n})})]})};u.propTypes={children:a().node,className:a().string};var p=u},4805:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var o=n(47589),r=n(849),i=(n(16863),n(26279)),a=n(20321),s=n(54602),c=n(2739),l=n(31737),d=n(25628),u=(0,a.Z)((function(e){return{root:{"& .hero-shaped":{borderBottom:0},"& .hero-shaped__wrapper":(0,o.Z)({},e.breakpoints.up("md"),{minHeight:"calc(100vh - ".concat(e.mixins.toolbar["@media (min-width:600px)"].minHeight,"px)")})},formContainer:(0,o.Z)({height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},e.breakpoints.down("sm"),{maxWidth:500,margin:"0 auto"}),image:{objectFit:"cover"},label:{fontWeight:"bold",textTransform:"uppercase"}}})),p=function(){var e=u(),t=(0,i.Z)().t;return(0,r.jsx)("div",{className:e.root,children:(0,r.jsx)(d.j4,{leftSide:(0,r.jsx)("div",{className:e.formContainer,children:(0,r.jsx)(l.M$,{title:t("ACCOUNT_SUSPENDED"),subtitle:(0,r.jsxs)("span",{children:[t("ACCOUNT_SUSPENDED_TEXT")," "]}),titleProps:{variant:"h3"},labelProps:{color:"secondary",className:e.label,variant:"h5"},ctaGroup:[(0,r.jsx)(s.Z,{size:"large",variant:"contained",color:"primary",href:"mailto:support@photohawk.com",onClick:function(){window.history.back()},children:t("CONTACT_SUPPORT")})],disableGutter:!0})}),rightSide:(0,r.jsx)(c.Ee,{src:"https://assets.maccarianagency.com/the-front/photos/account/cover-3.png",className:e.image,lazy:!1})})})}},86073:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var o=n(47589),r=n(849),i=(n(16863),n(26279)),a=n(20321),s=n(54602),c=n(2739),l=n(31737),d=n(25628),u=(0,a.Z)((function(e){return{root:{"& .hero-shaped":{borderBottom:0},"& .hero-shaped__wrapper":(0,o.Z)({},e.breakpoints.up("md"),{minHeight:"calc(100vh - ".concat(e.mixins.toolbar["@media (min-width:600px)"].minHeight,"px)")})},formContainer:(0,o.Z)({height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},e.breakpoints.down("sm"),{maxWidth:500,margin:"0 auto"}),image:{objectFit:"cover"},label:{fontWeight:"bold",textTransform:"uppercase"}}})),p=function(){var e=u(),t=(0,i.Z)().t;return(0,r.jsx)("div",{className:e.root,children:(0,r.jsx)(d.j4,{leftSide:(0,r.jsx)("div",{className:e.formContainer,children:(0,r.jsx)(l.M$,{label:"404",title:t("NOT_FOUND"),subtitle:(0,r.jsxs)("span",{children:[t("THERES_NOTHING_HERE")," ",(0,r.jsx)(c.dh,{title:t("LET_US_KNOW").toLowerCase(),href:"#",typographyProps:{variant:"h6"}})]}),titleProps:{variant:"h3"},labelProps:{color:"secondary",className:e.label,variant:"h5"},ctaGroup:[(0,r.jsx)(s.Z,{size:"large",variant:"contained",color:"primary",onClick:function(){window.history.back()},children:t("GO_BACK")})],disableGutter:!0})}),rightSide:(0,r.jsx)(c.Ee,{src:"https://assets.maccarianagency.com/the-front/photos/account/cover-3.png",className:e.image,lazy:!1})})})}},81466:function(e,t,n){"use strict";n.d(t,{YG:function(){return tn},vs:function(){return Xt},X1:function(){return vt},Pn:function(){return At}});var o=n(68314),r=n(84985),i=n(849),a=n(16863),s=n(133),c=n(70614),l=n(42030),d=n(54254),u=n(6239),p=n(31169),h=n(56144),m=n(24086),g=n(47589),f=n(77400),x=n(76895),b=n(26048),y=n(13565),w=n(54424),v=n.n(w),j=n(22516),Z=n(36831),C=n(66780),k=n(98259),T=n(96006),S=n(63706),P=n.n(S),_=n(91586),E=n(50085),I=n(2739),N=n(79315),D=n(18212),L=n.n(D),A=n(78423),O=n(57609),R=n(54602),G=n(95335),F=n(51335),W=n(39396),B=n(56305),U=n(43897),M=n(58688),H=n(34729),z=n(56285),q=n(59560),V=n(82298),X=n(71178),K=n(69386),Y=n(78196),$=n(83023),J=n(82381),Q=n(41534),ee=n(69005),te=n(79075),ne=n(11909),oe=n(71136),re=n(92152),ie=n(76420),ae=n(36477),se=n(69586),ce=n(9064),le=n(8560),de=n(73717),ue=n(88042),pe=n(26228),he=n(682),me=n(25727),ge=n(84501),fe=n(99965),xe=n(50093),be=n(8276),ye=n(56985),we=n(13278),ve=n(88138),je=n(65714),Ze=n(9887),Ce=n(62574),ke=n(80089),Te=n(99194),Se=n(22089),Pe=n(67278),_e=n(17476),Ee=n(20321),Ie=(0,Ee.Z)((function(e){return{root:{margin:50,justifyContent:"center",display:"flex","& > * + *":{marginLeft:e.spacing(2)},color:e.palette.background.text}}}));function Ne(e){var t=Ie(),n=e.size||30;return(0,i.jsx)("div",{className:t.root,children:(0,i.jsx)(oe.Z,{color:"inherit",size:n})})}var De=n(48624),Le=n.n(De),Ae=(n(74809),n(82583)),Oe=n(64112),Re=n(70402).asyncForEach,Ge=function(e,t,n,o){return P().defaults.baseURL=_.api.admin.endpoint,function(r){return new Promise((function(i,a){return r({type:Oe.Y5l,payload:{customer:e,engineGuid:t,content:n,checkoutGuid:o}}),P().post("/content/download",{customer:e,engineGuid:t,content:n,checkoutGuid:o}).then((function(e){r({type:Oe.t5c,payload:{downloads:e.data.downloads}}),i(e.data.downloads)})).catch((function(e){r({type:Oe._VG,payload:{error:e}})}))}))}},Fe=function(){return function(e){e({type:Oe.u_F})}},We=n(11907);P().defaults.baseURL=_.api.admin.endpoint;var Be=function(e){return function(t){return new Promise((function(n){t({type:Oe.kYU,payload:{data:e}}),n(e)}))}},Ue=function(e){return function(t){return new Promise((function(n){t({type:Oe.w1Y,payload:{data:e}}),n(e)}))}},Me=function(){return function(e){e({type:Oe.MLQ})}},He=function(e){return(0,We.Rm)(e),function(t){return new Promise((function(n){t({type:Oe.y$P,payload:(0,o.Z)({},e)}),n(e)}))}},ze=n(17042),qe=n(9995),Ve=n.n(qe),Xe=function(e){return P().defaults.baseURL=_.api.analytics.endpoint,function(t){return new Promise((function(n){var o={sessionGuid:e.sessionGuid,actionType:e.actionType,engineGuid:e.engineGuid,count:e.count||1};return t({type:Oe.mDd,payload:{sessionGuid:e.sessionGuid,actionType:e.actionType,engineGuid:e.engineGuid,userAgent:navigator.userAgent}}),P().post("/actions",o).then((function(e){t({type:Oe.YT9}),n()})).catch((function(e){t({type:Oe.GDk,payload:{error:e}}),n()}))}))}},Ke=n(70402),Ye=v()((function(){return Promise.all([n.e(7526),n.e(3085)]).then(n.bind(n,53085))}),{loadableGenerated:{webpack:function(){return[53085]}}}),$e=v()((function(){return n.e(4533).then(n.bind(n,64533))}),{loadableGenerated:{webpack:function(){return[64533]}}}),Je=v()((function(){return Promise.all([n.e(6846),n.e(82),n.e(7314)]).then(n.bind(n,97314))}),{loadableGenerated:{webpack:function(){return[97314]}}}),Qe=v()((function(){return n.e(5992).then(n.bind(n,55992))}),{loadableGenerated:{webpack:function(){return[55992]}}}),et=v()((function(){return Promise.all([n.e(6846),n.e(3529)]).then(n.bind(n,3529))}),{loadableGenerated:{webpack:function(){return[3529]}}}),tt=v()((function(){return Promise.all([n.e(6846),n.e(6561)]).then(n.bind(n,26561))}),{loadableGenerated:{webpack:function(){return[26561]}}}),nt=v()((function(){return Promise.all([n.e(2462),n.e(6244),n.e(3094)]).then(n.bind(n,33094))}),{loadableGenerated:{webpack:function(){return[33094]}}}),ot=v()((function(){return Promise.all([n.e(2462),n.e(6244),n.e(7316)]).then(n.bind(n,27316))}),{loadableGenerated:{webpack:function(){return[27316]}}}),rt=v()((function(){return Promise.all([n.e(6476),n.e(367)]).then(n.bind(n,80367))}),{loadableGenerated:{webpack:function(){return[80367]}}}),it=v()((function(){return Promise.all([n.e(6476),n.e(5075)]).then(n.bind(n,35075))}),{loadableGenerated:{webpack:function(){return[35075]}}}),at=v()((function(){return Promise.all([n.e(6476),n.e(9702),n.e(2462),n.e(393),n.e(2521)]).then(n.bind(n,4230))}),{loadableGenerated:{webpack:function(){return[4230]}}}),st=v()((function(){return Promise.all([n.e(6846),n.e(82)]).then(n.bind(n,82))}),{loadableGenerated:{webpack:function(){return[82]}}}),ct=v()((function(){return n.e(5764).then(n.bind(n,65764))}),{loadableGenerated:{webpack:function(){return[65764]}}}),lt=v()((function(){return n.e(4846).then(n.bind(n,84846))}),{loadableGenerated:{webpack:function(){return[84846]}}}),dt=v()((function(){return Promise.all([n.e(6476),n.e(9702),n.e(2578),n.e(393),n.e(5370)]).then(n.bind(n,65370))}),{loadableGenerated:{webpack:function(){return[65370]}}}),ut=v()((function(){return Promise.all([n.e(6476),n.e(8262)]).then(n.bind(n,38262))}),{loadableGenerated:{webpack:function(){return[38262]}}}),pt=v()((function(){return Promise.all([n.e(9702),n.e(4574)]).then(n.bind(n,24574))}),{loadableGenerated:{webpack:function(){return[24574]}}}),ht=v()((function(){return n.e(818).then(n.bind(n,50818))}),{loadableGenerated:{webpack:function(){return[50818]}}}),mt=v()((function(){return n.e(2746).then(n.bind(n,52746))}),{loadableGenerated:{webpack:function(){return[52746]}}}),gt=(0,k.n)({}),ft={getSession:function(e){return P().defaults.baseURL=_.api.analytics.endpoint,function(t){return new Promise((function(n){var o="".concat(e.engineGuid,"::session"),r=window.localStorage.getItem(o);if(r)return console.log("resuming session",r),n(r);var i=new(Ve()),a={engineGuid:e.engineGuid,userAgent:navigator.userAgent,userAgentInfo:i.getResult()};return t({type:Oe.DKs,payload:{actionType:e.actionType,engineGuid:e.engineGuid}}),P().post("/session",a).then((function(e){t({type:Oe.RMP}),window.localStorage.setItem(o,e.data.guid),n(e.data.guid)})).catch((function(e){t({type:Oe.XNK,payload:{error:e}}),n()}))}))}},captureAction:Xe,openCart:Ae.LA,closeCart:Ae.Ee,clearCart:Ae.LL,addToCart:Ae.aJ,removeFromCart:Ae.GR,updateCartItem:Ae.bd,authenticateEngine:We.YR,searchEngine:We.yC,searchEngineByImage:We.s6,getFacesInPhoto:We.qC,selectContent:Be,selectAllContent:Ue,clearSelection:Me,updateFilters:He,download:Ge,sendFreeDownloads:function(e){var t=e.locale,n=e.emailAddress,o=e.engineGuid,r=e.content;return P().defaults.baseURL=_.api.admin.endpoint,function(e){return new Promise((function(i,a){return e({type:Oe.kN5,payload:{locale:t,emailAddress:n,engineGuid:o,content:r}}),P().post("/content/send",{locale:t,emailAddress:n,engineGuid:o,content:r}).then((function(t){e({type:Oe.eJR}),i(t.data.downloads)})).catch((function(t){e({type:Oe.x5h,payload:{error:t}})}))}))}},clearDownloads:Fe,fetchOrder:ze.h},xt=(0,C.Z)((function(e){return{root:{color:"white",backgroundColor:T.Z[500],"&:hover":{backgroundColor:T.Z[700]}}}}))(R.Z),bt=function(e){return e.preventDefault()},yt=function(e){(0,f.Z)(a,e);var t=(0,b.Z)(a);function a(e){var n;return(0,h.Z)(this,a),n=t.call(this,e),(0,g.Z)((0,u.Z)(n),"trackScrolling",(function(){n.isBottom()&&n.props.search.content.rows.total>n.props.search.content.rows.received&&n.onViewMore()})),(0,g.Z)((0,u.Z)(n),"handleClick",(function(e){if(e.srcElement.offsetParent&&"ReactGridGallery_tile-bottom-bar"===e.srcElement.offsetParent.className){var t=e.srcElement.innerText;-1===t.indexOf(":")&&n.searchEngine({filters:{text:t}})}})),(0,g.Z)((0,u.Z)(n),"onReset",(function(){n.setState({searchBarActive:!1,searchBarText:null,scrollLimitExceeded:!1},(function(){var e={collections:[],timestamp_from:null,timestamp_to:null,searchAfter:null,selfie:null,images:[],text:null,requestId:null,colors:[],helmetColors:[],wheelColors:[],groups:[]},t=n.props.engines.detail.engine,o=t.collectionViewMode,r=![!0,!1].includes(n.props.engines.detail.engine.allowBrowsing)||n.props.engines.detail.engine.allowBrowsing;"grid"===o&&t.features.includes("collectionSearch")||!r?n.props.updateFilters(e):n.searchEngine({filters:e})}))})),(0,g.Z)((0,u.Z)(n),"onSelectAll",(function(e,t){var o=n.props.search.selected.concat(e);o=o.filter((function(e,t,n){return n.findIndex((function(t){return t.guid===e.guid}))===t})),n.props.selectAllContent(o).then((function(){if(t){var e={product:t,items:o};n.props.addToCart(e).then((function(){N.fn.success(n.props.i18n.t("ADDED_TO_CART"),n.props.i18n.t("CART_UPDATED"),1500)}))}}))})),(0,g.Z)((0,u.Z)(n),"onClearSelection",(function(){n.props.clearSelection()})),(0,g.Z)((0,u.Z)(n),"onDownload",(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=n.props.checkout.customer;e=t.length>0?t.map((function(e){return{guid:e.guid,collectionGuid:e.collectionGuid}})):n.contentArray().filter((function(e){return e.isSelected})).map((function(e){return{guid:e.guid,collectionGuid:e.collectionGuid}}));var r=n.props.engines.detail.engine.guid;n.props.download(o,r,e).then((function(e){E.B("download",{count:e.length}),n.captureAction("download",e.length)}))})),(0,g.Z)((0,u.Z)(n),"showGallery",(function(e){var t=e.id,o=e.account,r=e.engine,a=e.filters,c=e.images,d=e.classes,p=e.search,h=e.theme,m=e.router,g=e.defaultProduct,f=e.selectedContent,x=e.textClass,b=e.isFreeDownloads,y=e.videoProducts,w=r.features||[],v=f.length>0,j=c.length>1&&c.length<=300&&f.length!==c.length,Z=c.filter((function(e){return e.vehicles&&e.vehicles.length>=1})).length>=1,C=(a.selected.groups.length>0||a.selected.text||a.selected.selfie)&&p.videos.rows.hits.length>0,k=p.videos.rows.hits,T=(r.productList&&(0,Ke.getSymbol)(r.productList.currency),y&&y[0]&&1===y[0].products.length?y[0].products[0]:null),S=[],P=C&&(T||w.includes("freeDownloads"));return P&&(S=k.map((function(e){var t=e.videoGuid,n=e.hlsUrl,i=e.mp4Key,a=e.startPosition,s=e.endPosition;return{videoGuid:t,hlsUrl:n,mp4Key:i,startPosition:a,endPosition:s,gifUrl:"https://".concat(-1!==window.location.hostname.indexOf("staging")||-1!==window.location.hostname.indexOf("localhost")?"previews-staging":"previews",".photohawk-cdn.com/preview/videoGif?tenant=").concat(o.guid,"&videoGuid=").concat(t,"&engineGuid=").concat(r.guid,"&version=").concat(r.watermarkVersion,"&startFrame=").concat(a,"&endFrame=").concat(s)}}))),(0,i.jsxs)("div",{style:{padding:"1em"},children:[S.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(G.Z,{variant:"h6",children:n.props.i18n.t("VIDEOS")}),(0,i.jsx)(F.Z,{}),(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),(0,i.jsx)(W.Z,{container:!0,spacing:2,children:S.map((function(e,t){var o=e.videoGuid,a=e.startPosition,s=e.endPosition,c=e.gifUrl,l=(e.hlsUrl,e.mp4Key),u="https://".concat("prod"===_.env?"previews":"previews-staging",".photohawk-cdn.com/preview/video?deviceWidth=").concat(window.innerWidth,"&engineGuid=").concat(r.guid,"&secure=").concat(!w.includes("freeDownloads"),"&startPosition=").concat(a,"&endPosition=").concat(s,"&key=").concat(l);return(0,i.jsx)(W.Z,{item:!0,alignItems:"center",direction:"column",xs:12,sm:6,md:4,children:(0,i.jsxs)(ae.Z,{className:d.videoCard,children:[(0,i.jsx)(se.Z,{style:{position:"relative",backgroundSize:"contain"},className:d.videoCardMedia,image:c,children:function(e){return(0,i.jsx)(ht,{secure:!w.includes("freeDownloads"),startPosition:a,url:e,iconComponent:(0,i.jsx)(me.Z,{className:d.mediaPlayIcon})})}(u)}),(0,i.jsxs)(ce.Z,{align:"right",className:d.videoCardActions,children:[!w.includes("freeDownloads")&&T&&(0,i.jsx)(xt,{style:{float:"left"},size:"small",className:d.videoAddToCartButton,onClick:function(){n.props.addToCart({engineGuid:r.guid,product:y[0],items:[{guid:"videoGuid:".concat(o,":startPosition:").concat(a,":endPosition:").concat(s),videoGuid:o,startPosition:a,endPosition:s,url:c}],openCart:!1}).then((function(){N.fn.success(n.props.i18n.t("ADDED_TO_CART"),n.props.i18n.t("CART_UPDATED"),1500)}))},children:n.props.i18n.t("ADD_TO_CART")}),w.includes("freeDownloads")&&(0,i.jsx)(xt,{href:u,style:{float:"left"},size:"small",className:d.videoAddToCartButton,children:"Download"}),(0,i.jsxs)(R.Z,{style:{float:"left"},size:"small",className:d.videoAddToCartButton,children:[(0,Ke.secondsToHms)(a)," - ",(0,Ke.secondsToHms)(s)]})]})]})},t)}))}),(0,i.jsx)("br",{})]}),P&&c.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(G.Z,{variant:"h6",children:n.props.i18n.t("PHOTOS")}),(0,i.jsx)(F.Z,{})]}),(r.helpText&&r.helpText.length>0||w.includes("freeDownloads")||j||v)&&(0,i.jsxs)("div",{align:"right",style:{minHeight:55,padding:2},children:[(0,i.jsx)("br",{}),j&&(0,i.jsxs)(R.Z,{className:x,size:"small",style:{float:"left"},onClick:function(){return n.onSelectAll(c,g)},children:[n.props.i18n.t("SELECT_ALL")," ",n.props.filters.selected.text||n.props.filters.selected.images.length>0?"(".concat(c.length,")"):""]}),v&&(0,i.jsxs)(R.Z,{className:x,size:"small",style:{float:"left"},onClick:function(){return n.onClearSelection()},children:[n.props.i18n.t("CLEAR_SELECTION")," (",f.length,")"]}),b&&!r.productListGuid&&f.length>0&&n.showFreeDownloadButton({float:"right",className:x,selectedContent:f}),r.helpText&&r.helpText.length>0&&(0,i.jsx)($e,{text:r.helpText,className:x}),(w.includes("collectionSearch")||w.includes("timeSearch")||Z)&&(0,i.jsx)(B.ZP,{title:"Apply filters",children:(0,i.jsx)(U.Z,{style:{float:"right"},size:"small",className:x,onClick:n.toggleDrawer,children:(0,i.jsx)(ge.Z,{className:x})})}),(0,i.jsx)(ct,{router:m,type:"icon",engine:r,content:f,className:x}),r.productListGuid&&(0,i.jsx)(M.Z,{xsDown:!0,children:(0,i.jsx)(R.Z,{className:x,size:"small",style:{float:"right"},onClick:function(){return n.setState({showProductOptions:!0,productOptionsDirection:"up"})},children:n.props.i18n.t("PRICE_LIST")})}),(0,i.jsx)("br",{})]}),(0,i.jsx)("div",{id:t,style:{padding:2},className:p.loading?d.galleryLoading:d.gallery,children:(0,i.jsx)(L(),{id:t,preloadNextImage:!0,images:c,enableImageSelection:!0,showLightboxThumbnails:!1,backdropClosesModal:!0,lightboxWidth:900,rowHeight:250,margin:4,onSelectImage:function(e,t){return n.handleSelectContent(e,t,g)},lightboxWillOpen:n.handleLightboxOpening.bind((0,u.Z)(n)),lightboxWillClose:n.handleLightboxClosing.bind((0,u.Z)(n)),currentImageWillChange:n.onCurrentContentChange.bind((0,u.Z)(n)),customControls:[(0,i.jsx)(s.zt,{store:gt,children:(0,i.jsx)(l.Z,{theme:h,children:(0,i.jsx)(W.Z,{container:!0,children:(0,i.jsxs)(W.Z,{item:!0,xs:12,children:[n.state.colors.length>0&&(0,i.jsx)(A.Z,{max:5,style:{float:"right"},children:n.state.colors.map((function(e){var t="white"===e?"#222":"white",n=e;return(0,i.jsx)(H.Z,{alt:e,style:{border:"1px solid white",background:n,color:t},children:" "})}))}),(n.state.avatars.length>0||n.state.loadingFaces)&&(0,i.jsxs)(i.Fragment,{children:[n.state.loadingFaces&&(0,i.jsx)(oe.Z,{style:{color:"white",float:"right",margin:10},size:20}),(0,i.jsx)(A.Z,{max:window.innerWidth>1200?6:4,style:{float:"right"},children:n.state.avatars.map((function(e,t){return(0,i.jsx)(H.Z,{alt:"Face ".concat(t+1),src:e.src,style:{cursor:"pointer"},onClick:function(){var t;(t=e.src,fetch(t).then((function(e){return e.blob()})).then((function(e){return new Promise((function(t,n){var o=new FileReader;o.onloadend=function(){return t(o.result)},o.onerror=n,o.readAsDataURL(e)}))}))).then((function(e){n.searchEngine({filters:{collections:[],selfie:e}}),n.scrollToTop()}))}})}))})]}),(0,i.jsxs)(U.Z,{size:"small",className:n.state.isCurrentContentSelected?d.buttonRemove:d.buttonSelect,style:{marginRight:"5px"},variant:"contained",color:"default",onClick:function(){return n.handleSelectContent(0,n.state.currentContentDetail,g)},children:[n.state.isCurrentContentSelected&&(0,i.jsx)(fe.Z,{}),!n.state.isCurrentContentSelected&&(0,i.jsx)(xe.Z,{})]},"selectContent"),w.includes("freeDownloads")&&!r.productListGuid&&(0,i.jsx)(U.Z,{size:"small","aria-label":"download",component:"span",onClick:function(){return n.onDownload([n.state.currentContentDetail])},children:(0,i.jsx)(be.Z,{className:d.downloadIcon,style:{marginRight:"5px"}})}),n.state.currentContentDetail&&(0,i.jsx)(pt,{type:"icon",min:2,max:5,url:n.state.currentContentDetail.previews.xl.location,content:n.state.currentContentDetail,router:m}),r.productListGuid&&!g&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(R.Z,{size:"small",variant:"outlined",color:"primary",style:{marginLeft:"5px",backgroundColor:"transparent",color:"white",fontSize:"0.6125rem",borderColor:"white"},onClick:function(){n.props.selectContent(f.concat(n.state.currentContentDetail)),n.openProductOptions()},children:b?"Download":"donate"===r.paymentMode?"Donate":n.props.i18n.t("SELECT_PRODUCT_BUTTON_TEXT")})})]})})})})]})})]})})),(0,g.Z)((0,u.Z)(n),"openProductOptions",(function(){document.getElementById("lightboxBackdrop").click(),n.setState({showProductOptions:!0,productOptionsDirection:"up"})})),(0,g.Z)((0,u.Z)(n),"toggleDrawer",(function(e){n.setState({filtersOpen:e})})),n.searchEngine=n.searchEngine.bind((0,u.Z)(n)),n.onViewMore=n.onViewMore.bind((0,u.Z)(n)),n.onDownload=n.onDownload.bind((0,u.Z)(n)),n.onSelectAll=n.onSelectAll.bind((0,u.Z)(n)),n.contentArray=n.contentArray.bind((0,u.Z)(n)),n.openProductOptions=n.openProductOptions.bind((0,u.Z)(n)),n.trackScrolling=n.trackScrolling.bind((0,u.Z)(n)),n.handleClick=n.handleClick.bind((0,u.Z)(n)),n.onReset=n.onReset.bind((0,u.Z)(n)),n.handleCollectionSelected=n.handleCollectionSelected.bind((0,u.Z)(n)),n.handleSelectContent=n.handleSelectContent.bind((0,u.Z)(n)),n.state={loadingFaces:!1,collectionSearchValue:"",scrollLimitExceeded:!1,isCurrentContentSelected:!1,downloadSelected:!1,showProductOptions:!1,productOptionsDirection:"up",searching:!1,searchBarActive:!1,searchBarText:null,filtersOpen:!1,showWizard:!0,newValue:null,findMyPhotos:!1,authenticated:!1,authenticating:!0,avatars:[],colors:[]},n}return(0,m.Z)(a,[{key:"componentDidMount",value:function(){var e=this;return(0,p.Z)((function(){var t,i,a,s,l,d,u,p,h,m,g,f,x,b,w,v;return(0,y.__generator)(this,(function(y){switch(y.label){case 0:return n.e(9974).then(n.t.bind(n,69974,23)).then((function(e){return e.default})).then((function(e){e.init("2183711431888024"),e.init("934035521066948"),e.pageView(),c.Router.events.on("routeChangeComplete",(function(t){e.pageView(),E.L(t)}))})),document.addEventListener("scroll",e.trackScrolling),document.addEventListener("click",e.handleClick),document.addEventListener("contextmenu",bt),t=e.props.router.query,"success"!==t.checkoutResponse?[3,4]:[4,e.props.closeCart()];case 1:return y.sent(),[4,e.props.clearCart()];case 2:return y.sent(),[4,e.props.clearSelection()];case 3:y.sent(),y.label=4;case 4:return i="object"===typeof t.collections?t.collections:"string"===typeof t.collections?[t.collections]:[],a=t.colorMinPercent?t.colorMinPercent:void 0,s="object"===typeof t.colors?t.colors:"string"===typeof t.colors?[t.colors]:[],l="object"===typeof t.helmetColors?t.helmetColors:"string"===typeof t.helmetColors?[t.helmetColors]:[],d="object"===typeof t.wheelColors?t.wheelColors:"string"===typeof t.wheelColors?[t.wheelColors]:[],u="object"===typeof t.images?t.images:"string"===typeof t.images?[t.images]:[],p=t.text||null,h=t.timestamp_from?parseInt(t.timestamp_from):null,m=t.timestamp_to?parseInt(t.timestamp_to):null,p&&e.setState({searchBarText:p}),g=e.props.account.detail.account,f=(0,r.Z)((0,o.Z)({},t),{collections:i,colors:s,colorMinPercent:a,helmetColors:l,wheelColors:d,images:u,text:p,timestamp_from:h,timestamp_to:m}),[4,e.props.updateFilters((0,o.Z)({},f))];case 5:return y.sent(),e.captureAction("visit"),x=e.props.engines.detail.engine.collectionViewMode,b=![!0,!1].includes(e.props.engines.detail.engine.allowBrowsing)||e.props.engines.detail.engine.allowBrowsing,w=e.props.engines.detail.engine,!b&&(p||u.length>0)||b&&("grid"===x&&i.length>=1||"grid"!==x||p||u.length>0||!(w.features||[]).includes("collectionSearch"))?[4,e.props.searchEngine((0,o.Z)({hostname:window.location.hostname,refresh:!0,slug:t.slug,version:g.updatedAt},f))]:[3,7];case 6:y.sent(),e.clearCartIfRequired(),y.label=7;case 7:return t.orderGuid?[4,e.props.fetchOrder({hostname:window.location.hostname,guid:t.orderGuid})]:[3,10];case 8:return y.sent(),[4,e.props.clearCart()];case 9:y.sent(),y.label=10;case 10:return w.authRequired&&window.localStorage.getItem("".concat(w.slug,":password"))?(e.setState({authenticating:!0}),v=window.localStorage.getItem("".concat(w.slug,":password")),e.props.authenticateEngine({slug:w.slug,password:v}).then((function(t){e.setState({authenticated:t,authenticating:!1})}))):e.setState({authenticating:!1}),[2]}}))}))()}},{key:"componentWillUnmount",value:function(){"undefined"!==typeof document&&document.removeEventListener("scroll",this.trackScrolling),document.removeEventListener("click",this.handleClick)}},{key:"captureAction",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this,o=this.props.account.detail.account;if(["pro","business","enterprise"].includes(o.plan)){var r=this.props.engines.detail.engine,i=r.guid;this.props.getSession({engineGuid:i}).then((function(o){n.props.captureAction({sessionGuid:o,engineGuid:i,actionType:e,count:t})}))}else console.log("Not capturing analytics as plan is unsupported:",o.plan)}},{key:"isBottom",value:function(){return Math.ceil(window.innerHeight+window.scrollY)>=document.documentElement.scrollHeight}},{key:"isTop",value:function(){return 0===window.scrollY}},{key:"scrollToTop",value:function(){document.body.scrollTop=0,document.documentElement.scrollTop=0}},{key:"clearCartIfRequired",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.props.engines.detail.engine,o=["true",!0,void 0].includes(n.allowMultipleParticipants),r=this.props.checkout.cart,i=e.groups||[],a=t.groups||[],s=1===i.length&&i[0].text,c=1===a.length&&a[0].text,l=1===i.length&&i[0].selfie,d=1===a.length&&a[0].selfie,u=e&&t&&t.text&&e.text!==t.text,p=e&&t&&t.selfie&&e.selfie!==t.selfie;!o&&r.items.length>0&&(u||p||s&&c&&s!==c||l&&d&&l!==d)&&(alert(this.props.i18n.t("MULTIPLE_PEOPLE_NOT_ALLOWED_MESSAGE")),this.props.clearCart(),this.onClearSelection())}},{key:"searchEngine",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this,n=e.searchAfter,i=e.filters||this.props.filters.selected,a=this.props.filters.selected,s=!n;if(!this.state.searching){this.setState({searching:!0,filtersOpen:!1,scrollLimitExceeded:!1}),s&&this.scrollToTop();var c=this.props.account.detail.account.updatedAt;this.props.engines.detail.engine;this.props.updateFilters(i).then((function(e){t.props.searchEngine((0,r.Z)((0,o.Z)({refresh:s,slug:t.props.router.query.slug},e),{searchAfter:n,version:c})).then((function(n){t.clearCartIfRequired(a,e),t.setState({searching:!1,showWizard:!0})}))}))}}},{key:"showFreeDownloadButton",value:function(e){var t=e.color,n=e.className,o=e.float,r=e.selectedContent,a=this;return(0,i.jsx)(U.Z,{className:n,style:{float:o},size:"small","aria-label":"download",component:"span",onClick:function(){return a.onDownload(r)},children:(0,i.jsx)(be.Z,{className:n,style:{color:t}})})}},{key:"showFeaturedBanners",value:function(e){var t=e.symbol,n=e.images,a=e.products,s=e.selectedContent,c=e.classes,l=this;return(0,i.jsx)(i.Fragment,{children:n.length>0&&a.filter((function(e){return e.isFeatured})).map((function(e){return(0,i.jsx)(i.Fragment,{children:e.products.filter((function(e){return e.isFeatured})).map((function(n){var a=n.featuredText&&n.featuredText.length>0?n.featuredText:"".concat(n.name," (").concat(t).concat(parseFloat(n.price).toFixed(2),")"),d="Standard"===n.pricingModel&&s.length>=1||"Package"===n.pricingModel&&s.length>=n.minUnits||"Volume"===n.pricingModel&&s.length>=n.volumeTiers[0].from&&s.length<=n.volumeTiers[n.volumeTiers.length-1].to,u=l.props.checkout.cart.items.filter((function(t){return t.product.name===e.name})),p=l.props.checkout.cart.items.map((function(e,t){return(0,r.Z)((0,o.Z)({},e),{index:t})}));return p=p.filter((function(e){return e.product.name===n.name})),u.length>=1?(0,i.jsxs)(de.Z,{className:c.featuredProductBanner,severity:s.length>0?"success":"info",icon:(0,i.jsx)(ye.Z,{}),onClick:0===s?null:function(){l.props.addToCart({product:e,items:s}).then((function(){N.fn.success(l.props.i18n.t("ADDED_TO_CART"),l.props.i18n.t("CART_UPDATED"),1500),l.onClearSelection(),l.props.openCart()}))},action:s.length>0?(0,i.jsx)(xt,{className:c.featuredButton,size:"small",children:l.props.i18n.t("ADD_TO_PACKAGE")}):null,children:[(0,i.jsx)(ue.Z,{className:c.featuredAlertTitle,children:a}),s.length>0?l.props.i18n.t("ADD_TO_PACKAGE_HELPTEXT"):l.props.i18n.t("ADD_TO_PACKAGE_SELECT_MORE_HELPTEXT")]}):(0,i.jsxs)(de.Z,{className:c.featuredProductBanner,severity:d?"success":"info",icon:(0,i.jsx)(we.Z,{}),onClick:d?function(){l.props.addToCart({product:e,items:s}).then((function(){N.fn.success(l.props.i18n.t("ADDED_TO_CART"),l.props.i18n.t("CART_UPDATED"),1500),l.onClearSelection(),l.props.openCart()}))}:null,action:d?(0,i.jsx)(xt,{className:c.featuredButton,size:"small",children:l.props.i18n.t("REDEEM")}):null,children:[(0,i.jsx)(ue.Z,{className:c.featuredAlertTitle,children:a}),d?l.props.i18n.t("REDEEM_VALID_HELPTEXT"):l.props.i18n.t("REDEEM_SELECT_HELPTEXT")]})}))})}))})}},{key:"getLogo",value:function(e,t){var n="true"===e.customTheme||!0===e.customTheme,o=e.PK?e.PK.substring(e.PK.indexOf("#")+1):"";return n?e.media.logo?"".concat(e.media.logo):null:t.mediaLogoGuid?"".concat(_.cdn.endpoint,"/media/").concat(o,"/").concat(t.mediaLogoName):null}},{key:"contentArray",value:function(){var e=this.props.search.selected,t=this.props.search.content.rows.hits,n=[],i=!0,a=!1,s=void 0;try{for(var c,l=this,d=function(){var t=c.value;t=(0,r.Z)((0,o.Z)({},t),{caption:t.uploadedBy?"".concat(t.name," (").concat(l.props.i18n.t("CREDIT"),": ").concat(t.uploadedBy,")"):t.name,src:(window.innerWidth,t.previews.lg.location),thumbnail:t.previews.md.location,thumbnailHeight:t.image.thumbnailHeight,thumbnailWidth:t.image.thumbnailWidth,isSelected:1===e.filter((function(e){return e.guid===t.guid})).length}),n.push(t)},u=t[Symbol.iterator]();!(i=(c=u.next()).done);i=!0)d()}catch(p){a=!0,s=p}finally{try{i||null==u.return||u.return()}finally{if(a)throw s}}return n}},{key:"onViewMore",value:function(){var e=this.props.engines.detail.engine.scrollLimit||0;if(!(this.props.filters.selected.images.length>0||this.props.filters.selected.images.selfie||this.props.filters.selected.text)&&e>0&&this.props.search.content.rows.received>=e)this.setState({scrollLimitExceeded:!0});else if(this.props.search.content.rows.received<this.props.search.content.rows.total){var t=this.props.search.content.rows.hits[this.props.search.content.rows.hits.length-1],n=t.searchAfter,o="mongo"===t.source?t.page:null,r=o?o+1:null;console.log(o,r),this.searchEngine({searchAfter:n,page:r}),E.B("search_scroll",{slug:this.props.router.query.slug})}}},{key:"handleSelectContent",value:function(e,t,n,o){var r=this;this.props.selectContent(t);var i=this.props.search.selected.filter((function(e){return e.guid===t.guid}));if(n&&0===i.length){var a={product:n,items:[t],openCart:!1};this.props.addToCart(a).then((function(){N.fn.success(r.props.i18n.t("ADDED_TO_CART"),r.props.i18n.t("CART_UPDATED"),1500)}))}this.setState({isCurrentContentSelected:!this.state.isCurrentContentSelected}),o&&o()}},{key:"onCurrentContentChange",value:function(e){var t=this.contentArray(),n=this.props.search.content.rows,o=n.received,r=n.total,i=t[e];this.setState({isCurrentContentSelected:i.isSelected}),this.setState({currentContent:i.guid}),this.setState({currentContentDetail:i}),o<r&&e===o-1&&this.onViewMore();var a=this.props.engines.detail.engine,s=this;this.setState({avatars:[],colors:[]},(0,p.Z)((function(){var e,t,n;return(0,y.__generator)(this,(function(o){return e=[],(t=a.features||[]).includes("selfieSearch")?(s.setState({loadingFaces:!0}),P().get("https://faces.api.".concat("prod"===_.env?"photohawk.com":"photohawk-staging.com","/detect?key=").concat(i.key)).then((function(t){var n=t.data.faces;0===n.length&&s.setState({loadingFaces:!1});var o=!0,r=!1,i=void 0;try{for(var a,c=n[Symbol.iterator]();!(o=(a=c.next()).done);o=!0){var l=a.value;e.push({src:l})}}catch(d){r=!0,i=d}finally{try{o||null==c.return||c.return()}finally{if(r)throw i}}e.length>0&&s.setState({avatars:e,loadingFaces:!1})})).catch((function(e){console.log(e),s.setState({loadingFaces:!1})}))):t.includes("colorSearch")&&(n=i.vehicles.map((function(e){return e.colourPercentages}))).length>0&&s.setState({colors:n[0].length>0}),[2]}))})))}},{key:"handleLightboxOpening",value:function(e){var t=this.contentArray()[e];this.setState({currentContentDetail:t})}},{key:"handleLightboxClosing",value:function(){this.setState({currentContentDetail:null}),document.addEventListener("contextmenu",bt)}},{key:"handleCollectionSelected",value:function(e){this.searchEngine({filters:{collections:[e]}})}},{key:"render",value:function(){var e=this,t=this.props.router.query,n="undefined"!==typeof t.preview,a=this.props.engines.detail,s=this.props,c=s.search,d=s.checkout,u=s.filters,p=s.classes,h=s.router,m=d.cart,g=c.content,f=c.videos,b=u.selected.timestamp_from||u.min_timestamp,y=u.selected.timestamp_to||u.max_timestamp,w=new Date(b).getTimezoneOffset();b+=w=60*w*1e3,y+=w;var v=g.rows,Z=v.total,C=0===v.globalTotal,k=0===f.rows.total,T=a.engine,S=!!["true",!0,void 0].includes(T.allowMultipleParticipants),P=T.collections||[];P=P.filter((function(e){var t="Default"===e.name,n=e.status||"Published";return!t&&"Published"===n})),this.state.collectionSearchValue.length>0&&(P=P.filter((function(t){return!!t.name&&(0,Ke.containsText)(t.name,e.state.collectionSearchValue)})));var _=T.defaultLocale||"en";if("en"!==_&&"undefined"!==typeof document){var E=new Date;E.setTime(E.getTime()+864e7),document.cookie="NEXT_LOCALE=".concat(_,";expires=").concat(E.toUTCString(),";path=/")}var D=T.features||[],L=T.authRequired||!1,A=this.state.authenticating&&L,F=![!0,!1].includes(T.allowBrowsing)||T.allowBrowsing,U=this.props.account.detail.account,ue=v.hits.length>0?this.contentArray():[],me=ue.filter((function(e){return e.vehicles&&e.vehicles.length>=1})).length>=1,ge=[];if(me){var fe=!0,xe=!1,ye=void 0;try{for(var we,Ee=ue[Symbol.iterator]();!(fe=(we=Ee.next()).done);fe=!0){var Ie=we.value.vehicles.map((function(e){return e.colourPercentages.map((function(e){return e.color}))}));ge=ge.concat(Ie)}}catch(Zt){xe=!0,ye=Zt}finally{try{fe||null==Ee.return||Ee.return()}finally{if(xe)throw ye}}ge=ge.filter((function(e,t){return ge.indexOf(e)===t}))}var De=D.includes("freeDownloads"),Ae=c.selected;if(T&&T.theme){var Oe="true"===T.customTheme||!0===T.customTheme,Re="grid"==T.collectionViewMode,Ge=P&&(P.length>1||this.state.collectionSearchValue.length>0)&&Re&&F&&D.includes("collectionSearch")&&0===u.selected.groups.length&&!u.selected.text&&!u.selected.selfie&&0===u.selected.groups.length&&!u.selected.requestId&&0===u.selected.collections.length,Fe=!(!(!Ge&&(u.selected.timestamp_from||u.selected.groups.length>0||u.selected.timestamp_to||u.selected.text||u.selected.requestId||u.selected.colors.length>0||u.selected.selfie)||Ge&&(u.selected.collections.length>0||u.selected.timestamp_from||u.selected.timestamp_to||u.selected.text||u.selected.groups.length>0||u.selected.selfie))||!c.loaded),We=T.productList||{},Be=(0,Ke.getSymbol)(We.currency),Ue=(T.products||[]).map((function(e){var t=e.name;return(0,r.Z)((0,o.Z)({},e),{group:t})})),Me=Ue.filter((function(e){return"Download"===e.type}));Me=(Me=(Me=Me.map((function(e){return e.group}))).filter((function(e,t){return Me.indexOf(e)===t}))).map((function(e){var t,n,o=Ue.filter((function(t){return t.group===e})),r=(t=Math).min.apply(t,(0,x.Z)(o.map((function(e){return parseFloat(e.price)})))),i=(n=Math).max.apply(n,(0,x.Z)(o.map((function(e){return parseFloat(e.price)}))));return{guid:o[0].guid,name:e,description:o[0].description,imageUrl:o[0].media.image,imageFit:o[0].mediaImageFit,type:o[0].type,sku:o[0].sku,resolution:o[0].resolution,fulfillment:o[0].fulfillment,requiresEditing:o[0].requiresEditing,includeWatermark:o[0].includeWatermark,showWatermarkInCart:o[0].showWatermarkInCart||!0,products:o,isUpgradable:o[0].isUpgradable,upgradeProductGuid:o[0].upgradeProductGuid,upgradeTitle:o[0].upgradeTitle,upgradeSubtitle:o[0].upgradeSubtitle,isFeatured:o.filter((function(e){return e.isFeatured})).length>0,featuredText:o[0].featuredText,requestAdditionalInfo:o.filter((function(e){return e.requestAdditionalInfo})).length>0,additionalInfoPlaceholder:o[0].additionalInfoPlaceholder,includeDownload:o[0].includeDownload,isAddOn:o.filter((function(e){return e.isAddOn})).length>0,volumeTiers:o[0].volumeTiers,pricingModel:o[0].pricingModel,fromPrice:r,toPrice:i}}));var He=Ue.filter((function(e){return"Video"===e.type}));He=(He=(He=He.map((function(e){return e.group}))).filter((function(e,t){return He.indexOf(e)===t}))).map((function(e){var t,n,o=Ue.filter((function(t){return t.group===e})),r=(t=Math).min.apply(t,(0,x.Z)(o.map((function(e){return parseFloat(e.price)})))),i=(n=Math).max.apply(n,(0,x.Z)(o.map((function(e){return parseFloat(e.price)}))));return{guid:o[0].guid,name:e,description:o[0].description,imageUrl:o[0].media.image,imageFit:o[0].mediaImageFit,type:o[0].type,sku:o[0].sku,resolution:o[0].resolution,fulfillment:o[0].fulfillment,requiresEditing:o[0].requiresEditing,includeWatermark:o[0].includeWatermark,showWatermarkInCart:o[0].showWatermarkInCart||!0,products:o,isUpgradable:o[0].isUpgradable,upgradeProductGuid:o[0].upgradeProductGuid,upgradeTitle:o[0].upgradeTitle,upgradeSubtitle:o[0].upgradeSubtitle,isFeatured:o.filter((function(e){return e.isFeatured})).length>0,featuredText:o[0].featuredText,requestAdditionalInfo:o.filter((function(e){return e.requestAdditionalInfo})).length>0,additionalInfoPlaceholder:o[0].additionalInfoPlaceholder,includeDownload:o[0].includeDownload,isAddOn:o.filter((function(e){return e.isAddOn})).length>0,volumeTiers:o[0].volumeTiers,pricingModel:o[0].pricingModel,fromPrice:r,toPrice:i}}));var ze=!1;1!==Me.length||De||(ze=Me[0]);var qe=Ue.filter((function(e){return"Print"===e.type}));qe=(qe=(qe=qe.map((function(e){return e.group}))).filter((function(e,t){return qe.indexOf(e)===t}))).map((function(e){var t,n,o=Ue.filter((function(t){return t.group===e})),r=(t=Math).min.apply(t,(0,x.Z)(o.map((function(e){return parseFloat(e.price)})))),i=(n=Math).max.apply(n,(0,x.Z)(o.map((function(e){return parseFloat(e.price)}))));return{guid:o[0].guid,name:e,description:o[0].description,imageUrl:o[0].media.image,imageFit:o[0].mediaImageFit,type:o[0].type,resolution:o[0].resolution,includeWatermark:o[0].includeWatermark,showWatermarkInCart:o[0].showWatermarkInCart||!0,fulfillment:o[0].fulfillment,requiresEditing:o[0].requiresEditing,sku:o[0].sku,products:o,isUpgradable:o[0].isUpgradable,upgradeProductGuid:o[0].upgradeProductGuid,upgradeTitle:o[0].upgradeTitle,upgradeSubtitle:o[0].upgradeSubtitle,isFeatured:o.filter((function(e){return e.isFeatured})).length>0,featuredText:o[0].featuredText,requestAdditionalInfo:o.filter((function(e){return e.requestAdditionalInfo})).length>0,additionalInfoPlaceholder:o[0].additionalInfoPlaceholder,includeDownload:o[0].includeDownload,isAddOn:o.filter((function(e){return e.isAddOn})).length>0,volumeTiers:o[0].volumeTiers,pricingModel:o[0].pricingModel,fromPrice:r,toPrice:i}})),Ue=Me.concat(qe);var Ve=(u.selected.images.length>0||u.selected.text)&&(Z>=1&&Z<=100||k>0)&&this.state.showWizard&&T.productListGuid&&!ze,Xe=this.props.theme,ct=null;U.media&&U.media.favicon&&(ct="".concat(U.media.favicon)),T.media&&T.media.favicon&&(ct="".concat(T.media.favicon));var pt=null,ht=null;T.media.featuredImage&&(ht="".concat(T.media.featuredImage)),(u.selected.images.length>0||u.selected.text)&&ue.length>0&&(ht=ue[0].thumbnail);var gt=ue.length>0&&Oe&&T.showFooter||U.showFooter,ft=U.googleAnalyticsTrackingId,bt=a.engine.welcomeText||"",yt=(bt=(0,_e.Z)(bt,{attributes:{style:"color: inherit;text-decoration:underline;"}}).replace(/\n/g,"<br>")).length>0&&!Fe&&(!C||!F),wt=(this.props.search.content.rows.total,this.props.search.content.rows.received,!!(T.products&&T.products.filter((function(e){return e.preOrder})).length>0)),vt="".concat(T.name," (").concat(U.companyName,")"),jt=T.description||vt;return this.props.engines.share.guid&&(vt="Check out these photos from ".concat(T.name,"!")),(0,i.jsxs)(l.Z,{theme:this.props.theme,children:[(0,i.jsxs)(Le(),{children:[(0,i.jsx)("title",{children:vt}),(0,i.jsx)("meta",{charSet:"utf-8"}),(0,i.jsx)("meta",{httpEquiv:"X-UA-Compatible",content:"IE=edge"}),(0,i.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1, shrink-to-fit=no"}),(0,i.jsx)("meta",{property:"type",content:"website"}),(0,i.jsx)("meta",{property:"og:type",content:"website"}),(0,i.jsx)("meta",{property:"title",content:vt}),(0,i.jsx)("meta",{property:"og:title",content:vt}),(0,i.jsx)("meta",{property:"og:site_name",content:vt}),(0,i.jsx)("meta",{name:"description",content:jt}),(0,i.jsx)("meta",{property:"og:description",content:jt}),(0,i.jsx)("link",{rel:"preconnect",href:"https://fonts.googleapis.com"}),(0,i.jsx)("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossorigin:!0}),(0,i.jsx)("link",{href:"https://fonts.googleapis.com/css2?family=Jersey+15&display=swap",rel:"stylesheet"}),(0,i.jsx)("script",{crossOrigin:"anonymous",src:"https://github.com/justadudewhohacks/face-api.js/blob/master/dist/face-api.js"}),ft&&(0,i.jsx)("script",{dangerouslySetInnerHTML:{__html:"\n            window.dataLayer = window.dataLayer || [];\n            function gtag(){dataLayer.push(arguments);}\n            gtag('js', new Date());\n            gtag('config', '".concat(ft,"', {\n              page_path: window.location.pathname,\n            });\n          ")}}),ct&&(0,i.jsx)("link",{rel:"icon",href:ct}),ht&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("meta",{property:"og:image:alt",content:vt}),(0,i.jsx)("meta",{property:"og:image",content:ht})]}),this.props.engines.share.images.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("meta",{property:"og:image:alt",content:this.props.engines.share.images[0].name}),(0,i.jsx)("meta",{property:"og:image",content:this.props.engines.share.images[0].image.thumbnail}),(0,i.jsx)("meta",{property:"og:image:height",content:630}),(0,i.jsx)("meta",{property:"og:image:width",content:1200})]})]}),(0,i.jsx)(at,{direction:this.state.productOptionsDirection,show:this.state.showProductOptions,checkoutLoading:this.props.checkout.loading,checkoutType:this.props.checkout.type,account:U,content:Ae,engine:T,downloads:Me,prints:qe,videos:He,cart:this.props.checkout.cart,getQuote:this.props.getPrintQuote,onOpenCart:this.props.openCart,onAddToCart:function(t){e.props.addToCart(t).then((function(){N.fn.success(e.props.i18n.t("ADDED_TO_CART"),e.props.i18n.t("CART_UPDATED"),1500),t.openCart?e.props.openCart():e.props.closeCart()}))},onFreeDownload:function(){return e.onDownload(Ae)},onRemoveFromCart:this.props.removeFromCart,onUpdateCartItem:function(t){e.props.updateCartItem(t).then((function(){N.fn.success(e.props.i18n.t("SELECTION_UPDATED"),e.props.i18n.t("CART_UPDATED"),1500),t.openCart?e.props.openCart():e.props.closeCart()}))},onOpen:function(){e.setState({showProductOptions:!0,productOptionsDirection:"left"})},onClose:function(){e.setState({showProductOptions:!1,productOptionsDirection:"up"})}}),Ve&&(0,i.jsx)(mt,{open:Ve,onClose:function(){return e.setState({showWizard:!1})},engine:T,cart:m,images:ue,title:this.props.i18n.t("SELECT_YOUR_PHOTOS"),total:this.props.search.content.rows.total,actions:[(0,i.jsx)(xt,{variant:"contained",endIcon:(0,i.jsx)(ve.Z,{}),disabled:0===Ae.length,onClick:function(){e.setState({showProductOptions:!0,productOptionsDirection:"left"})},children:this.props.i18n.t("SELECT_PRODUCT_BUTTON_TEXT")})],children:(0,i.jsxs)(W.Z,{container:!0,children:[(0,i.jsxs)(W.Z,{item:!0,xs:12,children:[D.includes("selfieSearch")&&!u.selected.selfie&&0===u.selected.images.length&&(0,i.jsx)(de.Z,{severity:"warning",icon:(0,i.jsx)(z.Z,{className:"fa-solid fa-face-viewfinder"}),children:this.props.i18n.t("SELFIE_RECOMMENDED_TEXT")}),this.showFeaturedBanners({symbol:Be,images:ue,products:Ue,selectedContent:Ae,classes:p})]}),(0,i.jsx)(W.Z,{item:!0,xs:12,children:this.showGallery({id:"refinerGallery",account:U,engine:T,filters:u,images:ue,classes:p,search:c,theme:Xe,router:h,defaultProduct:ze,selectedContent:Ae,textClass:null,downloads:Me,prints:qe,videoProducts:He,isFreeDownloads:De})})]})}),(0,i.jsxs)(q.Z,{className:p.paper,square:!0,children:[n&&(0,i.jsx)(V.Z,{position:"static",children:(0,i.jsx)(X.Z,{children:(0,i.jsx)(G.Z,{variant:"body1",className:p.title,children:'(Preview mode - change gallery status to "Published" before sharing this link)'})})}),T.published||n?(0,i.jsxs)(i.Fragment,{children:[pt,"false"!==t.header&&(0,i.jsx)(Je,{noPhotos:C,account:U,engine:T,position:"fixed",checkout:d,onOpenCart:this.props.openCart,loading:a.loading}),!L||this.state.authenticated||A?(0,i.jsxs)(i.Fragment,{children:[T.media.bannerMobile&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(M.Z,{smUp:!0,children:(0,i.jsx)("div",{align:"center",children:(0,i.jsx)("a",{target:"_blank",href:T.bannerUrl,children:(0,i.jsx)(I.Ee,{src:"".concat(T.media.bannerMobile)})})})})}),T.media.bannerDesktop&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(M.Z,{xsDown:!0,children:(0,i.jsx)("div",{align:"center",children:(0,i.jsx)("a",{target:"_blank",href:T.bannerUrl,children:(0,i.jsx)(I.Ee,{src:"".concat(T.media.bannerDesktop)})})})})}),"success"===this.props.router.query.checkoutResponse&&(0,i.jsx)(it,{orderGuid:this.props.router.query.guid,status:this.props.router.query.checkoutResponse,onClose:function(){}}),(this.props.content.downloading||this.props.content.downloads.length>0)&&(0,i.jsx)(rt,{addToCart:this.props.addToCart,openCart:this.props.openCart,selectedContent:Ae,highResolutionProduct:Ue.filter((function(t){return 0!==(T.freeDownloadResolution||0)&&T.productListGuid&&t.name===e.props.i18n.t("HIGH_RESOLUTION_DOWNLOAD")})),downloading:this.props.content.downloading,downloads:this.props.content.downloads,engineGuid:this.props.engines.detail.engine.guid,handleSubmit:this.props.sendFreeDownloads,onClose:function(){e.onClearSelection(),e.props.clearDownloads()}}),d.cart.open&&d.cart.items.length>0&&(0,i.jsx)(dt,{products:Ue,onFreeDownload:this.onDownload,highResDownloadProduct:Me.filter((function(t){return t.name===e.props.i18n.t("HIGH_RESOLUTION_DOWNLOAD")}))}),this.props.engines.share.images.length>0&&(0,i.jsx)(Ye,{images:this.props.engines.share.images}),(0,i.jsx)("div",{className:p.root,children:(0,i.jsxs)("div",{className:p.contentWrapper,children:[T.displayTitle&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("br",{}),(0,i.jsx)(G.Z,{variant:"h4",align:"center",children:T.name}),(0,i.jsx)("br",{})]}),!a.loading&&(D.indexOf("textSearch")>-1||D.indexOf("selfieSearch")>-1||D.indexOf("colorSearch")>-1)&&(0,i.jsx)(i.Fragment,{children:F&&(0,i.jsx)("div",{className:p.filtersArea,children:(0,i.jsx)(W.Z,{container:!0,spacing:2,children:(0,i.jsx)(W.Z,{item:!0,xs:12,children:(0,i.jsx)(R.Z,{startIcon:D.includes("selfieSearch")||D.includes("textSearch")?(0,i.jsx)(z.Z,{className:"fa-solid fa-face-viewfinder"}):(0,i.jsx)(je.Z,{}),style:{float:"right"},variant:"contained",color:"primary",onClick:function(){return e.setState({findMyPhotos:!0})},children:this.props.i18n.t("FIND_YOUR_PHOTOS")})})})})}),yt&&(0,i.jsxs)("div",{align:"center",children:[(0,i.jsx)("br",{}),(0,i.jsx)(G.Z,{component:"div",className:p.backgroundText,dangerouslySetInnerHTML:{__html:bt}}),(0,i.jsx)("br",{})]}),c.loading||c.loading&&!Ge||a.loading||A?(0,i.jsx)(Ne,{}):(0,i.jsxs)(W.Z,{container:!0,spacing:2,children:[(0,i.jsxs)(W.Z,{item:!0,xs:12,children:[this.showFeaturedBanners({symbol:Be,images:ue,products:Ue,selectedContent:Ae,classes:p}),(0,i.jsxs)(W.Z,{container:!0,spacing:2,children:[(0,i.jsxs)(W.Z,{item:!0,xs:12,children:[(0,i.jsx)("br",{}),(0,i.jsxs)("div",{style:{float:"right",width:"100%"},children:[this.props.router.query.page&&0===u.selected.collections.length&&F&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("br",{}),(0,i.jsx)(R.Z,{href:"/pages/".concat(this.props.router.query.page),className:p.backgroundText,size:"small",startIcon:(0,i.jsx)(Ze.Z,{}),children:this.props.i18n.t("GO_BACK")}),(0,i.jsx)("br",{}),(0,i.jsx)("br",{})]}),Re&&u.selected.collections.length>0&&F&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(R.Z,{style:{float:"left"},size:"small",className:p.backgroundText,startIcon:(0,i.jsx)(Ze.Z,{}),onClick:function(){e.props.updateFilters((0,r.Z)((0,o.Z)({},u.selected),{collections:[]})).then((function(){}))},children:this.props.i18n.t("BACK")}),"\xa0"]}),Fe&&(0,i.jsxs)(M.Z,{xsDown:!0,children:[(0,i.jsx)(R.Z,{style:{float:"left"},variant:"contained",size:"small",className:p.button,startIcon:(0,i.jsx)(Ce.Z,{}),onClick:this.onReset,children:this.props.i18n.t("RESET_BUTTON_TEXT")}),"\xa0"]})]})]}),!F&&(0,i.jsxs)(W.Z,{container:!0,alignItems:"center",justifyContent:"center",className:p.desktopSearchNav,children:[(0,i.jsx)(W.Z,{item:!0,xs:12,align:"center",children:(0,i.jsx)(R.Z,{variant:"contained",disableElevation:!0,color:"primary",size:"large",startIcon:D.includes("selfieSearch")?(0,i.jsx)(z.Z,{className:"fa-solid fa-face-viewfinder"}):(0,i.jsx)(je.Z,{}),onClick:function(){return e.setState({findMyPhotos:!e.state.findMyPhotos})},children:u.selected.images.length>0||u.selected.text?this.props.i18n.t("EDIT_MY_SEARCH"):this.props.i18n.t("FIND_YOUR_PHOTOS")})}),D.indexOf("timeSearch")>-1&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(W.Z,{item:!0,xs:12,align:"center",style:{margin:"1em"},children:this.props.i18n.t("OR")}),(0,i.jsx)(W.Z,{item:!0,xs:12,align:"center",children:(0,i.jsx)(nt,{mode:"button",buttonText:this.props.i18n.t("SELECT_TIME_RANGE"),from:b,to:y,searchIcon:(0,i.jsx)(je.Z,{color:"primary"}),closeIcon:(0,i.jsx)(ke.Z,{onClick:function(){e.props.updateFilters((0,r.Z)((0,o.Z)({},u.selected),{from_timestamp:null,to_timestamp:null,searchAfter:null})).then((function(){!Ge&&F&&e.searchEngine(),e.scrollToTop()}))},style:{color:Xe.palette.getContrastText("#fff")}}),onChange:function(t,n){console.log("Selected ".concat(new Date(t).getHours(),":").concat(new Date(t).getMinutes()));var i=new Date(t).getTimezoneOffset();console.log("".concat(i>0?"Add":"Remove"," ").concat(i/60," hours")),t-=i=60*i*1e3,n-=i,console.log("".concat(new Date(t).getHours(),":").concat(new Date(t).getMinutes())),e.props.updateFilters((0,r.Z)((0,o.Z)({},u.selected),{timestamp_from:t,timestamp_to:n,offset:i}))},onSearch:function(){e.searchEngine()},onCancel:this.onReset})})]})]})]}),Ge&&(0,i.jsxs)(i.Fragment,{children:[a.engine.helpText&&a.engine.helpText.length>0&&(0,i.jsx)("div",{align:"right",style:{width:"100%"},children:(0,i.jsx)($e,{text:a.engine.helpText})}),(0,i.jsxs)(W.Z,{container:!0,spacing:2,children:[(P.length>1||this.state.collectionSearchValue.length>0)&&(0,i.jsx)(W.Z,{item:!0,xs:12,children:(0,i.jsx)(O.Z,{className:p.searchBar,placeholder:"Search folder names...",value:this.state.collectionSearchValue,onChange:function(t){e.setState({collectionSearchValue:t})},onRequestSearch:function(t){e.setState({collectionSearchValue:t})},onCancelSearch:function(){e.setState({collectionSearchValue:""})}})}),P.map((function(t,n){var o=Ae.filter((function(e){return e.collectionGuid===t.guid}));return(0,i.jsx)(W.Z,{item:!0,container:!0,alignItems:"center",direction:"column",xs:12,sm:6,md:4,children:(0,i.jsxs)(ae.Z,{className:p.card,children:[(0,i.jsx)(le.Z,{className:p.cardHeader,title:t.name,titleTypographyProps:{variant:"h6"},onClick:function(){return e.handleCollectionSelected(t.guid)}}),(0,i.jsx)(le.Z,{className:p.cardSubHeader,subheader:"".concat((t.noItems||0).toLocaleString()," ").concat(1===(t.noItems||0)?"photo":"photos")}),("undefined"===typeof T.showCollectionGridImages||T.showCollectionGridImages)&&(0,i.jsx)(se.Z,{className:p.cardMedia,style:{height:T.collectionGridImageHeight||185},image:t.media.featuredImage?"".concat(t.media.featuredImage):"/images/thumbnail-default.png",title:t.name,onClick:function(){return e.handleCollectionSelected(t.guid)}}),(0,i.jsxs)(ce.Z,{children:[(0,i.jsx)(R.Z,{size:"small",color:"primary",onClick:function(){return e.handleCollectionSelected(t.guid)},children:e.props.i18n.t("OPEN")}),o.length>0&&(0,i.jsx)(ut,{content:o,onRemove:function(t){e.props.selectContent(t)}})]})]})},n)}))]})]}),c.loaded&&!Ge&&!this.state.searching&&!c.loading&&u.selected.groups.length>0&&0===ue.length&&k&&(0,i.jsxs)("div",{align:"center",children:[(0,i.jsx)("br",{}),(0,i.jsx)(G.Z,{className:p.backgroundText,children:this.props.i18n.t("NO_MATCHES_TEXT")}),(0,i.jsx)("br",{})]}),F&&k&&C&&c.loaded&&!c.loading&&!Ge&&!this.state.searching&&!Fe&&(0,i.jsxs)("div",{align:"center",children:[(0,i.jsx)("br",{}),(0,i.jsx)(G.Z,{className:p.backgroundText,children:this.props.i18n.t("NO_PHOTOS_YET")}),D.includes("collectSubscribers")&&(0,i.jsxs)(G.Z,{className:p.backgroundText,children:[this.props.i18n.t("PLEASE_SUBSCRIBE_WHEN_PHOTOS_READY"),(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),(0,i.jsx)(st,{engine:T,images:[],callbackStatus:this.props.router.query.subscribeStatus,onClose:function(){}})]}),(0,i.jsx)("br",{})]}),(ue.length>0||f.rows.hits.length>0)&&!Ge&&(0,i.jsx)(i.Fragment,{children:!Ve&&this.showGallery({id:"browsingGallery",account:U,engine:T,filters:u,images:ue,classes:p,search:c,theme:Xe,router:h,defaultProduct:ze,selectedContent:Ae,textClass:p.backgroundText,downloads:Me,prints:qe,videoProducts:He,isFreeDownloads:De})})]}),(0,i.jsx)(W.Z,{container:!0,spacing:0,children:(0,i.jsxs)(W.Z,{item:!0,xs:12,align:"center",children:[c.loadingMore&&(0,i.jsx)(oe.Z,{size:30}),gt&&!1,this.state.scrollLimitExceeded&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(G.Z,{variant:"h4",className:p.textClass,children:this.props.i18n.t("SCROLL_LIMIT_EXCEEDED_TEXT")})})]})})]})]})}),(0,i.jsx)("div",{className:p.floatingButtons,children:Ae.length>0&&(T.productListGuid||De)&&!ze&&(0,i.jsx)(B.ZP,{title:De?this.props.i18n.t("DOWNLOAD"):this.props.i18n.t("ADD_TO_CART"),children:(0,i.jsxs)(K.Z,{className:(0,j.Z)(p.floatingButton,p.floatingShowProductsButton),size:"large",variant:"contained",color:"primary",onClick:T.productListGuid?function(){return e.setState({showProductOptions:!0,productOptionsDirection:"up"})}:function(){return e.onDownload(Ae)},children:[!De&&(0,i.jsx)(Te.Z,{}),De&&(0,i.jsx)(be.Z,{})]})})}),(0,i.jsx)("div",{className:p.bottomNav,children:(0,i.jsxs)(pe.Z,{value:this.state.newValue,onChange:function(t,n){e.setState({navItem:n})},showLabels:!0,className:p.bottomNavIcons,children:[Fe&&(0,i.jsx)(he.Z,{className:p.bottomNavActions,label:this.props.i18n.t("RESET_BUTTON_TEXT"),onClick:this.onReset,icon:(0,i.jsx)(Ce.Z,{})}),(0,i.jsx)(he.Z,{className:p.bottomNavActions,label:u.selected.images.length>0||u.selected.text?this.props.i18n.t("EDIT_MY_SEARCH"):this.props.i18n.t("FIND_YOUR_PHOTOS"),onClick:function(){e.setState({findMyPhotos:!e.state.findMyPhotos})},icon:u.selected.selfie?(0,i.jsx)(H.Z,{style:{width:30,height:30},src:u.selected.selfie}):D.includes("selfieSearch")?(0,i.jsx)(z.Z,{color:"inherit",className:"fa-solid fa-face-viewfinder"}):(0,i.jsx)(je.Z,{})}),T.productListGuid&&(0,i.jsx)(he.Z,{label:this.props.i18n.t("PRICE_LIST"),className:p.bottomNavActions,icon:(0,i.jsx)(Se.Z,{onClick:function(){return e.setState({showProductOptions:!0,productOptionsDirection:"up"})},color:"inherit"}),onClick:function(){return e.setState({showProductOptions:!0,productOptionsDirection:"up"})}}),d.cart.items.length>0&&(0,i.jsx)(he.Z,{className:p.bottomNavActions,label:this.props.i18n.t("VIEW_CART"),onClick:function(){e.props.openCart()},icon:(0,i.jsx)(Y.Z,{badgeContent:"".concat(Be).concat(parseFloat(d.cart.total).toFixed(2)),color:"error",children:(0,i.jsx)(Pe.Z,{color:"inherit"})})})]})}),(0,i.jsx)($.ZP,{anchor:"right",open:this.state.filtersOpen,onClose:function(){return e.toggleDrawer(!1)},children:(0,i.jsx)("div",{className:p.filtersList,role:"presentation",children:(0,i.jsxs)(J.Z,{children:[me&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Q.Z,{children:(0,i.jsx)(W.Z,{item:!0,xs:12,children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ee.Z,{id:"colours",children:"Colours"}),(0,i.jsx)(te.Z,{fullWidth:!0,displayEmpty:!0,multiple:!0,label:"Colour",name:"colors",labelId:"colors",id:"colors",value:u.selected.colors,onChange:function(t){e.props.updateFilters((0,r.Z)((0,o.Z)({},u.selected),{colors:t.target.value})).then((function(){e.searchEngine()}))},renderValue:function(){return u.selected.colors.join(", ")},MenuProps:{PaperProps:{style:{maxHeight:296,width:350,minWidth:350,maxWidth:350}}},children:["black","blue","grey","white","red","yellow"].map((function(e){return(0,i.jsxs)(ne.Z,{value:e,children:[(0,i.jsx)(re.Z,{color:"primary",checked:u.selected.colors.indexOf(e)>-1}),(0,i.jsx)(ie.Z,{primary:"".concat(e)})]},e)}))})]})})})}),D.indexOf("collectionSearch")>-1&&(0,i.jsx)(Q.Z,{children:(0,i.jsx)(W.Z,{item:!0,xs:12,children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ee.Z,{id:"collections",children:T.collectionAlias||"Zone"}),(0,i.jsx)(te.Z,{fullWidth:!0,displayEmpty:!0,multiple:!0,label:T.collectionAlias&&T.collectionAlias.length>0?T.collectionAlias:"Zone",name:"collections",labelId:"collections",id:"collections",value:u.selected.collections,onChange:function(t){var n=t.target.value.filter((function(e){return null!==e}));e.searchEngine({filters:{collections:n}})},renderValue:function(){return T.collections.filter((function(e){return u.selected.collections.indexOf(e.guid)>-1})).map((function(e){return e.name})).join(", ")},MenuProps:{PaperProps:{style:{maxHeight:296,width:350,minWidth:350,maxWidth:350}}},children:P.map((function(e){return(0,i.jsxs)(ne.Z,{value:e.guid,children:[(0,i.jsx)(re.Z,{color:"primary",checked:u.selected.collections.indexOf(e.guid)>-1}),(0,i.jsx)(ie.Z,{primary:"".concat(e.name)})]},e.guid)}))})]})})}),D.indexOf("timeSearch")>-1&&(0,i.jsx)(Q.Z,{children:(0,i.jsxs)(W.Z,{item:!0,xs:12,children:[(0,i.jsx)(ee.Z,{id:"time",children:this.props.i18n.t("TIME")}),(0,i.jsx)(ot,{from:b,to:y,fullWidth:!0,onChange:function(t,n){console.log("Selected ".concat(new Date(t).getHours(),":").concat(new Date(t).getMinutes()));var i=new Date(t).getTimezoneOffset();console.log("".concat(i>0?"Add":"Remove"," ").concat(i/60," hours")),t-=i=60*i*1e3,n-=i,console.log("".concat(new Date(t).getHours(),":").concat(new Date(t).getMinutes())),e.props.updateFilters((0,r.Z)((0,o.Z)({},u.selected),{timestamp_from:t,timestamp_to:n,offset:i}))}})]})}),(0,i.jsx)(Q.Z,{children:(0,i.jsx)(R.Z,{color:"primary",style:{width:"100%"},variant:"contained",onClick:function(){e.toggleDrawer(!1),e.searchEngine()},children:this.props.i18n.t("APPLY_FILTERS")})})]})})}),!D.includes("colorSearch")&&u.selected.groups.length>0&&D.includes("textSearch")?(0,i.jsx)(tt,{mode:"icon",selfie:u.selected.selfie,groups:u.selected.groups,bib:u.selected.text||"",colors:u.selected.colors,helmetColors:u.selected.helmetColors,open:this.state.findMyPhotos,onClose:function(){return e.setState({findMyPhotos:!1})},engine:T,allowMultipleParticipants:S,images:u.selected.images,onGroupPhotoUploaded:this.props.getFacesInPhoto,onFinish:function(t){var n=t.groups,o=t.bib,r=t.selfie,i=t.colors,a=t.helmetColors;e.searchEngine({filters:{collections:[],groups:n||[],selfie:r,text:o,colors:i||[],helmetColors:a||[],images:r?u.selected.images:[]}}),e.scrollToTop()}}):(0,i.jsx)(et,{mode:"icon",selfie:u.selected.groups.length>0?u.selected.groups[0].selfie:u.selected.selfie,bib:u.selected.text||"",colors:u.selected.colors,helmetColors:u.selected.helmetColors,open:this.state.findMyPhotos,onClose:function(){return e.setState({findMyPhotos:!1})},engine:T,allowMultipleParticipants:S,onFacesDetected:function(t){e.searchEngine({filters:{groups:t}})},onGroupPhotoUploaded:this.props.getFacesInPhoto,images:u.selected.images,onFinish:function(t){t.groups;var n=t.bib,o=t.selfie,r=t.colors,i=t.helmetColors;e.searchEngine({filters:{collections:[],groups:[{selfie:o,text:n}],selfie:o,text:n,colors:r||[],helmetColors:i||[],images:o?u.selected.images:[]}}),e.scrollToTop()}})]}):(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(lt,{engine:T})}),gt&&(0,i.jsx)(Qe,{account:U,engine:T})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),(0,i.jsx)(W.Z,{container:!0,spacing:0,justifyContent:"center",alignItems:"center",children:(0,i.jsxs)(W.Z,{item:!0,xs:10,sm:6,md:4,children:[(0,i.jsx)(G.Z,{className:p.notReadyHeader,variant:"h3",align:"center",children:T.name}),(0,i.jsx)("br",{}),(0,i.jsx)(G.Z,{className:p.notReadySubscribeText,variant:"body1",align:"center",children:this.props.i18n.t("NOT_READY_YET")}),(wt||D.includes("collectSubscribers"))&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("br",{}),(0,i.jsx)(G.Z,{className:p.notReadySubscribeText,variant:"body1",align:"center",children:this.props.i18n.t("NOT_READY_YET_TEXT")}),(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),(0,i.jsx)(st,{engine:T,open:wt,images:[],callbackStatus:this.props.router.query.subscribeStatus,onClose:function(){}})]}),this.getLogo(T,U)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),(0,i.jsx)("div",{align:"center",children:(0,i.jsx)("img",{src:this.getLogo(T,U),style:{width:"80%"}})})]})]})})]})]})]})}}}]),a}(a.Component),wt=(0,C.Z)((function(e){var t;return t={root:(0,g.Z)({backgroundColor:e.palette.background.default,color:e.palette.background.text||"grey",maxWidth:e.layout.contentWidth,width:"100%",margin:"0 auto",padding:e.spacing(0,1),paddingBottom:"100px"},e.breakpoints.up("sm"),{padding:e.spacing(0,1)}),coverContainer:{backgroundPosition:"center center",backgroundRepeat:"no-repeat",backgroundSize:"cover",position:"relative",height:"100vh",width:"100vw"},searchBar:{marginBottom:e.spacing(2)},coverImageContainer:{position:"absolute",top:0,right:0,bottom:0,left:0,"&:after":{position:"absolute",zIndex:1,bottom:0,left:0,height:"300px",width:"100%",content:" ",display:"block",background:"linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(0, 0, 0, 0) 5%, rgba(0, 0, 0, 0.08) 45%, rgba(0, 0, 0, 0.5) 90%, rgba(0, 0, 0, 0.7) 100%)",transition:"all 100ms ease-out"}},coverDetail:{width:"100%",textAlign:"center",color:"#fff",position:"absolute",top:"50%",zIndex:"9",transform:"translateY(-50%)"},coverDetailButton:{color:"white",borderColor:"white",marginTop:"40px"},coverImage:{display:"block",position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",objectFit:"cover",objectPosition:"center center"},card:{minWidth:"100%",maxWidth:345},cardHeader:{minHeight:95,maxHeight:95,cursor:"pointer"},cardSubHeader:{paddingBottom:8,paddingTop:8},cardMedia:{cursor:"pointer"},videoCard:{},videoCardMedia:{minHeight:225,backgroundColor:"#333"},videoCardActions:{width:"100%",float:"right",position:"relative",display:"block"},mediaPlayIcon:{cursor:"pointer",width:100,height:100,fill:"white",position:"absolute",top:0,left:0,bottom:0,right:0,margin:"auto"},videoAddToCartButton:{float:"right"},backgroundText:{color:e.palette.background.text||"grey"},buttonSelect:{color:"white",height:24,width:24},buttonRemove:{color:"rgb(66, 133, 244)",height:24,width:24},downloadIcon:{color:"white"},paper:{backgroundColor:e.palette.background.default,margin:"auto",minHeight:"100vh"},contentWrapper:{backgroundColor:e.palette.background.default},gallery:{},galleryLoading:{opacity:.6,backgroundColor:e.palette.background.default}},(0,g.Z)(t,"searchBar",{width:"100%"}),(0,g.Z)(t,"socialMediaPopper",{top:"300px  !important",left:"unset !important",right:"0px !important",display:"grid"}),(0,g.Z)(t,"socialMediaButton",{"&:hover > svg":{height:"40px !important",width:"40px !important"}}),(0,g.Z)(t,"notReadyHeader",{color:e.palette.background.text||"grey",fontWeight:900}),(0,g.Z)(t,"notReadySubscribeText",{color:e.palette.background.text||"grey"}),(0,g.Z)(t,"featuredProductBanner",{cursor:"pointer",marginBottom:5}),(0,g.Z)(t,"featuredAlertTitle",{fontWeight:700}),(0,g.Z)(t,"featuredButton",{color:"white"}),(0,g.Z)(t,"floatingButtons",{position:"fixed",zIndex:1e3,bottom:100}),(0,g.Z)(t,"floatingButton",(0,g.Z)({bottom:100,"&:nth-child(2)":{bottom:170}},e.breakpoints.up("sm"),{bottom:e.spacing(2),"&:nth-child(2)":{bottom:e.spacing(10)}})),(0,g.Z)(t,"floatingShowProductsButton",{position:"fixed",right:e.spacing(2),zIndex:3e3,background:T.Z[500],"&:hover":{background:T.Z[700]}}),(0,g.Z)(t,"floatingOpenCartButton",{position:"fixed",right:e.spacing(2),zIndex:3e3}),(0,g.Z)(t,"bottomNavTitle",{padding:e.spacing(.5,2),backgroundColor:e.palette.background.default||"white",color:e.palette.background.text||"grey"}),(0,g.Z)(t,"desktopSearchNav",(0,g.Z)({margin:"1em"},e.breakpoints.up("sm"),{display:"block"})),(0,g.Z)(t,"bottomNav",(0,g.Z)({backgroundColor:e.palette.background.default||"white",position:"fixed",zIndex:1e3,bottom:0,width:"100%",padding:e.spacing(1),paddingBottom:e.spacing(1.5),color:e.palette.background.text||"grey"},e.breakpoints.up("sm"),{display:"none"})),(0,g.Z)(t,"bottomNavIcons",{backgroundColor:e.palette.background.default||"white",color:e.palette.background.text||"grey"}),(0,g.Z)(t,"bottomNavActions",{color:e.palette.background.text||"grey"}),(0,g.Z)(t,"filtersArea",(0,g.Z)({display:"none"},e.breakpoints.up("sm"),{display:"block"})),(0,g.Z)(t,"filtersList",(0,g.Z)({width:"60vw"},e.breakpoints.up("sm"),{width:"30vw"})),t}))((0,c.withRouter)((0,s.$j)((function(e){return{account:e.account,engines:e.engines,search:e.search,filters:e.filters,content:e.content,checkout:e.checkout}}),ft)((0,Z.Z)(yt)))),vt=(0,c.withRouter)((0,s.$j)((function(e){return{engines:e.engines,account:e.account}}))((function(e){var t,n=e.engines.detail.engine,a=e.account.detail.account;return t="true"===n.customTheme||!0===n.customTheme?(0,d.Z)((0,r.Z)((0,o.Z)({},n.theme),{typography:(0,r.Z)((0,o.Z)({},n.theme.typography),{subtitle1:(0,r.Z)((0,o.Z)({},n.theme.typography.subtitle1),{fontFamily:n.theme.typography.fontFamily}),subtitle2:(0,r.Z)((0,o.Z)({},n.theme.typography.subtitle2),{fontFamily:n.theme.typography.fontFamily})}),palette:(0,r.Z)((0,o.Z)({},n.theme.palette),{background:(0,r.Z)((0,o.Z)({},n.theme.palette.background),{default:n.theme.palette.background.default}),primary:{main:n.theme.palette.primary.main,light:n.theme.palette.primary.main,dark:n.theme.palette.primary.main,contrastText:n.theme.palette.primary.contrastText},secondary:{main:n.theme.palette.secondary.main,light:n.theme.palette.secondary.main,dark:n.theme.palette.secondary.main,contrastText:n.theme.palette.secondary.contrastText}}),mediaLogoWidth:n.mediaLogoWidth})):(0,d.Z)((0,r.Z)((0,o.Z)({},a.theme),{palette:(0,r.Z)((0,o.Z)({},a.theme.palette),{background:(0,r.Z)((0,o.Z)({},a.theme.palette.background),{default:a.theme.palette.background.default}),primary:{main:a.theme.palette.primary.main,light:a.theme.palette.primary.main,dark:a.theme.palette.primary.main,contrastText:a.theme.palette.primary.contrastText},secondary:{main:a.theme.palette.secondary.main,light:a.theme.palette.secondary.main,dark:a.theme.palette.secondary.main,contrastText:a.theme.palette.secondary.contrastText}}),mediaLogoWidth:a.mediaLogoWidth})),(0,i.jsx)(l.Z,{theme:t,children:(0,i.jsx)(wt,{theme:t})})}))),jt=n(83440),Zt=function(e){(0,f.Z)(n,e);var t=(0,b.Z)(n);function n(e){return(0,h.Z)(this,n),t.call(this,e)}return(0,m.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.classes,n=(e.loading,e.engine),o=e.account,r=(e.checkout,this.props.router.query.library||null),a="/galleries/".concat(n.slug);if(o.webUrl&&"grid"!==n.collectionViewMode&&(a=o.webUrl),r&&(a="/library/".concat(r)),!n.guid)return(0,i.jsx)(i.Fragment,{});var s=n.productList||{},c=((0,Ke.getSymbol)(s.currency),"true"===n.customTheme||!0===n.customTheme),l=n.PK?n.PK.substring(n.PK.indexOf("#")+1):"",d=!1;return d=c?!!n.media.logo&&"".concat(n.media.logo):!!o.mediaLogoGuid&&"".concat(_.cdn.endpoint,"/media/").concat(l,"/").concat(o.mediaLogoName),(0,i.jsx)("div",{className:t.root,children:(0,i.jsxs)(X.Z,{id:"topbar",disableGutters:!0,className:t.toolbar,children:[n.guid&&Object.keys(n).length>0&&d&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("div",{className:t.logoContainer,children:(0,i.jsx)("a",{href:a,children:(0,i.jsx)(I.Ee,{className:t.logoImage,src:d,lazy:!1})})})}),n.guid&&Object.keys(n).length>0&&!d&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(G.Z,{className:t.companyName,children:o.companyName})}),(0,i.jsx)("div",{className:t.flexGrow})]})})}}]),n}(a.PureComponent),Ct=(0,C.Z)((function(e){var t;return{root:{backgroundColor:e.palette.background.default},companyName:{color:e.palette.background.text},flexGrow:{flexGrow:1},navigationContainer:{display:"flex",justifyContent:"space-between",alignItems:"center"},toolbar:(0,g.Z)({backgroundColor:e.palette.background.default,zIndex:98,maxWidth:e.layout.contentWidth,top:0,left:0,right:0,margin:"0 auto",padding:e.spacing(0,2)},e.breakpoints.up("sm"),{padding:e.spacing(0,2)}),navLink:{"&:hover":{color:e.palette.primary.dark}},listItem:{cursor:"pointer","&:hover > .menu-item, &:hover svg":{color:e.palette.primary.dark},"&.menu-item--no-dropdown":{paddingRight:0}},listItemActive:{"&> .menu-item":{color:e.palette.primary.dark}},listItemText:{flex:"0 0 auto",marginRight:e.spacing(2),whiteSpace:"nowrap"},listItemButton:{whiteSpace:"nowrap"},listItemIcon:{minWidth:"auto"},popover:{padding:e.spacing(4),border:e.spacing(2),boxShadow:"0 0.5rem 2rem 2px rgba(116, 123, 144, 0.09)",minWidth:350,marginTop:e.spacing(2)},iconButton:{marginLeft:e.spacing(2),padding:0,"&:hover":{background:"transparent"}},expandOpen:{transform:"rotate(180deg)",color:e.palette.primary.dark},logoContainer:(t={padding:"6px",width:"".concat(e.mediaLogoWidth,"px")||0,maxWidth:280},(0,g.Z)(t,e.breakpoints.up("md"),{maxWidth:450}),(0,g.Z)(t,e.breakpoints.up("lg"),{maxWidth:750}),t),cartIcon:(0,g.Z)({visibility:"hidden"},e.breakpoints.up("sm"),{visibility:"visible"}),logoImage:{width:"100%",height:"100%"},menu:{display:"flex",justifyContent:"space-between"},menuItem:{marginRight:e.spacing(5),"&:last-child":{marginRight:0}},menuGroupItem:{paddingTop:0},menuGroupTitle:{textTransform:"uppercase"}}}))((0,c.withRouter)(Zt)),kt=n(17405),Tt=n(38082),St=n(37308),Pt=n(33199),_t=n(82198),Et=n(28210),It=function(e){var t=e.engineGuid,n=e.collectionGuid,s=(0,kt.Z)(a.useState(null),2),c=s[0],l=s[1],d=(0,kt.Z)(a.useState(null),2),u=d[0],h=d[1],m=e.accept||"image/jpeg",g=(0,Tt.u)({accept:m,chunking:!0,chunkSize:1e7,onDrop:function(){var o=(0,p.Z)((function(o){var r,i,a,s,c;return(0,y.__generator)(this,(function(l){switch(l.label){case 0:return[4,e.onLoadContent({context:{guid:n},files:o})];case 1:r=l.sent(),c=10,i=0,a=r.length,l.label=2;case 2:return i<a?(s=r.slice(i,i+c),[4,e.onBeginUpload({engineGuid:t,collectionGuid:n,folder:u,files:s})]):[3,5];case 3:l.sent(),l.label=4;case 4:return i+=c,[3,2];case 5:return[2]}}))}));return function(e){return o.apply(this,arguments)}}()}),f=g.getRootProps,x=g.getInputProps,b=e.files.map((function(e){return{Name:e.path,Status:e.uploading?"Uploading... (".concat(((e.loaded||0)/e.size*100).toFixed(2),"%)"):e.uploaded?"Completed":"Waiting...",Size:(e.size/1e6).toFixed(2)}}));return(0,i.jsxs)(W.Z,{container:!0,spacing:2,children:[!u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(W.Z,{item:!0,xs:12,children:(0,i.jsx)(G.Z,{variant:"h6",children:"Please enter your name (or business name)"})}),(0,i.jsx)(W.Z,{item:!0,xs:12,children:(0,i.jsx)(_t.Z,{label:"Name",variant:"outlined",defaultValue:c,onChange:function(e){return l(e.target.value)},fullWidth:!0})}),(0,i.jsx)(W.Z,{item:!0,xs:12,children:(0,i.jsx)(Et.h,{disabled:!c,variant:"contained",style:{float:"right"},endIcon:(0,i.jsx)(ve.Z,{}),onClick:function(){return h(c)},children:"Next"})})]}),u&&0===e.files.length&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(W.Z,{item:!0,xs:12,children:(0,i.jsx)(G.Z,{variant:"h6",children:"Upload your photos"})}),(0,i.jsx)(W.Z,{item:!0,xs:12,children:(0,i.jsx)(de.Z,{severity:"info",children:"Format (JPG) / Max file size (5mb)"})}),(0,i.jsx)(W.Z,{item:!0,xs:12,children:(0,i.jsxs)("div",(0,r.Z)((0,o.Z)({},f({className:"dropzone"})),{style:{height:"500px"},children:[(0,i.jsx)("input",(0,o.Z)({},x())),(0,i.jsx)("p",{children:"Drag & drop photos or click here"})]}))})]}),u&&e.files.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(W.Z,{item:!0,xs:12,children:(0,i.jsx)(G.Z,{variant:"h6",children:"Please wait whilst they are uploaded"})}),(0,i.jsxs)(W.Z,{item:!0,xs:12,children:[(0,i.jsx)(St.Z,{progress:e.progress,height:6,color:"lightgreen"}),(0,i.jsx)(Pt.ZP,{responsive:!0,columns:[{name:"Filename",selector:"Name",grow:3,sortable:!0},{name:"Status",selector:"Status",grow:2,sortable:!0},{name:"Size (mb)",selector:"Size",grow:1,sortable:!0}],data:b,keyField:"guid",striped:!0,allowOverflow:!0,overflowX:!0,noHeader:!0,pagination:!0,paginationPerPage:5,paginationRowsPerPageOptions:[5,10,50,100]})]})]}),e.files.length>0&&100===e.progress&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(W.Z,{item:!0,xs:12,children:(0,i.jsx)(Et.h,{onClick:function(){e.onReset(),l(null),h(null)},endIcon:(0,i.jsx)(ve.Z,{}),style:{float:"right"},children:"Finish"})})})]})},Nt={captureAction:Xe,openCart:Ae.LA,closeCart:Ae.Ee,clearCart:Ae.LL,addToCart:Ae.aJ,removeFromCart:Ae.GR,updateCartItem:Ae.bd,searchEngine:We.yC,searchEngineByImage:We.s6,selectContent:Be,selectAllContent:Ue,clearSelection:Me,updateFilters:He,download:Ge,clearDownloads:Fe,fetchOrder:ze.h,loadContent:function(e){return function(t){return new Promise((function(n,o){t({type:Oe.HAj,payload:{collection_guid:e.collection_guid,files:e.files}}),n(e.files)}))}},beginUpload:function(e){return function(t){return new Promise((function(n,o){var r=e.files;t({type:Oe.fXd,payload:{collection_guid:e.collection_guid,files:e.files}}),P().post("/content",{engineGuid:e.engineGuid,collectionGuid:e.collection_guid,folder:e.folder,files:r,hostname:window.location.hostname}).then(function(){var o=(0,p.Z)((function(o){var r;return(0,y.__generator)(this,(function(i){switch(i.label){case 0:return r=o.data.upload.urls,[4,Re(r,function(){var n=(0,p.Z)((function(n,o){var r;return(0,y.__generator)(this,(function(i){switch(i.label){case 0:return r=e.files[o],t({type:Oe.rAQ,payload:{url:n,content:r}}),[4,P().put(n,r,{"Content-Type":r.type,onUploadProgress:function(e){t({type:Oe.zrb,payload:{content:r,loaded:e.loaded}})}})];case 1:return i.sent(),t({type:Oe.mV5,payload:{url:n,content:r}}),[2]}}))}));return function(e,t){return n.apply(this,arguments)}}())];case 1:return i.sent(),n(),[2]}}))}));return function(e){return o.apply(this,arguments)}}())}))}},resetUpload:function(){return function(e){e({type:Oe.LxP,payload:{}})}},cancelUpload:function(){return function(e){e({type:Oe.fbo,payload:{}})}}},Dt=((0,C.Z)((function(e){return{root:{color:"white",backgroundColor:T.Z[500],"&:hover":{backgroundColor:T.Z[700]}}}}))(R.Z),function(e){(0,f.Z)(n,e);var t=(0,b.Z)(n);function n(e){var o;return(0,h.Z)(this,n),(o=t.call(this,e)).state={},o}return(0,m.Z)(n,[{key:"componentDidMount",value:function(){return(0,p.Z)((function(){return(0,y.__generator)(this,(function(e){return[2]}))}))()}},{key:"getLogo",value:function(e,t){var n="true"===e.customTheme||!0===e.customTheme,o=e.PK?e.PK.substring(e.PK.indexOf("#")+1):"";return n?e.media.logo?"".concat(e.media.logo):null:t.mediaLogoGuid?"".concat(_.cdn.endpoint,"/media/").concat(o,"/").concat(t.mediaLogoName):null}},{key:"render",value:function(){var e=this.props.content.create.content,t=this.props.router.query,n=this.props.engines.detail,o=this.props,r=o.search,a=o.checkout,s=o.classes,c=0===r.content.rows.globalTotal,d=n.engine,u=d.defaultLocale||"en";if("en"!==u&&"undefined"!==typeof document){var p=new Date;p.setTime(p.getTime()+864e7),document.cookie="NEXT_LOCALE=".concat(u,";expires=").concat(p.toUTCString(),";path=/")}var h=d.name,m=this.props.account.detail.account;if(d&&d.theme){var g=null;d.media&&d.media.favicon&&(g="".concat(d.media.favicon));var f=null;return d.media.featuredImage&&(f="".concat(d.media.featuredImage)),(0,i.jsxs)(l.Z,{theme:this.props.theme,children:[(0,i.jsxs)(Le(),{children:[(0,i.jsx)("title",{children:h}),(0,i.jsx)("meta",{charSet:"utf-8"}),(0,i.jsx)("meta",{httpEquiv:"X-UA-Compatible",content:"IE=edge"}),(0,i.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1, shrink-to-fit=no"}),(0,i.jsx)("meta",{property:"type",content:"website"}),(0,i.jsx)("meta",{property:"og:type",content:"website"}),(0,i.jsx)("meta",{property:"title",content:h}),(0,i.jsx)("meta",{property:"og:title",content:h}),(0,i.jsx)("meta",{property:"og:site_name",content:h}),g&&(0,i.jsx)("link",{rel:"icon",href:g}),f&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("meta",{property:"og:image:alt",content:h}),(0,i.jsx)("meta",{property:"og:image",content:f})]})]}),(0,i.jsxs)(q.Z,{id:"searchRoot",className:s.paper,square:!0,children:["false"!==t.header&&(0,i.jsx)(Ct,{noPhotos:c,account:m,engine:d,checkout:a,onOpenCart:this.props.openCart,loading:n.loading}),(0,i.jsx)("div",{id:"content",children:(0,i.jsx)("div",{className:s.root,children:(0,i.jsx)("div",{className:s.contentWrapper,children:(0,i.jsx)(It,{accept:"image/jpeg",engineGuid:d.guid,progress:this.props.content.create.content.progress,folder:"Uploaded by Andrew Hammond",files:e.processing,completed:e.completed,onLoadContent:this.props.loadContent,onBeginUpload:this.props.beginUpload,onReset:this.props.resetUpload,buttonText:"Upload"})})})})]})]})}}}]),n}(a.Component)),Lt=(0,C.Z)((function(e){return{root:(0,g.Z)({backgroundColor:e.palette.background.default,color:e.palette.background.text||"grey",maxWidth:e.layout.contentWidth,width:"100%",margin:"0 auto",padding:e.spacing(0,2),paddingBottom:"100px"},e.breakpoints.up("sm"),{padding:e.spacing(0,2)}),card:{minWidth:"100%",maxWidth:345,minHeight:175},cardHeader:{minHeight:95,maxHeight:95,cursor:"pointer"},cardSubHeader:{paddingBottom:8,paddingTop:8},cardMedia:{cursor:"pointer"},backgroundText:{color:e.palette.background.text||"grey"},buttonSelect:{color:"white",backgroundColor:T.Z[500],"&:hover":{backgroundColor:T.Z[700]}},buttonRemove:{color:e.palette.getContrastText(jt.Z[500]),backgroundColor:jt.Z[500],"&:hover":{backgroundColor:jt.Z[700]}},paper:{backgroundColor:e.palette.background.default,margin:"auto",overflow:"hidden",minHeight:"100vh"},contentWrapper:{maxWidth:800,margin:"0 auto",background:"white",padding:"2em",borderRadius:5},gallery:{},galleryLoading:{opacity:.6,backgroundColor:e.palette.background.default},searchBar:{width:"100%"},socialMediaPopper:{top:"300px  !important",left:"unset !important",right:"0px !important",display:"grid"},socialMediaButton:{"&:hover > svg":{height:"40px !important",width:"40px !important"}},notReadyHeader:{color:e.palette.background.text||"grey",fontWeight:900},notReadySubscribeText:{color:e.palette.background.text||"grey"},featuredProductBanner:{cursor:"pointer",marginBottom:5},featuredAlertTitle:{fontWeight:700},featuredButton:{color:"white"},floatingButtons:{position:"fixed",zIndex:1e3,bottom:100},floatingButton:(0,g.Z)({bottom:100,"&:nth-child(2)":{bottom:170}},e.breakpoints.up("sm"),{bottom:e.spacing(2),"&:nth-child(2)":{bottom:e.spacing(10)}}),floatingShowProductsButton:{position:"fixed",right:e.spacing(2),zIndex:3e3,background:T.Z[500],"&:hover":{background:T.Z[700]}},floatingOpenCartButton:{position:"fixed",right:e.spacing(2),zIndex:3e3},bottomNavTitle:{padding:e.spacing(.5,2),backgroundColor:e.palette.background.default||"white",color:e.palette.background.text||"grey"},desktopSearchNav:(0,g.Z)({margin:"1em"},e.breakpoints.up("sm"),{display:"block"}),bottomNav:(0,g.Z)({backgroundColor:e.palette.background.default||"white",position:"fixed",zIndex:1e3,bottom:0,width:"100%",padding:e.spacing(1),paddingBottom:e.spacing(1.5),color:e.palette.background.text||"grey"},e.breakpoints.up("sm"),{display:"none"}),bottomNavIcons:{backgroundColor:e.palette.background.default||"white",color:e.palette.background.text||"grey"},bottomNavActions:{color:e.palette.background.text||"grey"},filtersArea:(0,g.Z)({display:"none"},e.breakpoints.up("sm"),{display:"block"}),filtersList:(0,g.Z)({width:"60vw"},e.breakpoints.up("sm"),{width:"30vw"})}}))((0,c.withRouter)((0,s.$j)((function(e){return{account:e.account,engines:e.engines,search:e.search,filters:e.filters,content:e.content,checkout:e.checkout}}),Nt)((0,Z.Z)(Dt)))),At=(0,c.withRouter)((0,s.$j)((function(e){return{engines:e.engines,account:e.account}}))((function(e){var t,n=e.engines.detail.engine,a=e.account.detail.account;return t="true"===n.customTheme||!0===n.customTheme?(0,d.Z)((0,r.Z)((0,o.Z)({},n.theme),{palette:(0,r.Z)((0,o.Z)({},n.theme.palette),{background:(0,r.Z)((0,o.Z)({},n.theme.palette.background),{default:n.theme.palette.background.default}),primary:{main:n.theme.palette.primary.main,light:n.theme.palette.primary.main,dark:n.theme.palette.primary.main,contrastText:n.theme.palette.primary.contrastText},secondary:{main:n.theme.palette.secondary.main,light:n.theme.palette.secondary.main,dark:n.theme.palette.secondary.main,contrastText:n.theme.palette.secondary.contrastText}}),mediaLogoWidth:n.mediaLogoWidth})):(0,d.Z)((0,r.Z)((0,o.Z)({},a.theme),{palette:(0,r.Z)((0,o.Z)({},a.theme.palette),{background:(0,r.Z)((0,o.Z)({},a.theme.palette.background),{default:a.theme.palette.background.default}),primary:{main:a.theme.palette.primary.main,light:a.theme.palette.primary.main,dark:a.theme.palette.primary.main,contrastText:a.theme.palette.primary.contrastText},secondary:{main:a.theme.palette.secondary.main,light:a.theme.palette.secondary.main,dark:a.theme.palette.secondary.main,contrastText:a.theme.palette.secondary.contrastText}}),mediaLogoWidth:a.mediaLogoWidth})),(0,i.jsx)(l.Z,{theme:t,children:(0,i.jsx)(Lt,{theme:t})})}))),Ot=(n(40926),n(60364)),Rt=n(97945),Gt=n(86935),Ft=(n(54409),function(e){(0,f.Z)(n,e);var t=(0,b.Z)(n);function n(e){return(0,h.Z)(this,n),t.call(this,e)}return(0,m.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.classes,n=e.loading,o=e.account,r=!!o.mediaLogoGuid&&"".concat(_.cdn.endpoint,"/media/").concat(o.guid,"/").concat(o.mediaLogoName),a=o.webUrl?o.webUrl:"/";return(0,i.jsxs)(X.Z,{disableGutters:!0,className:t.toolbar,children:[!n&&Object.keys(o).length>0&&r&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("div",{className:t.logoContainer,children:(0,i.jsx)("a",{href:a,children:(0,i.jsx)(I.Ee,{className:t.logoImage,src:r,lazy:!1})})})}),!n&&!r&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(G.Z,{children:o.companyName})}),(0,i.jsx)("div",{className:t.flexGrow})]})}}]),n}(a.PureComponent)),Wt=(0,C.Z)((function(e){return{flexGrow:{flexGrow:1},navigationContainer:{display:"flex",justifyContent:"space-between",alignItems:"center"},toolbar:(0,g.Z)({backgroundColor:"transparent",zIndex:98,maxWidth:e.layout.contentWidth,width:"100%",margin:"0 auto",padding:e.spacing(0,2)},e.breakpoints.up("sm"),{padding:e.spacing(0,8)}),navLink:{"&:hover":{color:e.palette.primary.dark}},listItem:{cursor:"pointer","&:hover > .menu-item, &:hover svg":{color:e.palette.primary.dark},"&.menu-item--no-dropdown":{paddingRight:0}},listItemActive:{"&> .menu-item":{color:e.palette.primary.dark}},listItemText:{flex:"0 0 auto",marginRight:e.spacing(2),whiteSpace:"nowrap"},listItemButton:{whiteSpace:"nowrap"},listItemIcon:{minWidth:"auto"},popover:{padding:e.spacing(4),border:e.spacing(2),boxShadow:"0 0.5rem 2rem 2px rgba(116, 123, 144, 0.09)",minWidth:350,marginTop:e.spacing(2)},iconButton:{marginLeft:e.spacing(2),padding:0,"&:hover":{background:"transparent"}},expandOpen:{transform:"rotate(180deg)",color:e.palette.primary.dark},logoContainer:(0,g.Z)({padding:"12px",width:"".concat(e.mediaLogoWidth,"px")||0},e.breakpoints.up("md"),{width:"".concat(e.mediaLogoWidth,"px")||0}),logoImage:{width:"100%",height:"100%"},menu:{display:"flex",justifyContent:"space-between"},menuItem:{marginRight:e.spacing(5),"&:last-child":{marginRight:0}},menuGroupItem:{paddingTop:0},menuGroupTitle:{textTransform:"uppercase"}}}))((0,c.withRouter)(Ft)),Bt=n(45101),Ut=n(63706),Mt=function(e){return Ut.defaults.baseURL=_.api.workspaces.endpoint,function(t){return new Promise((function(n,r){var i={params:(0,o.Z)({},e)};return t({type:Oe.zSD,payload:i.params}),Ut.get("/identity/tenants",i).then((function(e){t({type:Oe.A6S,payload:e.data});var o=e.data,r={region:o.region,userPoolId:o.userPoolId,userPoolWebClientId:o.userPoolWebClientId,mandatorySignIn:!1,authenticationFlowType:"USER_SRP_AUTH"};return Bt.default.configure({Auth:r}),n(e.data)})).catch((function(e){t({type:Oe.Il4,payload:{error:e}}),r(e)}))}))}},Ht=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return P().defaults.baseURL=_.api.search.endpoint,function(t){return new Promise((function(n,o){var r={params:{slug:e.slug,hostname:window.location.hostname}};return t({type:e.slug?Oe.PEC:Oe.v2M,payload:{slug:r.params.slug}}),P().get("/albums",r).then((function(o){t({type:e.slug?Oe.M5V:Oe.Sud,payload:e.slug?{detail:o.data.libraries}:{libraries:o.data.libraries}}),n(o.data)})).catch((function(n){t({type:e.guid?Oe.eJH:Oe.an5,payload:{error:n}}),o(n)}))}))}},zt={fetchTenant:Mt,fetchLibraries:Ht},qt=function(e){(0,f.Z)(n,e);var t=(0,b.Z)(n);function n(){return(0,h.Z)(this,n),t.apply(this,arguments)}return(0,m.Z)(n,[{key:"componentDidMount",value:function(){var e=this;return(0,p.Z)((function(){return(0,y.__generator)(this,(function(t){switch(t.label){case 0:return[4,e.props.fetchTenant({hostname:window.location.hostname})];case 1:return t.sent(),[4,e.props.fetchLibraries({hostname:window.location.hostname})];case 2:return t.sent(),[2]}}))}))()}},{key:"render",value:function(){var e=this.props.libraries.libraries,t=this.props.classes,n=(this.props.router.query,this.props.account.detail.account);if(n){var o=n.PK?n.PK.substring(n.PK.indexOf("#")+1):"",r=null;n.media&&n.media.favicon&&(r="".concat(n.media.favicon));var a=null;n.logoGuid&&(a="".concat(_.imgix.media.endpoint,"/media/").concat(o,"/").concat(n.mediaLogoName));var s="".concat(n.companyName);return(0,i.jsxs)(i.Fragment,{children:[n.companyName&&(0,i.jsxs)(Le(),{children:[(0,i.jsx)("title",{children:s}),(0,i.jsx)("meta",{charSet:"utf-8"}),(0,i.jsx)("meta",{httpEquiv:"X-UA-Compatible",content:"IE=edge"}),(0,i.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1, shrink-to-fit=no"}),(0,i.jsx)("meta",{property:"type",content:"website"}),(0,i.jsx)("meta",{property:"og:type",content:"website"}),(0,i.jsx)("meta",{property:"title",content:s}),(0,i.jsx)("meta",{property:"og:title",content:s}),(0,i.jsx)("meta",{property:"og:site_name",content:s}),(0,i.jsx)("meta",{name:"description",content:n.companyDescription}),(0,i.jsx)("meta",{property:"og:description",content:n.companyDescription}),r&&(0,i.jsx)("link",{rel:"icon",href:r}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("meta",{property:"og:image:alt",content:s}),(0,i.jsx)("meta",{property:"og:image",content:a})]})]}),(0,i.jsxs)(q.Z,{className:t.paper,square:!0,children:[(0,i.jsx)(Wt,{account:n,libraries:e,loading:e.loading}),(0,i.jsx)("div",{className:t.root,children:(0,i.jsxs)("div",{className:t.contentWrapper,children:[this.props.libraries.loading&&(0,i.jsx)(Ne,{}),(0,i.jsx)(W.Z,{container:!0,spacing:2,children:!this.props.libraries.loading&&e.rows.hits.map((function(e,n){var o=e.media.logo?e.media.logo:"/images/thumbnail-default.png",r=e.media.featuredImage?e.media.featuredImage:"/images/thumbnail-default.png";r||(r=o);var a="/albums/".concat(e.slug);return(0,i.jsx)(W.Z,{className:t.library,item:!0,container:!0,alignItems:"center",direction:"column",xs:12,sm:6,md:4,children:(0,i.jsxs)(ae.Z,{className:t.card,children:[(0,i.jsxs)(Rt.Z,{className:t.cardActionArea,children:[(0,i.jsx)("a",{style:{color:"inherit"},href:a,children:(0,i.jsx)(se.Z,{className:t.cardMedia,image:r,title:e.name,style:{backgroundPosition:e.mediaFeaturedImageBackgroundPosition||"center",backgroundSize:e.mediaFeaturedImageBackgroundSize||"cover"}})}),(0,i.jsx)(Gt.Z,{className:t.cardContent,children:(0,i.jsx)("a",{style:{color:"inherit"},href:a,children:(0,i.jsx)(G.Z,{gutterBottom:!0,variant:"h5",component:"h2",children:e.name})})})]}),(0,i.jsx)(ce.Z,{children:(0,i.jsx)(Ot.Z,{href:a,children:(0,i.jsx)(R.Z,{size:"small",color:"primary",children:"Browse"})})})]})},n)}))})]})})]})]})}}}]),n}(a.Component),Vt=(0,C.Z)((function(e){return{root:(0,g.Z)({backgroundColor:e.palette.background.default,maxWidth:e.layout.contentWidth,width:"100%",margin:"0 auto",padding:e.spacing(0,2)},e.breakpoints.up("sm"),{padding:e.spacing(0,8)}),card:{minWidth:"100%",maxWidth:345,height:"100%",display:"flex",flexDirection:"column"},cardContent:(0,g.Z)({minHeight:50},e.breakpoints.up("sm"),{}),cardActionArea:{marginBottom:"auto"},cardMedia:{height:190},paper:{backgroundColor:e.palette.background.default,margin:"auto",overflow:"hidden",minHeight:"100vh"},contentWrapper:{backgroundColor:e.palette.background.default,margin:"40px 0px"}}}))((0,c.withRouter)((0,s.$j)((function(e){return{libraries:e.libraries,search:e.search,account:e.account}}),zt)(qt))),Xt=(0,c.withRouter)((0,s.$j)((function(e){return{account:e.account}}))((function(e){var t=e.account,n=(0,d.Z)((0,r.Z)((0,o.Z)({},t.detail.account.theme),{palette:(0,r.Z)((0,o.Z)({},t.detail.account.theme.palette),{primary:{main:t.detail.account.theme.palette.primary.main,light:t.detail.account.theme.palette.primary.main,dark:t.detail.account.theme.palette.primary.main,contrastText:t.detail.account.theme.palette.primary.contrastText},secondary:{main:t.detail.account.theme.palette.secondary.main,light:t.detail.account.theme.palette.secondary.main,dark:t.detail.account.theme.palette.secondary.main,contrastText:t.detail.account.theme.palette.secondary.contrastText}}),mediaLogoWidth:t.detail.account.mediaLogoWidth}));return(0,i.jsx)(l.Z,{theme:n,children:(0,i.jsx)(Vt,{})})}))),Kt=n(5388),Yt=function(e){(0,f.Z)(n,e);var t=(0,b.Z)(n);function n(e){return(0,h.Z)(this,n),t.call(this,e)}return(0,m.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.classes,n=e.loading,o=e.library,r=e.account,a=!(!o.customTheme||!o.mediaLogoGuid)&&o.media.logo,s=!!r.media.logo&&r.media.logo,c=a||s,l=r.webUrl?r.webUrl:"/pages/".concat(o.slug);return r.webUrl&&(l=r.webUrl),(0,i.jsxs)(X.Z,{disableGutters:!0,className:t.toolbar,children:[!n&&o.guid&&Object.keys(o).length>0&&c&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("div",{className:t.logoContainer,children:(0,i.jsx)("a",{href:l,children:(0,i.jsx)(I.Ee,{className:t.logoImage,src:c,lazy:!1})})})}),!c&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(G.Z,{className:t.topbarTitle,children:r.companyName})}),(0,i.jsx)("div",{className:t.flexGrow})]})}}]),n}(a.PureComponent),$t=(0,C.Z)((function(e){return{flexGrow:{flexGrow:1},navigationContainer:{display:"flex",justifyContent:"space-between",alignItems:"center"},topbarTitle:{color:e.palette.background.text},toolbar:(0,g.Z)({backgroundColor:"transparent",zIndex:98,maxWidth:e.layout.contentWidth,width:"100%",margin:"0 auto",padding:e.spacing(0,2)},e.breakpoints.up("sm"),{padding:e.spacing(0,8)}),navLink:{"&:hover":{color:e.palette.primary.dark}},listItem:{cursor:"pointer","&:hover > .menu-item, &:hover svg":{color:e.palette.primary.dark},"&.menu-item--no-dropdown":{paddingRight:0}},listItemActive:{"&> .menu-item":{color:e.palette.primary.dark}},listItemText:{flex:"0 0 auto",marginRight:e.spacing(2),whiteSpace:"nowrap"},listItemButton:{whiteSpace:"nowrap"},listItemIcon:{minWidth:"auto"},popover:{padding:e.spacing(4),border:e.spacing(2),boxShadow:"0 0.5rem 2rem 2px rgba(116, 123, 144, 0.09)",minWidth:350,marginTop:e.spacing(2)},iconButton:{marginLeft:e.spacing(2),padding:0,"&:hover":{background:"transparent"}},expandOpen:{transform:"rotate(180deg)",color:e.palette.primary.dark},logoContainer:(0,g.Z)({padding:"12px",width:"".concat(e.mediaLogoWidth,"px")||0},e.breakpoints.up("md"),{width:"".concat(e.mediaLogoWidth,"px")||0}),logoImage:{width:"100%",height:"100%"},menu:{display:"flex",justifyContent:"space-between"},menuItem:{marginRight:e.spacing(5),"&:last-child":{marginRight:0}},menuGroupItem:{paddingTop:0},menuGroupTitle:{textTransform:"uppercase"}}}))((0,c.withRouter)(Yt)),Jt={fetchTenant:Mt,fetchLibraries:Ht},Qt=function(e){(0,f.Z)(n,e);var t=(0,b.Z)(n);function n(e){var o;return(0,h.Z)(this,n),(o=t.call(this,e)).state={engineSearchValue:""},o}return(0,m.Z)(n,[{key:"render",value:function(){var e=this,t=this.props.libraries.detail,n=this.props.classes,o=this.props.router.query,r=t.library,a=-1===[!0,!1].indexOf(r.showHeader)||r.showHeader,s=r.engines,c=this.props.account.detail.account,l=["true",!0,void 0].includes(r.showGalleryNames);if(this.state.engineSearchValue&&(s=s.filter((function(t){return!!t.name&&(0,Ke.containsText)(t.name,e.state.engineSearchValue)}))),r){r.PK&&r.PK.substring(r.PK.indexOf("#")+1);var d=null;c.media&&c.media.favicon&&(d="".concat(c.media.favicon)),r.mediaFaviconGuid&&(d=r.media.favicon);var u=null;r.mediaFeaturedImageGuid&&(u=r.media.featuredImage);var p=null;r.mediaBackgroundImageGuid&&(p=r.media.backgroundImage);var h="".concat(r.name," (").concat(c.companyName,")"),m=r.description||h;return(0,i.jsxs)(i.Fragment,{children:[r.name&&c.companyName&&(0,i.jsxs)(Le(),{children:[(0,i.jsx)("title",{children:h}),(0,i.jsx)("meta",{charSet:"utf-8"}),(0,i.jsx)("meta",{httpEquiv:"X-UA-Compatible",content:"IE=edge"}),(0,i.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1, shrink-to-fit=no"}),(0,i.jsx)("meta",{property:"type",content:"website"}),(0,i.jsx)("meta",{property:"og:type",content:"website"}),(0,i.jsx)("meta",{property:"title",content:h}),(0,i.jsx)("meta",{property:"og:title",content:h}),(0,i.jsx)("meta",{property:"og:site_name",content:h}),(0,i.jsx)("meta",{name:"description",content:m}),(0,i.jsx)("meta",{property:"og:description",content:m}),d&&(0,i.jsx)("link",{rel:"icon",href:d}),u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("meta",{property:"og:image:alt",content:h}),(0,i.jsx)("meta",{property:"og:image:secure_url",content:u})]})]}),(0,i.jsxs)(q.Z,{className:n.paper,square:!0,style:{backgroundImage:p?'url("'.concat(p,'")'):null,backgroundPosition:r.mediaBackgroundPosition||"center",backgroundRepeat:r.mediaBackgroundRepeat||"no-repeat"},children:["false"!==o.header&&a&&(0,i.jsx)($t,{account:c,library:r,loading:t.loading}),(0,i.jsx)("div",{className:n.root,children:(0,i.jsxs)("div",{className:n.contentWrapper,children:[r.media.bannerMobile&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(M.Z,{smUp:!0,children:(0,i.jsx)("div",{align:"center",children:(0,i.jsx)(I.Ee,{src:"".concat(r.media.bannerMobile)})})})}),r.media.bannerDesktop&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(M.Z,{xsDown:!0,children:(0,i.jsx)("div",{align:"center",children:(0,i.jsx)(I.Ee,{src:"".concat(r.media.bannerDesktop)})})})}),t.loading&&(0,i.jsx)(Ne,{}),(0,i.jsx)("br",{}),(0,i.jsx)(G.Z,{className:n.backgroundText,variant:"h4",align:"center",children:r.name}),(0,i.jsx)("br",{}),r.engines.length>0&&(0,i.jsxs)("div",{children:[t.library.welcomeText&&t.library.welcomeText.length>0&&(0,i.jsxs)("div",{align:"center",children:[(0,i.jsx)("br",{}),(0,i.jsx)(G.Z,{component:"div",className:n.backgroundText,dangerouslySetInnerHTML:{__html:t.library.welcomeText.replace(/\n/g,"<br>")}}),(0,i.jsx)("br",{})]}),(0,i.jsx)("br",{}),r.engines.length>=10&&(0,i.jsx)(W.Z,{container:!0,children:(0,i.jsx)(W.Z,{item:!0,xs:12,sm:9,md:6,children:(0,i.jsx)(O.Z,{className:n.searchBar,placeholder:this.props.i18n.t("ALBUM_SEARCH_BAR_PLACEHOLDER"),value:this.state.engineSearchValue,onChange:function(t){e.setState({engineSearchValue:t})},onRequestSearch:function(t){e.setState({engineSearchValue:t})},onCancelSearch:function(){e.setState({engineSearchValue:""})}})})}),(0,i.jsx)(W.Z,{container:!0,spacing:2,children:s.map((function(a,s){var c=r.media.logo?r.media.logo:"/images/thumbnail-default.png",d=a.media.featuredImage?"".concat(a.media.featuredImage):"/images/thumbnail-default.png";d||(d=c);var u="";a.matches&&a.matches.length>0&&(u=new URLSearchParams(a.matches.map((function(e){return["images",e]}))).toString());var p=!(!a.defaultLocale||"en"===a.defaultLocale)&&a.defaultLocale,h=a.matches&&a.matches.length>0?"".concat(p?"/".concat(p):"","/galleries/").concat(a.slug,"?page=").concat(r.slug,"&").concat(u).concat(!1===r.showHeader||"false"===o.header?"&header=false":""):"".concat(p?"/".concat(p):"","/galleries/").concat(a.slug,"?page=").concat(r.slug).concat(!1===r.showHeader||"false"===o.header?"&header=false":"");return(0,i.jsx)(W.Z,{className:t.selfie_searching?n.libraryLoading:n.library,item:!0,container:!0,alignItems:"center",direction:"column",xs:12,sm:6,md:4,children:(0,i.jsxs)(ae.Z,{className:n.card,children:[(0,i.jsxs)(Rt.Z,{className:n.cardActionArea,children:[(0,i.jsx)("a",{style:{color:"inherit"},href:h,children:(0,i.jsx)(se.Z,{className:n.cardMedia,image:d,title:a.name,style:{backgroundPosition:a.mediaFeaturedImageBackgroundPosition||"center",backgroundSize:a.mediaFeaturedImageBackgroundSize||"cover"}})}),l&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Gt.Z,{className:n.cardContent,children:(0,i.jsx)("a",{style:{color:"inherit"},href:h,children:(0,i.jsx)(G.Z,{gutterBottom:!0,variant:"h5",component:"h2",children:a.name})})})})]}),(0,i.jsx)(Kt.Z,{flexGrow:1}),(0,i.jsxs)(Kt.Z,{padding:2,display:"flex",flexDirection:"column",children:[l&&(0,i.jsx)(Kt.Z,{marginBottom:2,children:(0,i.jsx)(F.Z,{})}),(0,i.jsxs)(Kt.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.showDates&&a.publishedDate&&(0,i.jsx)(G.Z,{color:"text.primary",children:new Date(a.publishedDate).toDateString()}),(0,i.jsx)(Ot.Z,{href:h,children:(0,i.jsx)(R.Z,{size:"small",color:"primary",children:e.props.i18n.t("BROWSE")})})]})]})]})},s)}))})]})]})})]})]})}}}]),n}(a.Component),en=(0,C.Z)((function(e){return{root:(0,g.Z)({backgroundColor:"transparent",maxWidth:e.layout.contentWidth,width:"100%",margin:"0 auto",padding:e.spacing(0,2)},e.breakpoints.up("sm"),{padding:e.spacing(0,8)}),backgroundText:{color:e.palette.background.text||"grey"},libraryLoading:{opacity:.6},card:{minWidth:"100%",maxWidth:345,height:"100%",display:"flex",flexDirection:"column"},cardContent:(0,g.Z)({minHeight:50},e.breakpoints.up("sm"),{}),cardActionArea:{marginBottom:"auto"},cardMedia:{height:190},paper:{backgroundColor:e.palette.background.default,margin:"auto",overflow:"hidden",minHeight:"100vh"},contentWrapper:{backgroundColor:"transparent",margin:"40px 0px"},searchBar:{marginBottom:e.spacing(2)}}}))((0,c.withRouter)((0,s.$j)((function(e){return{libraries:e.libraries,search:e.search,account:e.account}}),Jt)((0,Z.Z)(Qt)))),tn=(0,c.withRouter)((0,s.$j)((function(e){return{libraries:e.libraries,account:e.account}}))((function(e){var t,n=e.libraries,a=e.account,s=n.detail.library,c=a.detail.account;return t=s.customTheme?(0,d.Z)((0,r.Z)((0,o.Z)({},n.detail.library.theme),{palette:(0,r.Z)((0,o.Z)({},n.detail.library.theme.palette),{primary:{main:n.detail.library.theme.palette.primary.main,light:n.detail.library.theme.palette.primary.main,dark:n.detail.library.theme.palette.primary.main,contrastText:n.detail.library.theme.palette.primary.contrastText},secondary:{main:n.detail.library.theme.palette.secondary.main,light:n.detail.library.theme.palette.secondary.main,dark:n.detail.library.theme.palette.secondary.main,contrastText:n.detail.library.theme.palette.secondary.contrastText}}),mediaLogoWidth:n.detail.library.mediaLogoWidth})):(0,d.Z)((0,r.Z)((0,o.Z)({},c.theme),{palette:(0,r.Z)((0,o.Z)({},c.theme.palette),{primary:{main:c.theme.palette.primary.main,light:c.theme.palette.primary.main,dark:c.theme.palette.primary.main,contrastText:c.theme.palette.primary.contrastText},secondary:{main:c.theme.palette.secondary.main,light:c.theme.palette.secondary.main,dark:c.theme.palette.secondary.main,contrastText:c.theme.palette.secondary.contrastText}}),mediaLogoWidth:c.mediaLogoWidth})),(0,i.jsx)(l.Z,{theme:t,children:(0,i.jsx)(en,{})})})));n(4805),n(31737),n(25628),(0,Ee.Z)((function(e){return{formContainer:{height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"calc(100vh - ".concat(e.mixins.toolbar["@media (min-width:600px)"].minHeight,"px)"),maxWidth:500,margin:"0 auto"},section:{paddingTop:0,paddingBottom:0},label:{fontWeight:"bold",textTransform:"uppercase"}}})),n(86073)},56249:function(){},42480:function(){}}]);