1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2699],{16652:function(e,t,a){"use strict";a.r(t),a.d(t,{__N_SSP:function(){return qe},default:function(){return Le}});var n=a(80318),r=a(67294),o=a(98595),l=a(10267),i=a(51252),s=a(92809);function c(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function d(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?c(Object(a),!0).forEach((function(t){(0,s.Z)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):c(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var u=r.createContext(d(d({},{currentStep:1,updateType:"",uploadFile:"",downloadFile:"",error:!1,errorMessage:"",mappedHeaders:{},totalRecords:0,mappingKey:"",csvParsedData:[{}],conditions:[{}],actions:[{}],sponsorItem:{},schoolYearList:[""]}),{},{setCurrentStep:function(e){},setUpdateType:function(e){},setUploadFile:function(e){},setDownloadFile:function(e){},setError:function(e){},setErrorMessage:function(e){},setMappedHeaders:function(e){},setTotalRecords:function(e){},setMappingKey:function(e){},setCsvParsedData:function(e){},setConditions:function(e){},setActions:function(e){},setSponsorItem:function(e){},setSchoolYearList:function(e){}})),p=u.Provider,f=u,h=a(45769),v=a.n(h),m="MCH - Sponsored Item Flip",y="MCH - Assign List Managers",b="Brand Add",g="Brand Flip",_="School Year",x="Evergreen",j="All Brand",w="Clear Dataminer Accounts(Info Evo)",C="Clear Dataminer Accounts(Incoho)",O="Clear Dataminer Accounts(School)",T=[m,y,b,g,_,x,j,w,C,O],S=[{name:"list_header",fields:[{name:"entry_method",type:["concierge","internal","internal-connected","internal-partnerconnected","ncespartnerloader","partnerloader","powerloader","third-party","user"]},{name:"evergreen",type:[0,1]},{name:"list_type",type:["supply","wish"]},{name:"modified",type:["current-date"]},{name:"modifier_id",type:"number"},{name:"school_year",type:["2021-2022","2022-2023","2023-2024"]},{name:"school_year_modified",type:["current-date"]},{name:"status",type:"number"},{name:"teacher_id",type:"number"}]},{name:"list_details",fields:[{name:"brand_id",type:"number"},{name:"item_id",type:"number"},{name:"item_name",type:"string"},{name:"modified_date",type:["current-date"]}]},{name:"teacher_schools",fields:[{name:"school_id",type:"number"},{name:"user_id",type:"number"},{name:"admin",type:"number"}]}],P=[{table:"list_header",field:"status",value:"1",operator:"equal"},{table:"list_header",field:"school_year",value:"cur_year",operator:"equal"},{table:"list_header",field:"list_type",value:"supply",operator:"equal"},{table:"list_details",field:"item_id",value:"",operator:"not-equal"}],Z=[{table:"list_header",field:"modifier_id",value:"155299",action:"update"},{table:"list_header",field:"modified",value:"current-date",action:"update"},{table:"list_details",field:"item_id",value:"",action:"add",andField:{field:"modified_date",value:"current-date"}}],N=[{table:"list_header",field:"status",value:"1",operator:"equal"},{table:"list_header",field:"school_year",value:"cur_year",operator:"equal"},{table:"list_header",field:"list_type",value:"supply",operator:"equal"},{table:"list_details",field:"item_id",value:"",operator:"equal"},{table:"list_details",field:"item_id",value:"",operator:"equal"},{table:"list_details",field:"item_id",value:"",operator:"equal"},{table:"list_details",field:"item_id",value:"",operator:"equal"}],F=[{table:"list_header",field:"modifier_id",value:"155299",action:"update"},{table:"list_header",field:"modified",value:"current-date",action:"update"}],k=[{table:"list_header",field:"status",value:"1",operator:"equal"},{table:"list_header",field:"school_year",value:"prev_year",operator:"equal"},{table:"list_header",field:"list_type",value:"supply",operator:"equal"}],D=[{table:"list_header",field:"school_year",value:"cur_year",action:"update"},{table:"list_header",field:"school_year_modified",value:"current-date",action:"update"},{table:"list_header",field:"modified",value:"current-date",action:"update"},{table:"list_header",field:"modifier_id",value:"155299",action:"update"}],A=[{table:"list_header",field:"status",value:"1",operator:"equal"},{table:"list_header",field:"school_year",value:"",operator:"equal"},{table:"list_header",field:"list_type",value:"supply",operator:"equal"},{table:"list_header",field:"evergreen",value:1,operator:"not-equal"}],I=[{table:"list_header",field:"evergreen",value:1,action:"update"},{table:"list_header",field:"modified",value:"current-date",action:"update"},{table:"list_header",field:"modifier_id",value:"155299",action:"update"}],U=[{table:"list_header",field:"status",value:"1",operator:"equal"},{table:"list_header",field:"school_year",value:"cur_year",operator:"equal"},{table:"list_header",field:"list_type",value:"supply",operator:"equal"}],E=[{table:"list_header",field:"modifier_id",value:"155299",action:"update"},{table:"list_header",field:"modified",value:"current-date",action:"update"},{table:"list_details",field:"modified_date",value:"current-date",action:"update"}],M=[{table:"list_header",field:"status",value:"1",operator:"equal"},{table:"list_header",field:"school_year",value:"cur_year",operator:"equal"},{table:"list_header",field:"list_type",value:"supply",operator:"equal"},{table:"list_header",field:"teacher_id",value:"@informationevolution",operator:"equal"}],R=[{table:"list_header",field:"teacher_id",value:"135545",action:"update"},{table:"list_header",field:"modifier_id",value:"155299",action:"update"},{table:"list_header",field:"modified",value:"current-date",action:"update"}],q=[{table:"list_header",field:"status",value:"1",operator:"equal"},{table:"list_header",field:"school_year",value:"cur_year",operator:"equal"},{table:"list_header",field:"list_type",value:"supply",operator:"equal"},{table:"list_header",field:"teacher_id",value:"@incoho",operator:"equal"}],L=[{table:"list_header",field:"teacher_id",value:"135544",action:"update"},{table:"list_header",field:"modifier_id",value:"155299",action:"update"},{table:"list_header",field:"modified",value:"current-date",action:"update"}],H=[{table:"teacher_schools",field:"user_id",value:"@Incoho_Teacher_Id",operator:"not-equal"},{table:"teacher_schools",field:"user_id",value:"@InfoEvo_Teacher_Id",operator:"not-equal"},{table:"teacher_schools",field:"user_id",value:"dataminer accounts",operator:"equal"}],B=[{table:"teacher_schools",field:"user_id",value:"",action:"delete"}],Y=a(85893),V=function(){var e=(0,r.useContext)(f),t=[{title:"SELECT UPDATE TYPE",stepNumber:1},{title:"UPLOAD CSV",stepNumber:2},{title:"MAP CONDITIONS",stepNumber:3},{title:"MAP ACTIONS",stepNumber:4},{title:"DOWNLOAD RESULTS",stepNumber:5}],a=e.updateType===O?t.filter((function(e){return"MAP ACTIONS"!==e.title&&"UPLOAD CSV"!==e.title})):t,n=(0,r.useMemo)((function(){return a.map((function(t,a){var n=e.updateType===O?e.currentStep+1>t.stepNumber:e.currentStep>a;return(0,Y.jsxs)(i.Z,{children:[(0,Y.jsx)(l.Z,{className:"".concat(v().stepTitle),children:(0,Y.jsx)(i.Z,{className:"".concat(n?v().highlighted:""),children:t.title})}),(0,Y.jsx)(l.Z,{children:(0,Y.jsx)(i.Z,{className:"".concat(v().dot,"\n ").concat(e.currentStep-1>a?v().lineActive:"","\n ").concat(n?v().active:"","\n "),children:"\u2022"})})]},"step-".concat(a))}))}),[e.updateType,e.currentStep,a]);return(0,Y.jsx)(l.Z,{className:"mx-auto text-center w-100 mt-3 mb-5 py-3",children:n})}
1,K=a(86704),W=a(32842),G=a(42365),z=a(98227),X=a(97975),J=function(e,t){return t(e)},Q=function(){var e=(0,r.useContext)(f),t=(0,r.useState)(!1),a=t[0],n=t[1];return 1===e.currentStep?(0,Y.jsxs)(l.Z,{className:"text-center mx-auto",children:[(0,Y.jsx)(i.Z,{xs:12,className:"mb-3",children:(0,Y.jsxs)(K.Z,{isOpen:a,toggle:function(){return n((function(e){return!e}))},children:[(0,Y.jsx)(W.Z,{caret:!0,children:e.updateType?e.updateType:"Select Update Type"}),(0,Y.jsxs)(G.Z,{children:[(0,Y.jsx)(z.Z,{onClick:function(){return e.setUpdateType(j)},children:"All Brand"}),(0,Y.jsx)(z.Z,{onClick:function(){return e.setUpdateType(b)},children:"Brand Add"}),(0,Y.jsx)(z.Z,{onClick:function(){return e.setUpdateType(g)},children:"Brand Flip"}),(0,Y.jsx)(z.Z,{onClick:function(){return e.setUpdateType(w)},children:"Clear Dataminer Accounts(Info Evo)"}),(0,Y.jsx)(z.Z,{onClick:function(){return e.setUpdateType(C)},children:"Clear Dataminer Accounts(Incoho)"}),(0,Y.jsx)(z.Z,{onClick:function(){return e.setUpdateType(O)},children:"Clear Dataminer Accounts(School)"}),(0,Y.jsx)(z.Z,{onClick:function(){return e.setUpdateType(x)},children:"Evergreen"}),(0,Y.jsx)(z.Z,{onClick:function(){return e.setUpdateType(y)},children:"MCH - Assign List Managers"}),(0,Y.jsx)(z.Z,{onClick:function(){return e.setUpdateType(m)},children:"MCH - Sponsored Item Flip"}),(0,Y.jsx)(z.Z,{onClick:function(){return e.setUpdateType(_)},children:"School Year"})]})]})}),(0,Y.jsx)(i.Z,{xs:12,children:(0,Y.jsx)(X.Z,{onClick:function(){if(e.updateType){if(e.updateType===O)return J(3,e.setCurrentStep);J(2,e.setCurrentStep)}},children:"Next"})})]}):(0,Y.jsx)(Y.Fragment,{})},$=a(82669),ee=a(69989),te=a(87512),ae=a(57460),ne=a.n(ae),re=a(23157);function oe(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function le(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(a),!0).forEach((function(t){(0,s.Z)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):oe(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var ie=function(){var e=(0,r.useContext)(f),t=(0,te.V)(),a=t.Alert,n=t.showAlert,o=t.hideAlert,s=t.alertProps,c=(0,r.useState)(null),d=c[0],u=c[1],p=(0,r.useState)(""),h=p[0],v=p[1],T=(0,r.useState)(""),S=T[0],P=T[1],Z=(0,r.useState)(""),N=Z[0],F=Z[1],k=(0,r.useState)([]),D=k[0],A=k[1],I=(0,r.useState)(""),U=I[0],E=I[1],M=function(e){return e.map((function(e){return{value:e,label:e}}))},R=function(){switch(e.updateType){case m:return{title:e.updateType,desc:"For Sponsored Item Flips please select the name of the field that corresponds to the school ids in your uploaded csv here."};case y:return{title:e.updateType,desc:"For Assigning List Managers please enter the names of the fields that corresponds to the list header ids and user ids in your uploaded csv here."};case b:return{title:e.updateType,desc:"For Brand Adds please enter the name of the field that corresponds to the list_header ID in your uploaded csv here."};case g:return{title:"Flipping Generic/Competitor Item to Branded Item",desc:"For Brand Flips please select the name of the field that corresponds to the list_header ID in your uploaded csv here."};case _:return{title:"School Year Update",desc:"For School Year Update please select the name of the field that corresponds to the list_header ID in your uploaded csv here."};case x:return{title:"Evergreen Update",desc:"For Evergreen Update please select the name of the field that corresponds to the list_header ID in your uploaded csv here."};case j:return{title:"All Brand Update",desc:"For All Brand Update please select the name of the field that corresponds to the list_header ID in your uploaded csv here."};case w:return{title:"Clear Dataminer Accounts(Info Evo)",desc:"For clearing dataminer accounts please select the name of the field that corresponds to the user_id in your uploaded csv here."};case C:return{title:"Clear Dataminer Accounts(Incoho)",desc:"For clearing dataminer accounts please select the name of the field that corresponds to the user_id in your uploaded csv here."};
1case O:return{title:"Clear Dataminer Accounts(School)",desc:"For clearing dataminer accounts please select the name of the field that corresponds to the user_id in your uploaded csv here."}}}(),q=e.updateType===w||e.updateType===C||e.updateType===O;return 2===e.currentStep?(0,Y.jsxs)(l.Z,{className:"text-center mx-auto d-block",children:[(0,Y.jsx)(i.Z,{xs:12,children:(0,Y.jsx)(a,le({},s))}),(0,Y.jsx)(i.Z,{className:"mb-3",children:(0,Y.jsx)("h3",{children:null===R||void 0===R?void 0:R.title})}),(0,Y.jsx)(i.Z,{className:"mb-3 mx-auto",md:6,children:(0,Y.jsxs)($.Z,{className:"d-flex flex-column",children:[(0,Y.jsx)(i.Z,{className:"mb-4",children:null===R||void 0===R?void 0:R.desc}),(0,Y.jsx)(i.Z,{children:(0,Y.jsx)(ee.Z,{type:"file",id:"fileInput",name:"customFile",label:e.uploadFile||"Choose a csv file",onChange:function(t){o(),t.target.files.length>0&&(u(t.target.files[0]),ne().parse(t.target.files[0],{header:!0,complete:function(t){for(var a,r=t.meta.fields,o=0;o<r.length;o++)for(var l=0;l<r.length;l++)if(o!==l&&r[o]===r[l]){a=o;break}a?n({color:"danger",text:"There are duplicated field names - '".concat(r[a],"'. Please check your CSV file and try again.")}):(A(t.meta.fields),e.setCsvParsedData(t.data))}}))},accept:".csv"})}),(0,Y.jsxs)(i.Z,{className:"mt-2",children:[e.updateType===m&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)("div",{className:"".concat(D.length?"":"d-none"," text-left ml-2"),children:"School Id"}),(0,Y.jsx)(re.ZP,{classNamePrefix:"tl-select",placeholder:"Select a Header",options:M(D),onChange:function(e){o(),v(e.value)}})]}),e.updateType===y&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)("div",{className:"".concat(D.length?"":"d-none"," text-left ml-2"),children:"List Id"}),(0,Y.jsx)(re.ZP,{classNamePrefix:"tl-select",placeholder:"Select a Header",options:M(D),onChange:function(e){o(),P(e.value)}}),(0,Y.jsx)("div",{className:"".concat(D.length?"":"d-none"," text-left ml-2"),children:"User Id"}),(0,Y.jsx)(re.ZP,{classNamePrefix:"tl-select",placeholder:"Select a Header",options:M(D),onChange:function(e){o(),F(e.value)}})]}),(e.updateType===b||e.updateType===g||e.updateType===_||e.updateType===x||e.updateType===j||e.updateType===w||e.updateType===C||e.updateType===O)&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)("div",{className:"".concat(D.length?"":"d-none"," text-left ml-2"),children:q?"User Id":"List Header Id"}),(0,Y.jsx)(re.ZP,{classNamePrefix:"tl-select",placeholder:"Select a Header",value:{value:U,label:U},options:M(D),onChange:function(e){o(),E(e.value)}})]})]})]})}),(0,Y.jsxs)(i.Z,{className:"mb-3",children:[(0,Y.jsx)(X.Z,{className:"mr-2",outline:!0,color:"primary",onClick:function(){o(),J(1,e.setCurrentStep),u(null),A([]),v(""),F(""),P(""),E(""),e.setUploadFile(null),e.setCsvParsedData(null)},children:"Back"}),e.updateType===m||e.updateType===y?(0,Y.jsx)(X.Z,{color:"primary",onClick:function(){if(d&&(h||N&&S)){if(h&&" "===h.charAt(h.length-1))return void n({color:"danger",text:"Please make sure that there`s no space in the school id."});if(N&&S&&" "===N.charAt(N.length-1)||" "===S.charAt(S.length-1))return void n({color:"danger",text:"Please make sure that there's no space in the list id and user id."});o(),J({schoolIdHeader:h,listIdHeader:S,userIdHeader:N},e.setMappedHeaders),J(d,e.setUploadFile),J(5,e.setCurrentStep)}else n({color:"danger",text:"You must fill out all fields and upload a csv in order to continue"})},children:"Update"}):(0,Y.jsx)(X.Z,{className:"mr-2 pl-4 pr-4",color:"primary",onClick:function(){d&&U.length>0||!d&&q?(o(),J(U,e.setMappingKey),d&&J(d.name,e.setUploadFile),J(3,e.setCurrentStep)):n({color:"danger",text:"You must fill out all fields and upload a csv in order to continue"})},children:"Next"})]})]}):(0,Y.jsx)(Y.Fragment,{})},se=a(83789),ce=a(25675),de=a(609),ue=a(81540),pe=a.n(ue),fe=function(e,t){var a=S.filter((function(t){return t.name===e}))[0];return a?a.fields.filter((function(e){return e.name===t}))[0]:null},he=function(e){return S.filter((function(t){return t.name===e}))[0]},ve=function(e){var t="=";return"not-equal"===e&&(t="\u2260"),t},me=function(e,t,a){var n;return"school_year"===t.field?n=a.map((function(e){return{value:e,label:e}})):e&&Array.isArray(e.type)&&(n=e.type.map((function(e){return{value:e,label:e}}))),n},ye=function(e,t){return t.length>2&&e.map((function(e){return"school_year"===e.field&&("prev_year"===e.value?e.value=t[0]:"next_year"===e.value?e.value=t[2]:e.value=t[1]),e})),e},be=function(e){var t,a,n=e.updateType,o=e.rowData,s=e.error,c=e.onClickDel,d=e.onChange,u=(0,r.useContext)(f),p=S.map((function(e){return{value:e.name,label:e.name}}));n!==x&&n!==_&&n!==j&&n!==w&&n!==C||(p=p.filter((function(e){return"list_header"===e.value})));var h=he(o.table).fields.map((function(e){return{value:e.name,label:e.name}}));n!==b&&n!==g||"list_details"!==o.table||(h=h.filter((function(e){return"item_id"===e.value})));var v=fe(o.table,o.field),m=me(v,o,u.schoolYearList),y=n===O,T=n===g&&"list_details"===o.table,P=n===w||n===C||y;return(0,Y.jsxs)(l.Z,{className:"mx-auto mt-1 mb-1 d-flex align-items-center ".concat(s?pe().errorCondition:""),children:[(0,Y.jsx)(X.Z,{className:pe().actionButton,onClick:c,disabled:y,children:(0,Y.jsx)(ce.default,{src:"/brands/icon-minus.png",alt:"Action button",width:"40",height:"40"})}),(0,Y.jsx)(i.Z,{xs:3,className:" p-0",children:(0,Y.jsx)(re.ZP,{value:{value:null===o||void 0===o?void 0:o.table,label:null===o||void 0===o?void 0:o.table},options:p,onChange:function(e){d("table",e)},isDisabled:y})}),(0,Y.jsx)(i.Z,{xs:1,className:" p-0 ".concat(pe().arrow),children:"\u21e8"}),(0,Y.jsx)(i.Z,{xs:3,className:" p-0",children:h&&(0,Y.jsx)(re.ZP,{value:{value:o.field,label:o.field},options:h,onChange:function(e){d("field",e)},isDisabled:y})}),(0,Y.jsx)(i.Z,{xs:T?1:2,className:"pw-1 text-left",children:P?(0,Y.jsx)("span",{children:"not-equal"===o.operator&&y?"is not":"is associated with"}):(0,Y.jsx)(re.ZP,{value:{label:ve(null===o||void 0===o?void 0:o.operator),value:null===o||void 0===o?void 0:o.operator},components:{DropdownIndicator:function(){return null},IndicatorSeparator:function(){return null}},isDisabled:n===g&&"item_id"===o.field,options:[{label:"=",value:"equal"},{label:"\u2260",value:"not-equal"}],onChange:function(e){d("operator",e)}
1})}),(0,Y.jsx)(i.Z,{xs:2,className:" p-0",children:P?(0,Y.jsx)(de.Z,{autoComplete:"off",type:"text",value:null!==(t=o.value)&&void 0!==t?t:"",onChange:function(e){d("value",{value:e.target.value})},disabled:y}):m?(0,Y.jsx)(re.ZP,{value:{value:o.value,label:o.value},options:m,onChange:function(e){d("value",e)}}):(0,Y.jsx)(de.Z,{autoComplete:"off",type:"number"!==(null===v||void 0===v?void 0:v.type)||y?"text":"number",value:null!==(a=o.value)&&void 0!==a?a:"",onChange:function(e){d("value",{value:e.target.value})}})}),T&&(0,Y.jsx)(i.Z,{xs:1,children:(0,Y.jsx)("strong",{children:"OR"})})]})},ge=a(42058);function _e(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function xe(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(a),!0).forEach((function(t){(0,s.Z)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):_e(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var je={table:"list_header",field:"school_year",value:"2022-2023",operator:"equal"},we=function(){var e=(0,te.V)(),t=e.Alert,a=e.showAlert,n=e.hideAlert,o=e.alertProps,c=(0,r.useContext)(f),d=(0,r.useState)([je]),u=d[0],p=d[1],h=(0,r.useState)(),v=h[0],m=h[1],y=function(e,t){var a;e===b?a=P:e===g?a=N:e===_?a=k:e===x?a=A:e===j?a=U:e===w?a=M:e===C?a=q:e===O&&(a=H),a&&p(ye(a,t)),m([])};return(0,r.useEffect)((function(){y(c.updateType,c.schoolYearList)}),[c.updateType,c.schoolYearList]),3===c.currentStep?(0,Y.jsxs)(l.Z,{className:"mx-auto w-100",style:{minWidth:"50rem"},children:[(0,Y.jsx)(i.Z,{xs:12,children:(0,Y.jsx)(t,xe({},o))}),(0,Y.jsxs)(i.Z,{xs:12,className:"mb-3",children:[u.map((function(e,t){var a,n=t<u.length-1&&"list_header"===e.table&&"list_details"===u[t+1].table;return(0,Y.jsxs)(r.Fragment,{children:["list_header"===e.table&&0!==t&&(0,Y.jsx)(l.Z,{className:"mt-1 mb-1 ".concat(pe().andText),children:"AND"}),(0,Y.jsx)(be,{updateType:c.updateType,rowData:e,error:null!==(a=null===v||void 0===v?void 0:v.includes(t))&&void 0!==a&&a,onClickDel:function(){var e=(0,se.Z)(u);e.splice(t,1),p(e)},onChange:function(e,a){return function(e,t,a){var n={table:"",field:"",value:"",operator:"equal"},r=u[a];switch(e){case"table":n={table:t.value,field:"",value:"",operator:"equal"};break;case"field":n=xe(xe({},r),{},{field:t.value,operator:"equal",value:""});break;case"operator":n=xe(xe({},r),{},{operator:t.value,value:""});break;case"value":n=xe(xe({},r),{},{value:t.value})}var o=(0,se.Z)(u);o[a]=n,p(o)}(e,a,t)}},t+e.table),n&&(0,Y.jsx)(l.Z,{className:"mt-1 mb-1 ".concat(pe().andText),children:"AND"})]},t)})),c.updateType===O?(0,Y.jsxs)("p",{className:"text-muted",children:["This update will delete rows from the ",(0,Y.jsx)("code",{children:"teacher_schools"})," table where user_id is associated with Dataminer accounts. The conditions for deletion are based on specific user permissions and email addresses. Please note that these conditions cannot be changed, as the API is designed to handle the deletion of Dataminer users from the ",(0,Y.jsx)("code",{children:"teacher_schools"})," table."]}):(0,Y.jsx)(l.Z,{className:"mx-auto mb-3 d-flex align-items-center",children:(0,Y.jsx)(X.Z,{className:pe().actionButton,onClick:function(){p([].concat((0,se.Z)(u),[je]))},children:(0,Y.jsx)(ce.default,{src:"/brands/icon-plus.png",alt:"Action button",width:"40",height:"40"})})})]}),(0,Y.jsxs)(i.Z,{xs:12,children:[(0,Y.jsx)(X.Z,{className:"mr-2",color:"primary",outline:!0,onClick:function(){J(2,c.setCurrentStep),n(),y(c.updateType,c.schoolYearList),c.updateType===O&&J(1,c.setCurrentStep)},children:"Back"}),(0,Y.jsx)(X.Z,{className:"pl-4 pr-4",color:"primary",onClick:function(){var e=[];if(u.forEach((function(t,a){var n,r;0!==(null===(n=t.value)||void 0===n?void 0:n.toString().length)&&0!==(null===(r=t.field)||void 0===r?void 0:r.length)||e.push(a)})),e.length>0)m(e),a({color:"danger",text:"You must fill out all fields in order to continue"});else{if(n(),0===u.length)return m([]),void a({color:"danger",text:"No conditions have been added. You must add conditions before moving forward."});if(!function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++){if(t!==n&&e[t].table===e[n].table&&e[t].field===e[n].field&&e[t].value===e[n].value&&e[t].operator===e[n].operator)return m([t,n]),a({color:"danger",text:"There are duplicated conditions. Please check the conditions and try again."}),!1;if(c.updateType===w&&t!==n&&e[t].table===e[n].table&&e[t].field===e[n].field&&"teacher_id"===e[t].field)return m([t,n]),a({color:"danger",text:"There are duplicated conditions. This update should have only one condition of teacher_id field."}),!1}return!0}(u))return;if(c.updateType===g){var t=u.filter((function(e){return"list_details"===e.table&&"item_id"===e.field})).map((function(e){return e.value.toString()}));if(0===t.length)return m([]),void a({color:"danger",text:"You must add at least one item id before moving forward."});!function(e,t,a){(0,ge.Z)().get("v1/brandUpdates/".concat(e,"/").concat(t)).then((function(e){a(e,null)})).catch((function(){a(null,"error")}))}("getSponsors",t,(function(e,n){var r={};null===n&&e.data.length===t.length?(e.data.forEach((function(e){r=xe(xe({},r),{},(0,s.Z)({},e.id,e.spon))})),m([]),c.setConditions(u),c.setSponsorItem(r),J(4,c.setCurrentStep)):(!function(e,t,a){var n=e.map((function(e){return e.id.toString()})),r=t.filter((function(e){return!n.includes(e)}));if(r.length>0){for(var o=[],l=0;l<a.length;l++)"list_details"===a[l].table&&"item_id"===a[l].field&&r.includes(a[l].value)&&o.push(l);m(o)}}(e.data,t,u),a({color:"danger",text:"Your items do not have sponsored alternative. Please check the item id and try again."}))}))}else m([]),c.updateType===O?c.setActions([B[0]]):c.setConditions(u),J(c.updateType===O?5:4,c.setCurrentStep)}},children:c.updateType===O?"Delete":"Next"})]})]}):(0,Y.jsx)(Y.Fragment,{})},Ce=a(72679),Oe=a.n(Ce),Te=function(e){var t=e.updateType,a=e.rowData,n=e.sponData,o=e.error,l=e.onClickDel,i=e.onCh
1ange,s=(0,r.useContext)(f),c=S.map((function(e){return{value:e.name,label:e.name}}));t!==g&&t!==_&&t!==w&&t!==j&&t!==C||(c=c.filter((function(e){return"list_header"===e.value})));var d=he(a.table).fields.map((function(e){return{value:e.name,label:e.name}}));t===b&&"list_details"===a.table&&(d=d.filter((function(e){return"item_id"===e.value})));var u,p=fe(a.table,a.field),h=me(p,a,s.schoolYearList),v=[{value:"modified_date",label:"modified_date"}];if(a.andField){var m=fe(a.table,a.andField.field);m&&Array.isArray(m.type)&&(u=m.type.map((function(e){return{value:e,label:e}})))}var y=t===g&&"item_id"===a.field;return(0,Y.jsxs)("div",{className:"mb-3 d-flex align-items-center ".concat(o?Oe().errorCondition:""),children:[(0,Y.jsxs)("div",{className:"d-flex p-0 align-items-center ".concat(Oe().fieldWrap),children:[(0,Y.jsx)(X.Z,{className:Oe().actionButton,onClick:l,children:(0,Y.jsx)(ce.default,{src:"/brands/icon-minus.png",alt:"Action button",width:"40",height:"40"})}),(0,Y.jsx)(re.ZP,{className:Oe().selectField,value:{value:null===a||void 0===a?void 0:a.table,label:null===a||void 0===a?void 0:a.table},options:c,onChange:function(e){i("table",e)}})]}),(0,Y.jsxs)("div",{className:"d-flex p-0 ml-3 align-items-center",children:[(0,Y.jsx)("div",{className:Oe().actionWrap,children:"add"===a.action?"Add":"Update to"}),function(){var e;return y?(0,Y.jsx)(de.Z,{className:"ml-2 ".concat(Oe().selectField),disabled:y,autoComplete:"off",type:"number",value:null!==(e=a.value)&&void 0!==e?e:""}):d?(0,Y.jsx)(re.ZP,{className:"ml-2 ".concat(Oe().longSelectField),value:{value:a.field,label:a.field},options:d,onChange:function(e){i("field",e)}}):void 0}()]}),(0,Y.jsxs)("div",{className:"d-flex p-0 ml-3 align-items-center",children:["=",h?(0,Y.jsx)(re.ZP,{className:"ml-2 ".concat(Oe().selectField),value:{value:a.value,label:a.value},options:h,onChange:function(e){i("value",e)}}):(0,Y.jsx)(de.Z,{className:"ml-2 ".concat(Oe().selectField),autoComplete:"off",disabled:y,type:"number"===(null===p||void 0===p?void 0:p.type)?"number":"text",value:function(){var e,t;return y?n?n[null!==(t=a.value)&&void 0!==t?t:""]:"":null!==(e=a.value)&&void 0!==e?e:""}(),onChange:function(e){i("value",{value:e.target.value})}})]}),a.andField&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)("div",{className:"d-flex p-0 ml-3 align-items-center",children:["AND",v&&(0,Y.jsx)(re.ZP,{className:"ml-2 ".concat(Oe().selectField),value:{value:a.andField.field,label:a.andField.field},options:v,onChange:function(e){i("andField",e)}})]}),(0,Y.jsxs)("div",{className:"d-flex p-0 ml-3 align-items-center",children:["=",u&&(0,Y.jsx)(re.ZP,{className:"ml-2 ".concat(Oe().selectField),value:{value:a.andField.value,label:a.andField.value},options:u,onChange:function(e){i("andValue",e)}})]})]})]})};function Se(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function Pe(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?Se(Object(a),!0).forEach((function(t){(0,s.Z)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Se(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var Ze={table:"list_header",field:"modifier_id",value:"155299",action:"update"},Ne={table:"list_details",field:"item_id",value:"12",action:"add",andField:{field:"modified_date",value:"current-date"}},Fe=function(){var e=(0,te.V)(),t=e.Alert,a=e.showAlert,n=e.hideAlert,o=e.alertProps,s=(0,r.useContext)(f),c=(0,r.useState)([Ne]),d=c[0],u=c[1],p=(0,r.useState)(),h=p[0],v=p[1],m=function(e,t,a){var n;if(e===b&&(n=Z),e===g){var r=t.filter((function(e){return"list_details"===e.table&&"item_id"===e.field})).map((function(e){return e.value})).map((function(e){return Pe(Pe({},Ne),{},{action:"update",value:e})}));n=[].concat((0,se.Z)(F),(0,se.Z)(r))}e===_&&(n=D),e===x&&(n=I),e===j&&(n=E),e===w&&(n=R),e===C&&(n=L),n&&u(ye(n,a))};return(0,r.useEffect)((function(){m(s.updateType,s.conditions,s.schoolYearList)}),[s.updateType,s.conditions]),4===s.currentStep?(0,Y.jsxs)(l.Z,{className:"mx-auto w-100",style:{minWidth:"50rem"},children:[(0,Y.jsx)(i.Z,{xs:12,children:(0,Y.jsx)(t,Pe({},o))}),(0,Y.jsxs)("div",{className:"mb-3 mx-auto",children:[d.map((function(e,t){var a;return(0,Y.jsx)(Te,{updateType:s.updateType,rowData:e,error:null!==(a=null===h||void 0===h?void 0:h.includes(t))&&void 0!==a&&a,sponData:s.sponsorItem,onClickDel:function(){var e=(0,se.Z)(d);e.splice(t,1),u(e)},onChange:function(e,a){return function(e,t,a){var n={table:"",field:"",value:"",action:"update"},r={field:"modified_date",value:"current-date"},o=d[a];switch(e){case"table":n={table:t.value,field:"",value:"",action:"list_header"===t.value?"update":"add",andField:"list_details"===t.value?r:void 0};break;case"field":n=Pe(Pe({},o),{},{field:t.value,value:""});break;case"value":n=Pe(Pe({},o),{},{value:t.value});break;case"andField":case"andValue":n=Pe(Pe({},o),{},{andField:r})}var l=(0,se.Z)(d);l[a]=n,u(l)}(e,a,t)}},t+e.table)})),(0,Y.jsx)(l.Z,{className:"mx-auto mb-3 d-flex align-items-center",children:(0,Y.jsx)(X.Z,{className:Oe().actionButton,onClick:function(){u([].concat((0,se.Z)(d),[Ze]))},children:(0,Y.jsx)(ce.default,{src:"/brands/icon-plus.png",alt:"Action button",width:"40",height:"40"})})})]}),(0,Y.jsxs)(i.Z,{xs:12,children:[(0,Y.jsx)(X.Z,{className:"mr-2",color:"primary",outline:!0,onClick:function(){J(3,s.setCurrentStep),m(s.updateType,s.conditions,s.schoolYearList),n()},children:"Back"}),(0,Y.jsx)(X.Z,{className:"pl-4 pr-4",color:"primary",onClick:function(){var e=[];d.forEach((function(t,a){var n,r,o,l,i;0!==(null===(n=t.value)||void 0===n?void 0:n.toString().length)&&0!==(null===(r=t.field)||void 0===r?void 0:r.length)&&0!==(null===(o=t.andField)||void 0===o?void 0:o.field.length)&&0!==(null===(l=t.andField)||void 0===l||null===(i=l.value)||void 0===i?void 0:i.toString().length)||e.push(a)})),e.length>0?(v(e),a({color:"danger",text:"You must fill out all fields in order to continue"})):function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++){if(t!==n&&e[t].table===e[n].table&&e[t].field===e[n].field&&e[t].value===e[n].value&&e[t].operator===e[n].operator)return v([t,n]),a({color:"danger",text:"There are duplicated actions. Please check the actions and try again."}),!1;if((s.updateType===w||s.updateType===C)&&t!==n&&e[t].table===e[n].table&&e[t].field===e[n].field&&"teacher_id"===e[t].field)return v([t,n]),a({color:"danger",text:"There are duplicated actions. This update should have only one action of teacher_id field."}),!1}return!0}(d)&&(s.setActions(d),J(5,s.setCurrentStep))},children:"Update"})]})]}):(0,Y.jsx)(Y.Fragment,{})},ke=a(36955),De=a(83461);function Ae(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function Ie(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};
1t%2?Ae(Object(a),!0).forEach((function(t){(0,s.Z)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Ae(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var Ue=function(){var e=(0,r.useContext)(f),t=(0,r.useState)(!1),a=t[0],n=t[1],o=(0,te.V)(),s=o.Alert,c=o.showAlert,d=o.alertProps,u=new Date(Date.now()),p=(0,r.useMemo)((function(){return e.updateType===O}),[e.updateType]),h=(0,r.useMemo)((function(){var t={removedUsers:"",notRemovedUsers:""};return p&&e.downloadFile&&"string"!==typeof e.downloadFile?(t.removedUsers=e.downloadFile.removedUsers,t.notRemovedUsers=e.downloadFile.notRemovedUsers,t):t}),[e.downloadFile,p]),v=h.removedUsers,m=h.notRemovedUsers;return(0,r.useEffect)((function(){e.error&&c({color:"danger",text:e.errorMessage?e.errorMessage:"An error has occurred, please verify the format of your CSV and try again."})}),[e.error,e.errorMessage]),(0,r.useEffect)((function(){p&&"string"!==typeof e.downloadFile&&e.downloadFile.notRemovedUsers&&c({color:"warning",text:"For some reason, not all users were removed. Therefore, we provide two separate CSV files: one for removed teacher schools and one for not removed teacher schools."})}),[p,e.downloadFile]),5===e.currentStep?(0,Y.jsxs)(l.Z,{className:"text-center mx-auto",children:[(0,Y.jsx)(i.Z,{xs:12,children:(0,Y.jsx)(s,Ie({},d))}),(0,Y.jsx)(i.Z,{xs:12,className:"mb-3",children:(0,Y.jsx)("h3",{children:e.updateType})}),(0,Y.jsx)(i.Z,{xs:12,className:"mb-3",children:e.error?(0,Y.jsx)(Y.Fragment,{}):e.totalRecords||p&&e.downloadFile?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)("div",{className:"mb-3 font-weight-bold",children:["There were ",e.totalRecords," ",p?"teacher schools removed":"lists updated"]}),"string"===typeof e.downloadFile?(0,Y.jsx)(De.CSVLink,{onClick:function(){n(!0)},data:e.downloadFile,filename:"".concat(e.updateType,"-results-").concat(u.getFullYear(),"-").concat(u.getMonth()+1,"-").concat(u.getDate(),".csv"),className:"btn btn-primary",children:"Download Your CSV"}):(0,Y.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"1rem"},children:[v&&(0,Y.jsx)(De.CSVLink,{onClick:function(){n(!0)},data:v,filename:"".concat(e.updateType,"-results-").concat(u.getFullYear(),"-").concat(u.getMonth()+1,"-").concat(u.getDate(),".csv"),className:"btn btn-primary",children:"Download CSV with removed teacher schools"}),m&&(0,Y.jsx)(De.CSVLink,{onClick:function(){n(!0)},data:m,filename:"".concat(e.updateType,"-results-").concat(u.getFullYear(),"-").concat(u.getMonth()+1,"-").concat(u.getDate(),".csv"),className:"btn btn-primary",children:"Download CSV with not removed teacher schools"})]})]}):(0,Y.jsx)(ke.Z,{})}),(0,Y.jsx)(i.Z,{xs:12,children:(0,Y.jsx)(X.Z,{onClick:function(){!a&&e.downloadFile?window.confirm("Are you sure you want to perform another update without downloading your results first?")&&(window.location.href=window.location.href):window.location.href=window.location.href},children:"Perform Another Update"})})]}):null},Ee=function(){var e=(0,ge.Z)(),t=(0,r.useState)(1),a=t[0],s=t[1],c=(0,r.useState)(""),d=c[0],u=c[1],f=(0,r.useState)(""),h=f[0],v=f[1],S=(0,r.useState)(""),P=S[0],Z=S[1],N=(0,r.useState)(!1),F=N[0],k=N[1],D=(0,r.useState)(""),A=D[0],I=D[1],U=(0,r.useState)({}),E=U[0],M=U[1],R=(0,r.useState)(0),q=R[0],L=R[1],H=(0,r.useState)([]),B=H[0],K=H[1],W=(0,r.useState)(""),G=W[0],z=W[1],X=(0,r.useState)([]),J=X[0],$=X[1],ee=(0,r.useState)([]),te=ee[0],ae=ee[1],ne=(0,r.useState)([]),re=ne[0],oe=ne[1],le=(0,r.useState)({}),se=le[0],ce=le[1],de=function(t){e.post("v1/brandUpdates/".concat(t,"?schoolIdHeader=").concat(E.schoolIdHeader,"&listIdHeader=").concat(E.listIdHeader,"&userIdHeader=").concat(E.userIdHeader),h).then((function(e){e.data.nothingToUpdate?(k(!0),I("There were no list headers affected by your request. Please ensure you are using the correct ".concat(d===m?"school ids, and school year, entry method":"list ids and user ids"))):e.data.noResults?(k(!0),I("The items in this request are already updated. Please try with different data.")):(k(!1),Z(e.data.csvResults),L(e.data.totalResults))})).catch((function(){k(!0)}))},ue=(0,r.useCallback)((function(){var t=J?J.map((function(e){return e[G]})).filter((function(e){return e&&null!==e&&e.length>0})):[];if(d!==w&&d!==C&&d!==O&&(!t||0===t.length))return k(!0),void I("CSV parse failed. Try again!");var a=function(e){if(e.data.nothingToUpdate){var a=d===O?"Not found any incoho, info-evo, dataminer accounts in the teacher schools. ".concat(t.length?"Please check your csv data and try again":""):"There were no list headers affected by your request. Please ensure you are using the correct list ids";k(!0),I(a)}else e.data.noResults?(k(!0),I("The items in this request are already updated. Please try with different data.")):(k(!1),Z(e.data.csvResults),L(e.data.totalResults))};d===b&&e.post("v1/brandUpdates/brandAdd",{listHeaderIds:t,conditions:te,actions:re}).then((function(e){a(e)})).catch((function(){k(!0)})),d===g&&e.post("v1/brandUpdates/brandFlip",{listHeaderIds:t,conditions:te,actions:re,sponItem:se}).then((function(e){a(e)})).catch((function(){k(!0)})),d===_&&e.post("v1/brandUpdates/schoolYear",{listHeaderIds:t,conditions:te,actions:re}).then((function(e){a(e)})).catch((function(){k(!0)})),d===x&&e.post("v1/brandUpdates/evergreen",{listHeaderIds:t,conditions:te,actions:re}).then((function(e){a(e)})).catch((function(){k(!0)})),d===j&&e.post("v1/brandUpdates/allBrand",{listHeaderIds:t,conditions:te,actions:re}).then((function(e){a(e)})).catch((function(){k(!0)})),d!==w&&d!==C||e.post("v1/brandUpdates/clearDataminer",{userIds:t,conditions:te,actions:re},{timeout:24e5}).then((function(e){a(e)})).catch((function(e){k(!0)})),d===O&&e.post("v1/brandUpdates/clearDataminer/schools").then((function(e){a(e)})).catch((function(){k(!0)}))}),[re,te,J,e,G,se,d]);return(0,r.useEffect)((function(){h&&(d===m&&de("sponsoredItemsBySchoolsFlip"),d===y&&de("updateListManagers"))}),[h]),(0,r.useEffect)((function(){T.includes(d)&&ue()}),[re]),(0,r.useEffect)((function(){e.get("v1/school/current-year").then((function(e){var t=e.data.school_year,a=t.split("-"),r=(0,n.Z)(a,2),o=r[0],l=r[1],i="".concat(Number(o)-1,"-").concat(Number(l)-1),s="".concat(Number(l),"-").concat(Number(l)+1);K([i,t,s])})).catch((function(){console.log("current school year is not existing.")}))}),[]),(0,Y.jsx)(p,{value:{currentStep:a,updateType:d,uploadFile:h,downloadFile:P,error:F,errorMessage:A,mappedHeaders:E,totalRecords:q,mappingKey:G,csvParsedData:J,conditions:te,actions:re,sponsorItem:se,schoolYearList:B,setCurrentStep:s,setUpdateType:u,setUploadFile:v,setDownloadFile:Z,setError:k,setErrorMessage:I,setMappedHeaders:M,setTotalRecords:L,setMappingKey:z,setCsvParsedData:$,setConditions:ae,setActions:oe,setSponsorItem:ce,setSchoolYearList:K},children:(0,Y.jsxs)(o.Z,{children:[(0,Y.jsx)(l.Z,{className:"text-center",children:(0,Y.jsx)(i.Z,{children:(0,Y.jsx)("h1",{className:"font-weight-bold",children:"Database Update Tool"})})}),(0,Y.jsxs)(l.Z,{className:"text-center",children:[(0,Y.jsx)(V,{}),(0,Y.jsx)(Q,{}),(0,Y.jsx)(ie,{}),(0,Y.jsx)(we,{}),(0,Y.jsx)(Fe,{}),(0,Y.jsx)(Ue,{})]})]})})},Me=a(9008),Re=function(){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(Me.default,{children:[(0,Y.jsx)("title",{children:"Brand Upd
1ate"}),(0,Y.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,Y.jsx)(Ee,{})]})};Re.isAdminPage=!0;var qe=!0,Le=Re},87512:function(e,t,a){"use strict";a.d(t,{V:function(){return c}});var n=a(67294),r=a(17834),o=a(51436),l=a(67814),i=a(85893),s=function(e){var t=e.color,a=e.isOpen,s=e.text,c=e.autoHideDelay,d=e.hideAlert;return(0,n.useEffect)((function(){if(c){var e=setTimeout((function(){return d()}),c);return function(){return clearTimeout(e)}}}),[e]),(0,i.jsx)(r.Z,{color:t,isOpen:a,children:(0,i.jsxs)("div",{className:"d-flex justify-content-between",children:[(0,i.jsx)("div",{children:s}),(0,i.jsx)("div",{className:"pl-2 clickable",onClick:function(){return d()},children:(0,i.jsx)(l.G,{icon:o.NBC})})]})})};function c(){var e=(0,n.useState)(!1),t=e[0],a=e[1],r=(0,n.useState)("success"),o=r[0],l=r[1],i=(0,n.useState)(""),c=i[0],d=i[1],u=(0,n.useState)(0),p=u[0],f=u[1],h=function(){a(!1)};return{showAlert:(0,n.useCallback)((function(e){var t=e.color,n=void 0===t?"success":t,r=e.text,o=e.closeDelay,i=void 0===o?0:o;r&&(a(!0),l(n),d(r),f(i))}),[]),hideAlert:h,alertProps:{isOpen:t,text:c,color:o,autoHideDelay:p,hideAlert:h},Alert:s}}},40572:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/brands/brandUpdate",function(){return a(16652)}])},45769:function(e){e.exports={stepTitle:"brandUpdate_stepTitle__2tj__",dot:"brandUpdate_dot__1QSM3",active:"brandUpdate_active__1d2Lx",highlighted:"brandUpdate_highlighted__3GZHD"}},72679:function(e){e.exports={arrow:"MapInputRow_arrow__srVOz",actionButton:"MapInputRow_actionButton__2GeN2",selectField:"MapInputRow_selectField__3GFlG",longSelectField:"MapInputRow_longSelectField__3TRl8",actionWrap:"MapInputRow_actionWrap__1y8EC",errorCondition:"MapInputRow_errorCondition__zb3lK"}},81540:function(e){e.exports={arrow:"MapInputRow_arrow__pIcAv",actionButton:"MapInputRow_actionButton__2pULY",errorCondition:"MapInputRow_errorCondition__2akn7",andText:"MapInputRow_andText__rANl0"}},83461:function(e,t,a){e.exports=a(5090)},89469:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,r=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}(),o=a(67294),l=(n=o)&&n.__esModule?n:{default:n},i=a(99182),s=a(69695);var c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.state={},a}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"buildURI",value:function(){return i.buildURI.apply(void 0,arguments)}},{key:"componentDidMount",value:function(){var e=this.props,t=e.data,a=e.headers,n=e.separator,r=e.enclosingCharacter,o=e.uFEFF,l=e.target,i=e.specs,s=e.replace;this.state.page=window.open(this.buildURI(t,o,a,n,r),l,i,s)}},{key:"getWindow",value:function(){return this.state.page}},{key:"render",value:function(){return null}}]),t}(l.default.Component);c.defaultProps=Object.assign(s.defaultProps,{target:"_blank"}),c.propTypes=s.propTypes,t.default=c},26425:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},o=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}(),l=a(67294),i=(n=l)&&n.__esModule?n:{default:n},s=a(99182),c=a(69695);var d=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.buildURI=a.buildURI.bind(a),a.state={href:""},a}
1return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.data,a=e.headers,n=e.separator,r=e.uFEFF,o=e.enclosingCharacter;this.setState({href:this.buildURI(t,r,a,n,o)})}},{key:"componentDidUpdate",value:function(e){if(this.props!==e){var t=this.props,a=t.data,n=t.headers,r=t.separator,o=t.uFEFF;this.setState({href:this.buildURI(a,o,n,r)})}}},{key:"buildURI",value:function(){return s.buildURI.apply(void 0,arguments)}},{key:"handleLegacy",value:function(e){if(window.navigator.msSaveOrOpenBlob){e.preventDefault();var t=this.props,a=t.data,n=t.headers,r=t.separator,o=t.filename,l=t.enclosingCharacter,i=t.uFEFF,c=new Blob([i?"\ufeff":"",(0,s.toCSV)(a,n,r,l)]);return window.navigator.msSaveBlob(c,o),!1}}},{key:"handleAsyncClick",value:function(e){var t=this;this.props.onClick(e,(function(a){!1!==a?t.handleLegacy(e):e.preventDefault()}))}},{key:"handleSyncClick",value:function(e){!1===this.props.onClick(e)?e.preventDefault():this.handleLegacy(e)}},{key:"handleClick",value:function(){var e=this;return function(t){if("function"===typeof e.props.onClick)return e.props.asyncOnClick?e.handleAsyncClick(t):e.handleSyncClick(t);e.handleLegacy(t)}}},{key:"render",value:function(){var e=this,t=this.props,a=(t.data,t.headers,t.separator,t.filename),n=(t.uFEFF,t.children),o=(t.onClick,t.asyncOnClick,t.enclosingCharacter,function(e,t){var a={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(a[n]=e[n]);return a}(t,["data","headers","separator","filename","uFEFF","children","onClick","asyncOnClick","enclosingCharacter"]));return i.default.createElement("a",r({download:a},o,{ref:function(t){return e.link=t},target:"_self",href:this.state.href,onClick:this.handleClick()}),n)}}]),t}(i.default.Component);d.defaultProps=c.defaultProps,d.propTypes=c.propTypes,t.default=d},99182:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function n(e){if(Array.isArray(e)){for(var t=0,a=Array(e.length);t<e.length;t++)a[t]=e[t];return a}return Array.from(e)}var r=t.isSafari=function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},o=t.isJsons=function(e){return Array.isArray(e)&&e.every((function(e){return"object"===("undefined"===typeof e?"undefined":a(e))&&!(e instanceof Array)}))},l=t.isArrays=function(e){return Array.isArray(e)&&e.every((function(e){return Array.isArray(e)}))},i=t.jsonsHeaders=function(e){return Array.from(e.map((function(e){return Object.keys(e)})).reduce((function(e,t){return new Set([].concat(n(e),n(t)))}),[]))},s=t.jsons2arrays=function(e,t){var a=t=t||i(e),r=t;o(t)&&(a=t.map((function(e){return e.label})),r=t.map((function(e){return e.key})));var l=e.map((function(e){return r.map((function(t){return c(t,e)}))}));return[a].concat(n(l))},c=t.getHeaderValue=function(e,t){var a=e.replace(/\[([^\]]+)]/g,".$1").split(".").reduce((function(e,t,a,n){if(void 0!==e[t])return e[t];n.splice(1)}),t);return void 0===a?e in t?t[e]:"":a},d=t.elementOrEmpty=function(e){return e||0===e?e:""},u=t.joiner=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:'"';return e.filter((function(e){return e})).map((function(e){return e.map((function(e){return d(e)})).map((function(e){return""+a+e+a})).join(t)})).join("\n")},p=t.arrays2csv=function(e,t,a,r){return u(t?[t].concat(n(e)):e,a,r)},f=t.jsons2csv=function(e,t,a,n){return u(s(e,t),a,n)},h=t.string2csv=function(e,t,a,n){return t?t.join(a)+"\n"+e:e},v=t.toCSV=function(e,t,a,n){if(o(e))return f(e,t,a,n);if(l(e))return p(e,t,a,n);if("string"===typeof e)return h(e,t,a);throw new TypeError('Data should be a "String", "Array of arrays" OR "Array of objects" ')};t.buildURI=function(e,t,a,n,o){var l=v(e,a,n,o),i=r()?"application/csv":"text/csv",s=new Blob([t?"\ufeff":"",l],{type:i}),c="data:"+i+";charset=utf-8,"+(t?"\ufeff":"")+l,d=window.URL||window.webkitURL;return"undefined"===typeof d.createObjectURL?c:d.createObjectURL(s)}},5090:function(e,t,a){"use strict";t.CSVLink=void 0;var n=o(a(89469)),r=o(a(26425));
1function o(e){return e&&e.__esModule?e:{default:e}}n.default,t.CSVLink=r.default},69695:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PropsNotForwarded=t.defaultProps=t.propTypes=void 0;var n,r=a(67294),o=((n=r)&&n.__esModule,a(45697));t.propTypes={data:(0,o.oneOfType)([o.string,o.array]).isRequired,headers:o.array,target:o.string,separator:o.string,filename:o.string,uFEFF:o.bool,onClick:o.func,asyncOnClick:o.bool},t.defaultProps={separator:",",filename:"generatedBy_react-csv.csv",uFEFF:!0,asyncOnClick:!1},t.PropsNotForwarded=["data","headers"]},69638:function(e,t,a){"use strict";var n=a(87462),r=a(63366),o=a(4942),l=a(67294),i=a(45697),s=a.n(i),c=a(94184),d=a.n(c),u=a(793),p=a(23663);function f(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function h(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?f(Object(a),!0).forEach((function(t){(0,o.Z)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):f(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var v=h(h({},u.Transition.propTypes),{},{children:s().oneOfType([s().arrayOf(s().node),s().node]),tag:p.tagPropType,baseClass:s().string,baseClassActive:s().string,className:s().string,cssModule:s().object,innerRef:s().oneOfType([s().object,s().string,s().func])}),m=h(h({},u.Transition.defaultProps),{},{tag:"div",baseClass:"fade",baseClassActive:"show",timeout:p.TransitionTimeouts.Fade,appear:!0,enter:!0,exit:!0,in:!0});function y(e){var t=e.tag,a=e.baseClass,o=e.baseClassActive,i=e.className,s=e.cssModule,c=e.children,f=e.innerRef,h=(0,r.Z)(e,["tag","baseClass","baseClassActive","className","cssModule","children","innerRef"]),v=(0,p.pick)(h,p.TransitionPropTypeKeys),m=(0,p.omit)(h,p.TransitionPropTypeKeys);return l.createElement(u.Transition,v,(function(e){var r="entered"===e,u=(0,p.mapToCssModules)(d()(i,a,r&&o),s);return l.createElement(t,(0,n.Z)({className:u},m,{ref:f}),c)}))}y.propTypes=v,y.defaultProps=m,t.Z=y},36955:function(e,t,a){"use strict";var n=a(87462),r=a(63366),o=a(67294),l=a(45697),i=a.n(l),s=a(94184),c=a.n(s),d=a(23663),u={tag:d.tagPropType,type:i().string,size:i().string,color:i().string,className:i().string,cssModule:i().object,children:i().string},p=function(e){var t=e.className,a=e.cssModule,l=e.type,i=e.size,s=e.color,u=e.children,p=e.tag,f=(0,r.Z)(e,["className","cssModule","type","size","color","children","tag"]),h=(0,d.mapToCssModules)(c()(t,!!i&&"spinner-"+l+"-"+i,"spinner-"+l,!!s&&"text-"+s),a);return o.createElement(p,(0,n.Z)({role:"status"},f,{className:h}),u&&o.createElement("span",{className:(0,d.mapToCssModules)("sr-only",a)},u))};p.propTypes=u,p.defaultProps={tag:"div",type:"border",children:"Loading..."},t.Z=p}},function(e){e.O(0,[2608,9774,2888,6377],(function(){return t=40572,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.