1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[959],{7484:function(t){var e,n,r,i,s,a,o,u,l,c,f,d,h,m,p,$,v,g,y,D,S;t.exports=(e="millisecond",n="second",r="minute",i="hour",s="week",a="month",o="quarter",u="year",l="date",c="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,h=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},(p={})[m="en"]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||"th")+"]"}},$=function(t){return t instanceof D},v=function t(e,n,r){var i;if(!e)return m;if("string"==typeof e){var s=e.toLowerCase();p[s]&&(i=s),n&&(p[s]=n,i=s);var a=e.split("-");if(!i&&a.length>1)return t(a[0])}else{var o=e.name;p[o]=e,i=o}return!r&&i&&(m=i),i||!r&&m},g=function(t,e){if($(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new D(n)},(y={s:h,z:function(t){var e=-t.utcOffset(),n=Math.abs(e);return(e<=0?"+":"-")+h(Math.floor(n/60),2,"0")+":"+h(n%60,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,a),s=n-i<0,o=e.clone().add(r+(s?-1:1),a);return+(-(r+(n-i)/(s?i-o:o-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return({M:a,y:u,w:s,d:"day",D:l,h:i,m:r,s:n,ms:e,Q:o})[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}}).l=v,y.i=$,y.w=function(t,e){return g(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})},S=(D=function(){function t(t){this.$L=v(t.locale,null,!0),this.parse(t)}var h=t.prototype;return h.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(y.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(f);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},h.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},h.$utils=function(){return y},h.isValid=function(){return this.$d.toString()!==c},h.isSame=function(t,e){var n=g(t);return this.startOf(e)<=n&&n<=this.endOf(e)},h.isAfter=function(t,e){return g(t)<this.startOf(e)},h.isBefore=function(t,e){return this.endOf(e)<g(t)},h.$g=function(t,e,n){return y.u(t)?this[e]:this.set(n,t)},h.unix=function(){return Math.floor(this.valueOf()/1e3)},h.valueOf=function(){return this.$d.getTime()},h.startOf=function(t,e){var o=this,c=!!y.u(e)||e,f=y.p(t),d=function(t,e){var n=y.w(o.$u?Date.UTC(o.$y,e,t):new Date(o.$y,e,t),o);return c?n:n.endOf("day")},h=function(t,e){return y.w(o.toDate()[t].apply(o.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(e)),o)},m=this.$W,p=this.$M,$=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case u:return c?d(1,0):d(31,11);case a:return c?d(1,p):d(0,p+1);case s:var g=this.$locale().weekStart||0,D=(m<g?m+7:m)-g;return d(c?$-D:$+(6-D),p);case"day":case l:return h(v+"Hours",0);case i:return h(v+"Minutes",1);case r:return h(v+"Seconds",2);case n:return h(v+"Milliseconds",3);default:return this.clone()}},h.endOf=function(t){return this.startOf(t,!1)},h.$set=function(t,s){var o,c=y.p(t),f="set"+(this.$u?"UTC":""),d=((o={}).day=f+"Date",o[l]=f+"Date",o[a]=f+"Month",o[u]=f+"FullYear",o[i]=f+"Hours",o[r]=f+"Minutes",o[n]=f+"Seconds",o[e]=f+"Milliseconds",o)[c],h="day"===c?this.$D+(s-this.$W):s;if(c===a||c===u){var m=this.clone().set(l,1);m.$d[d](h),m.init(),this.$d=m.set(l,Math.min(this.$D,m.daysInMonth())).$d}else d&&this.$d[d](h);return this.init(),this},h.set=function(t,e){return this.clone().$set(t,e)},h.get=function(t){return this[y.p(t)]()},h.add=function(t,e){var o,l=this;t=Number(t);var c=y.p(e),f=function(e){var n=g(l);return y.w(n.date(n.date()+Math.round(e*t)),l)};if(c===a)return this.set(a,this.$M+t);if(c===u)return this.set(u,this.$y+t);if("day"===c)return f(1);if(c===s)return f(7);var d=((o={})[r]=6e4,o[i]=36e5,o[n]=1e3,o)[c]||1,h=this.$d.getTime()+t*d;return y.w(h,this)},h.subtract=function(t,e){return this.add(-1*t,e)},h.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||c;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=y.z(this),s=this.$H,a=this.$m,o=this.$M,u=n.weekdays,l=n.months,f=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},h=function(t){return y.s(s%12||12,t,"0")},m=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},p={YY:String(this.$y).slice(-2),YYYY:this.$y,M:o+1,MM:y.s(o+1,2,"0"),MMM:f(n.monthsShort,o,l,3),MMMM:f(l,o),D:this.$D,DD:y.s(this.$D,2,"0"),d:String(this.$W),dd:f(n.weekdaysMin,this.$W,u,2),ddd:f(n.weekdaysShort,this.$W,u,3),dddd:u[this.$W],H:String(s),HH:y.s(s,2,"0"),h:h(1),hh:h(2),a:m(s,a,!0),A:m(s,a,!1),m:String(a),mm:y.s(a,2,"0"),s:String(this.$s),ss:y.s(this.$s,2,"0"),SSS:y.s(this.$ms,3,"0"),Z:i};return r.replace(d,function(t,e){return e||p[t]||i.replace(":","")})},h.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},h.diff=function(t,e,l){var c,f=y.p(e),d=g(t),h=(d.utcOffset()-this.utcOffset())*6e4,m=this-d,p=y.m(this,d);return p=((c={})[u]=p/12,c[a]=p,c[o]=p/3,c[s]=(m-h)/6048e5,c.day=(m-h)/864e5,c[i]=m/36e5,c[r]=m/6e4,c[n]=m/1e3,c)[f]||m,l?p:y.a(p)},h.daysInMonth=function(){return this.endOf(a).$D},h.$locale=function(){return p[this.$L]},h.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=v(t,e,!0);return r&&(n.$L=r),n},h.clone=function(){return y.w(this.$d,this)},h.toDate=function(){return new Date(this.valueOf())},h.toJSON=function(){return this.isValid()?this.toISOString():null},h.toISOString=function(){return this.$d.toISOString()},h.toString=function(){return this.$d.toUTCString()},t}()).prototype,g.prototype=S,[["$ms",e],["$s",n],["$m",r],["$H",i],["$W","day"],["$M",a],["$y",u],["$D",l]].forEac
1h(function(t){S[t[1]]=function(e){return this.$g(e,t[0],t[1])}}),g.extend=function(t,e){return t.$i||(t(e,D,g),t.$i=!0),g},g.locale=v,g.isDayjs=$,g.unix=function(t){return g(1e3*t)},g.en=p[m],g.Ls=p,g.p={},g)},9387:function(t){var e,n;t.exports=(e={year:0,month:1,day:2,hour:3,minute:4,second:5},n={},function(t,r,i){var s,a=function(t,e,r){void 0===r&&(r={});var i,s,a,o,u=new Date(t);return(void 0===(i=r)&&(i={}),(o=n[a=e+"|"+(s=i.timeZoneName||"short")])||(o=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:s}),n[a]=o),o).formatToParts(u)},o=function(t,n){for(var r=a(t,n),s=[],o=0;o<r.length;o+=1){var u=r[o],l=u.type,c=u.value,f=e[l];f>=0&&(s[f]=parseInt(c,10))}var d=s[3],h=s[0]+"-"+s[1]+"-"+s[2]+" "+(24===d?0:d)+":"+s[4]+":"+s[5]+":000",m=+t;return(i.utc(h).valueOf()-(m-=m%1e3))/6e4},u=r.prototype;u.tz=function(t,e){void 0===t&&(t=s);var n=this.utcOffset(),r=this.toDate(),a=r.toLocaleString("en-US",{timeZone:t}),o=Math.round((r-new Date(a))/1e3/60),u=i(a).$set("millisecond",this.$ms).utcOffset(-(15*Math.round(r.getTimezoneOffset()/15))-o,!0);if(e){var l=u.utcOffset();u=u.add(n-l,"minute")}return u.$x.$timezone=t,u},u.offsetName=function(t){var e=this.$x.$timezone||i.tz.guess(),n=a(this.valueOf(),e,{timeZoneName:t}).find(function(t){return"timezonename"===t.type.toLowerCase()});return n&&n.value};var l=u.startOf;u.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return l.call(this,t,e);var n=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"));return l.call(n,t,e).tz(this.$x.$timezone,!0)},i.tz=function(t,e,n){var r=n||e||s,a=o(+i(),r);if("string"!=typeof t)return i(t).tz(r);var u=function(t,e,n){var r=t-60*e*1e3,i=o(r,n);if(e===i)return[r,e];var s=o(r-=60*(i-e)*1e3,n);return i===s?[r,i]:[t-60*Math.min(i,s)*1e3,Math.max(i,s)]}(i.utc(t,n&&e).valueOf(),a,r),l=u[0],c=u[1],f=i(l).utcOffset(c);return f.$x.$timezone=r,f},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(t){s=t}})},178:function(t){var e,n,r;t.exports=(e="minute",n=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g,function(t,i,s){var a=i.prototype;s.utc=function(t){var e={date:t,utc:!0,args:arguments};return new i(e)},a.utc=function(t){var n=s(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},a.local=function(){return s(this.toDate(),{locale:this.$L,utc:!1})};var o=a.parse;a.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),o.call(this,t)};var u=a.init;a.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else u.call(this)};var l=a.utcOffset;a.utcOffset=function(t,i){var s=this.$utils().u;if(s(t))return this.$u?0:s(this.$offset)?l.call(this):this.$offset;if("string"==typeof t&&null===(t=function(t){void 0===t&&(t="");var e=t.match(n);if(!e)return null;var i=(""+e[0]).match(r)||["-",0,0],s=i[0],a=60*+i[1]+ +i[2];return 0===a?0:"+"===s?a:-a}(t)))return this;var a=16>=Math.abs(t)?60*t:t,o=this;if(i)return o.$offset=a,o.$u=0===t,o;if(0!==t){var u=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(o=this.local().add(a+u,e)).$offset=a,o.$x.$localOffset=u}else o=this.utc();return o};var c=a.format;a.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,e)},a.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var f=a.toDate;a.toDate=function(t){return"s"===t&&this.$offset?s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var d=a.diff;a.diff=function(t,e,n){if(t&&this.$u===t.$u)return d.call(this,t,e,n);var r=this.local(),i=s(t).local();return d.call(r,i,e,n)}})},7592:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return $}});var r=n(6687),i=n(9499),s=n(1664),a=n.n(s),o=n(7294),u=n(6486),l=n(6291),c=n(159),f=n(5850),d=n(8799),h=n(5893);function m(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};
1e%2?m(Object(n),!0).forEach(function(e){(0,i.Z)(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var $=function(){var t=f.Z.getShops.useQuery().data,e=(0,o.useState)({field:"shopDetail.installedAt",order:"desc"}),n=e[0],i=e[1];if(null==t)return(0,h.jsx)("p",{children:"Loading"});var s=t.shops,m=t.plans,$=s.map(function(t){var e;return p(p({},t),{},{domain:null!==(e=t.shopDetail.domain)&&void 0!==e?e:t.shopDetail.shopifyDomain})}),v=(0,u.orderBy)($,function(t){var e=(0,u.get)(t,n.field);return null===e&&"shopDetail.installedAt"===n.field?"1900":e},n.order);return(0,h.jsx)("div",{className:"mt-8",children:(0,h.jsx)(l.Z,{headers:[{label:"Shop",sortField:"domain"},{label:"Plan",sortField:"shopDetail.planId"},{label:"Plan Override",sortField:"shopDetail.planManuallyAddedAt"},{label:"Installed At",sortField:"shopDetail.installedAt"},{label:"Last Login At",sortField:"shopDetail.lastLoggedInAt"},{label:"Generated Images",sortField:"computedStat.generatedCount"},{label:"Replaced Images",sortField:"computedStat.replacedCount"},{label:"Replaced Image Views",sortField:"shopStat.replacedImagesStorefrontViews"}],sort:n,setSort:i,dataRows:[[(0,h.jsxs)("p",{children:[(0,h.jsx)("span",{className:"font-semibold",children:"Total "}),(0,h.jsxs)("span",{children:[t.totals.shops," shops"]})]},"totals-shops"),"","","","",t.totals.generatedImages,t.totals.replacedImages,t.totals.replacedImagesViews]].concat((0,r.Z)(v.map(function(t){var e,n,r=m.find(function(e){return t.shopDetail.planId===e.id});return[(0,h.jsxs)("div",{children:[(0,h.jsx)(a(),{href:"/admin/shops/".concat(t.shopDetail.shopifyDomain),className:"text-cyan-600 underline underline-offset-4",children:null!==(e=t.shopDetail.domain)&&void 0!==e?e:t.shopDetail.shopifyDomain}),(0,h.jsx)(c.Z,{isInstalled:t.shopDetail.isInstalled})]},t.shopDetail.shopSessionId),null!==(n=null==r?void 0:r.externalName)&&void 0!==n?n:"No plan assigned!",(0,d.Z)(t.shopDetail.planManuallyAddedAt),(0,d.Z)(t.shopDetail.installedAt),(0,d.Z)(t.shopDetail.lastLoggedInAt),t.computedStat.generatedCount,t.computedStat.replacedCount,t.shopStat.replacedImagesStorefrontViews]})))})})}},6291:function(t,e,n){"use strict";n.d(e,{Z:function(){return a}});var r=n(9603),i=n(9417),s=n(5893);function a(t){var e=t.className,n=t.headers,a=t.dataRows,o=t.sort,u=t.setSort;return(0,s.jsx)("div",{className:"p-4 bg-slate-50 shadow rounded-lg ".concat(e||""),children:(0,s.jsxs)("table",{className:"w-full text-left",children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:n.map(function(t,e){return(0,s.jsxs)("th",{className:" text-gray-700 pb-2 border-b border-gray-300 cursor-pointer select-none ",onClick:function(){u({field:t.sortField,order:"asc"===o.order?"desc":"asc"})},children:[t.label,(0,s.jsx)("span",{className:"ml-2",children:t.sortField===o.field?(0,s.jsx)(r.G,{icon:"asc"===o.order?i.l1h:i.eW2}):(0,s.jsx)("span",{children:"\xa0\xa0"})})]},e)})})}),(0,s.jsx)("tbody",{children:a.map(function(t,e){return(0,s.jsx)("tr",{children:t.map(function(t,e){return(0,s.jsx)("td",{className:"py-2 border-b border-gray-300",children:t},e)})},e)})})]})})}},159:function(t,e,n){"use strict";n.d(e,{Z:function(){return i}});var r=n(5893);function i(t){return 1===t.isInstalled?null:(0,r.jsx)("span",{className:"ml-4 bg-gray-200 rounded-lg p-1 text-sm",children:"u"})}},8799:function(t,e,n){"use strict";n.d(e,{Z:function(){return l}});var r=n(7484),i=n.n(r),s=n(178),a=n.n(s),o=n(9387),u=n.n(o);function l(t){return t?i()(t).tz("America/Los_Angeles").format("MMM DD YYYY, hh:mmA"):"-"}i().extend(a()),i().extend(u())},4151:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/shops",function(){return n(7592)}])},6687:function(t,e,n){"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function i(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(t,e)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n.d(e,{Z:function(){return i}})}},function(t){t.O(0,[662,976,603,774,888,179],function(){return t(t.s=4151)}),_N_E=t.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.