PageSourceSearch

https://app.sandboxcommerce.com/static/js/4088.d9765640.chunk.js

js sandboxcommerce.com collected 2026-09-25 18:48:34 UTC 85,523 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunksandbox_app_builder_ts=self.webpackChunksandbox_app_builder_ts||[]).push([[4088],{17781:function(e,t,n){n.r(t),n.d(t,{fetchAbandonedCartGraphDataAdmin:function(){return d},fetchGraphDataAdmin:function(){return r},fetchLastLoggedInGraphDataAdmin:function(){return c},fetchOrderDataAdmin:function(){return p},fetchPaginatedFilteredData:function(){return i},fetchSessionGraphDataAdmin:function(){return l},getAppsByPage:function(){return s},getTrendingItemsAdmin:function(){return a}});var o=n(43303);function s(e,t,n,s){return function(){var i=o.H+"/app/fetchAppsByPage",a={page:e,pageSkip:t},r={headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem("jwtToken")},method:"post",body:JSON.stringify(a)};fetch(i,r).then((function(e){return e.json()})).then((function(t){s&&(n?s(e,t.users,t.total):s(e,t.users))})).catch((function(e){throw alert("There was an error with your request."),e}))}}function i(e,t,n,s,i,a,r){return function(){var p=o.H+"/app/fetchPaginatedFilteredApps",l={pageSize:e,page:t,sorted:n,searchTerm:s,customerMode:i,archiveMode:a,socialMode:!1},d={headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem("jwtToken")},method:"post",body:JSON.stringify(l)};fetch(p,d).then((function(e){return e.json()})).then((function(e){r&&r(e)})).catch((function(e){throw alert("There was an error with your request."),e}))}}function a(e,t){return function(){var n=o.H+"/app/fetch",s={appId:e,adminMode:!0},i={headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem("jwtToken")},method:"post",body:JSON.stringify(s)};fetch(n,i).then((function(e){return e.json()})).then((function(e){t&&t(e)})).catch((function(e){throw alert("There was an error with your request.  (Trending)"),e}))}}function r(e,t,n){return function(){var s=o.H+"/app/fetchGraphData",i={appId:e,range:t,adminMode:!0},a={headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem("jwtToken")},method:"post",body:JSON.stringify(i)};fetch(s,a).then((function(e){return e.json()})).then((function(e){n&&n(e,t)})).catch((function(e){throw e}))}}function p(e,t){return function(){var n=o.H+"/payment/getReviewInfo",s={appId:e,adminMode:!0},i={headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem("jwtToken")},method:"post",body:JSON.stringify(s)};fetch(n,i).then((function(e){return e.json()})).then((function(e){t&&t(e)})).catch((function(e){throw e}))}}function l(e,t,n){return function(){var s=o.H+"/app/fetchSessionGraphData",i={appId:e,range:t,adminMode:!0},a={headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem("jwtToken")},method:"post",body:JSON.stringify(i)};fetch(s,a).then((function(e){return e.json()})).then((function(e){n&&n(e,t)})).catch((function(e){throw e}))}}function d(e,t,n){return function(){var s=o.H+"/app/fetchAbandonedCartGraphData",i={appId:e,range:t,adminMode:!0},a={headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem("jwtToken")},method:"post",body:JSON.stringify(i)};fetch(s,a).then((function(e){return e.json()})).then((function(e){n&&n(e,t)})).catch((function(e){throw e}))}}function c(e,t,n){return function(){var s=o.H+"/app/fetchLastLoggedInGraphData",i={appId:e,range:t,adminMode:!0},a={headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem("jwtToken")},method:"post",body:JSON.stringify(i)};fetch(s,a).then((function(e){return e.json()})).then((function(e){n&&n(e,t)})).catch((function(e){throw e}))}}},13095:function(e,t,n){n.r(t),n.d(t,{fetchAppEvents:function(){return i},fetchLatestEvents:function(){return a},fetchUserEvents:function(){return s}});var o=n(43303);function s(e,t){return function(){var n=o.H+"/event/fetchUserEvents",s={userId:e},i={headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem("jwtToken")},method:"post",body:JSON.stringify(s)};fetch(n,i).then((function(e){return e.json()})).then((function(e){t&&t(e)})).catch((function(e){throw alert("There was an error with your request."),e}))}}function i(e,t){return function(){var n=o.H+"/event/fetchEventsByApp",s={appId:e},i={headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem("jwtToken")},method:"post",body:JSON.stringify(s)};fetch(n,i).then((function(e){return e.json()})).then((function(e){t&&t(e)})).catch((function(e){throw alert("There was an error with your request."),e}))}}function a(e,t,n){return function(){var s=o.H+"/event/fetchLatestEvents",i={userId:e,timeStamp:t},a={headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem("jwtToken")},method:"post",body:JSON.stringify(i)};fetch(s,a).then((function(e){return e.json()})).then((function(e){n&&n(e)})).catch((function(e){throw alert("There was an error with your request."),e}))}}},4088:function(e,t,n){n.r(t);var o=n(15671),s=n(43144),i=n(97326),a=n(60136),r=n(29388),p=n(1413),l=n(53174),d=n(54483),c=n(32839),h=n(40182),u=n(47787),f=n(64802),m=n(95587),S=n.n(m),g=n(72791),A=n(89743),E=n(2677),y=n(65627),T=n(21885),F=n(323),I=n(74292),N=n(79745),x=n.n(N),O=n(60364),C=n(79271),M=n(71358),P=n(87781),v=(n(26502),n(64914),n(17781)),j=n(815),w=n(13095),b=n(43303),k=n(90114),R=n(38441),L=n(80184),$=n(21830),D=n(72426),B=n(92516);navigator.userAgent.match(/iPad/i);function W(e){var t=e.columns,n=e.data,o=e.pageManual,s=e.pageSizeManual,i=e.pageCount,a=e.onPageChange,r=e.onPageSizeChange,l=e.loading,d=(0,M.useTable)({columns:t,data:n,initialState:{pageIndex:o,pageSize:s},manualPagination:!0,pageCount:i},M.useSortBy,M.usePagination),c=d.getTableProps,h=d.getTableBodyProps,u=d.headerGroups,f=d.prepareRow,m=d.page,S=d.canPreviousPage,g=d.canNextPage,y=d.pageOptions,T=(d.pageCount,d.gotoPage),F=d.nextPage,I=d.previousPage,N=d.setPageSize,x=(d.sortBy,d.state),O=x.pageIndex,C=x.pageSize;return(0,L.jsxs)("div",{style:{width:"100%",position:"relative",textAlign:"center"},children:[(0,L.jsx)("div",{style:{fontFamily:"Inter",padding:10,backgroundColor:"#FFFFFF",borderRadius:4,border:"1px solid #E7E7E7",overflowY:"scroll",height:500},children:(0,L.jsxs)("table",(0,p.Z)((0,p.Z)({},c()),{},{style:{width:"100%",borderRadius:10,marginRight:10},children:[(0,L.jsx)("thead",{children:u.map((function(e){return(0,L.jsx)("tr",(0,p.Z)((0,p.Z)({},e.getHeaderGroupProps()),{},{children:e.headers.map((function(e){return(0,L.jsx)("th",(0,p.Z)((0,p.Z)({},e.getHeaderProps()),{},{style:{borderStyle:"none",padding:"5px 15px",borderWidth:0,backgroundColor:"#F7F8FA",minWidth:150},children:e.render("Header")}))}))}))}))}),(0,L.jsx)("tbody",(0,p.Z)((0,p.Z)({},h()),{},{children:m.map((function(e,t){return f(e),(0,L.jsx)("tr",(0,p.Z)((0,p.Z)({},e.getRowProps()),{},{children:e.cells.map((function(e){return(0,L.jsx)("td",(0,p.Z)((0,p.Z)({},e.getCellProps()),{},{style:{borderBottomStyle:"solid",padding:5,borderBottomWidth:1,borderBottomColor:"#E7E7E7",backgroundColor:"#FFFFFF"},children:e.render("Cell")}))}))}))}))}))]}))}),l?(0,L.jsx)("div",{style:{position:"absolute",left:0,top:0,height:"100%",width:"100%",display:"flex",alignItem:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.5)",zIndex:9001},children:(0,L.jsx)(B,{})}):null,(0,L.jsx)("div",{className:"pagination",children:(0,L.jsxs)(A.Z,{style:{width:"100%",marginTop:10,marginBottom:100},children:[(0,L.jsx)(E.Z,{xs:{span:2},children:(0,L.jsx)("button",{style:S?Z.paginationButton:Z.paginationButtonDisabled,onClick:function(){I(),a(O-1)},disabled:!S,children:"Previous"})}),(0,L.jsxs)(E.Z,{xs:{span:8,textAlign:"center"},children:[(0,L.jsxs)("p",{style:{fontFamily:"Inter",fontStyle:"normal",fontSize:16,fontWeight:500,marginRight:"10px",marginTop:"0px",padding:10,display:"inline-block"},children:[(0,L.jsx)("span",{children:"Page "}),(0,L.jsx)("input",{type:"number",defaultValue:O+1,value:O+1,onChange:function(e){var t=e.target.value?Number(e.target.value)-1:0;T(t)},style:(0,p.Z)((0,p.Z)({},Z.goToPageInputShort),{},{paddingLeft:5})})," ","of ",y.length," "]})," ",(0,L.jsx)("select",{value:C,onChange:function(e){r(Number(e.target.value),0),N(Number(e.target.value))},style:Z.goToPageInput,children:[15,30,45,60].map((function(e){return(0,L.jsxs)("option",{value:e,children:["Show ",e," Rows"]},e)}))})]}),(0,L.jsx)(E.Z,{xs:{span:2},children:(0,L.jsx)("button",{style:g?Z.paginationButton:Z.paginationButtonDisabled,onClick:function(){F(),a(O+1)},disabled:!g,children:"Next"})})]})})]})}var Z={section:{height:"100%",width:"100%",padding:20},item:{padding:"5px 5px",fontWeight:400,color:"black",fontSize:14},clearBar:{backgroundColor:"#FFFFFF",borderWidth:0,marginBottom:0},header:{color:"#8da2b5",borderBottom:"none",fontWeight:300,fontSize:12,fontFamily:"Inter"},headerSortable:{color:"#8da2b5",borderBottom:"none",fontWeight:300,fontSize:12,fontFamily:"Inter",cursor:"pointer",textDecoration:"underline"},topHeader:{backgroundColor:"white",marginBottom:20,padding:"15px 10px",borderBottom:"1px solid #FF7C00"},modalLink:{cursor:"pointer",display:"block",fontFamily:"Inter",fontStyle:"normal",textDecoration:"underline"},faIcon:{marginRight:10},searchInput:{background:"#FFF",border:"1px solid rgb(215, 214, 219)",borderRadius:4,boxSizing:"border-box",color:"#25252e",fontFamily:"Inter",fontSize:"19px",fontStyle:"normal",fontWeight:500,height:"50px",letterSpacing:"-0.014em",textAlign:"left",width:"100%"},paginationButton:{background:"#FFFFFF",fontFamily:"Inter",fontStyle:"normal",fontWeight:"bold",fontSize:"16px",lineHeight:"24px",border:"1px solid #D7D6DB",boxSizing:"border-box",borderRadius:"4px",width:150,padding:10,
1color:"#25252E"},paginationButtonDisabled:{background:"#FFFFFF",fontFamily:"Inter",fontStyle:"normal",fontWeight:"bold",fontSize:"16px",lineHeight:"24px",border:"1px solid #D7D6DB",boxSizing:"border-box",borderRadius:"4px",width:150,padding:10,color:"#D7D6DB"},goToPageInputShort:{background:"#FFF",border:"1px solid #d7d6db",borderRadius:4,boxSizing:"border-box",color:"#25252e",fontFamily:"Inter",fontSize:16,fontStyle:"normal",fontWeight:500,height:30,width:40,letterSpacing:"-0.014em",textAlign:"left"},goToPageInput:{background:"#FFF",border:"1px solid #d7d6db",borderRadius:4,boxSizing:"border-box",color:"#25252e",fontFamily:"Inter",fontSize:16,fontStyle:"normal",fontWeight:500,height:30,letterSpacing:"-0.014em",textAlign:"left"}},H=function(e){(0,a.Z)(n,e);var t=(0,r.Z)(n);function n(e,s){var a;return(0,o.Z)(this,n),(a=t.call(this,e,s)).state={data:[],loading:!1,page:0,pageSize:10,totalPages:1,totalApps:0,sorted:[],filtered:[],searchString:"",displayColumns:{title:!0,created:!0,tools:!0,archived:!0,payment:!0,store:!0,billing:!0,fullName:!0,tier:!0,activeUsers:!0,deploymentStatus:!0},billingOverviewInfo:{dateSince:"",currentPlan:"",accountStatus:""},showBillingModal:!1,showEditPackageIdModal:!1,appToBeEdited:"",appToBeEditedOptions:{},packageIdString:"",showAppStoreModal:!1,itunesString:"",playStoreString:"",androidVersionString:"",appleVersionString:"",appForModal:{},showAppOptionsModal:!1,specialSearch:"",showShopifyInfoModal:!1,loadingShopifyInfo:!1,shopifyInfo:{},shopifyInfoError:"",shopifyClearTokens:!1,archiveMode:!1,customerMode:!1,checkedArray:[],showFurtherDetailsModal:!1,appBeingExamined:{},loadingEvents:!1,appEvents:[],showEditTrialModal:!1,showEditShopifyTrialModal:!1,showEditSubscriptionModal:!1,shopifyTrialEndString:"",showEditUserCountModal:!1,userCountString:"",deploymentStatusStringIOS:"",deploymentStatusStringANDROID:"",customerSupportPlanToBeEdited:"",customerSupportCustomPriceToBeEdited:0,showEditDeploymentStatusModal:!1,showEditCustomerSupportTierModal:!1,showCustomerConfirmationSwal:!1,customerConfirmationSwalPlan:"",customerConfirmationSwalPrice:0,customerConfirmationSwalNumberOfDays:0,customerConfirmationSwalPlatform:"",customerConfirmationSwalBillDate:""},a.prettifyDate=a.prettifyDate.bind((0,i.Z)(a)),a.fetchData=a.fetchData.bind((0,i.Z)(a)),a.fetchDataCallback=a.fetchDataCallback.bind((0,i.Z)(a)),a.updateSearchString=a.updateSearchString.bind((0,i.Z)(a)),a.deleteApp=a.deleteApp.bind((0,i.Z)(a)),a.undeleteApp=a.undeleteApp.bind((0,i.Z)(a)),a.makeAdmin=a.makeAdmin.bind((0,i.Z)(a)),a.setAsPartner=a.setAsPartner.bind((0,i.Z)(a)),a.partnerPaywallSkip=a.partnerPaywallSkip.bind((0,i.Z)(a)),a.preUseApp=a.preUseApp.bind((0,i.Z)(a)),a.useApp=a.useApp.bind((0,i.Z)(a)),a.useAppCallback=a.useAppCallback.bind((0,i.Z)(a)),a.openEditDeploymentStatusModal=a.openEditDeploymentStatusModal.bind((0,i.Z)(a)),a.openEditCustomerSupportTierModal=a.openEditCustomerSupportTierModal.bind((0,i.Z)(a)),a.openEditPackageIdModal=a.openEditPackageIdModal.bind((0,i.Z)(a)),a.openEditSubscriptionModal=a.openEditSubscriptionModal.bind((0,i.Z)(a)),a.updatePackageId=a.updatePackageId.bind((0,i.Z)(a)),a.updatePackageIdState=a.updatePackageIdState.bind((0,i.Z)(a)),a.updateSubscriptionPlan=a.updateSubscriptionPlan.bind((0,i.Z)(a)),a.updateSubscriptionPlanState=a.updateSubscriptionPlanState.bind((0,i.Z)(a)),a.updateDeploymentStatus=a.updateDeploymentStatus.bind((0,i.Z)(a)),a.updateDeploymentStatusState=a.updateDeploymentStatusState.bind((0,i.Z)(a)),a.updateCustomerSupportTierState=a.updateCustomerSupportTierState.bind((0,i.Z)(a)),a.updateCustomerSupportCustomPriceState=a.updateCustomerSupportCustomPriceState.bind((0,i.Z)(a)),a.updateCustomerSupportTier=a.updateCustomerSupportTier.bind((0,i.Z)(a)),a.prePreUpdateCustomerSupportTier=a.prePreUpdateCustomerSupportTier.bind((0,i.Z)(a)),a.preUpdateCustomerSupportTier=a.preUpdateCustomerSupportTier.bind((0,i.Z)(a)),a.openEditTrialModal=a.openEditTrialModal.bind((0,i.Z)(a)),a.openEditStoreLinkModal=a.openEditStoreLinkModal.bind((0,i.Z)(a)),a.updateStoreLinkState=a.updateStoreLinkState.bind((0,i.Z)(a)
1),a.updateStoreLinks=a.updateStoreLinks.bind((0,i.Z)(a)),a.openAdminAppModal=a.openAdminAppModal.bind((0,i.Z)(a)),a.closeAdminAppModal=a.closeAdminAppModal.bind((0,i.Z)(a)),a.onlyStore=a.onlyStore.bind((0,i.Z)(a)),a.getMoreShopifyInfo=a.getMoreShopifyInfo.bind((0,i.Z)(a)),a.closeShopifyInfoModal=a.closeShopifyInfoModal.bind((0,i.Z)(a)),a.cancelShopifySub=a.cancelShopifySub.bind((0,i.Z)(a)),a.clearShopifyTokens=a.clearShopifyTokens.bind((0,i.Z)(a)),a.changeMode=a.changeMode.bind((0,i.Z)(a)),a.checkApp=a.checkApp.bind((0,i.Z)(a)),a.openFurtherDetailsModal=a.openFurtherDetailsModal.bind((0,i.Z)(a)),a.loadAppEvents=a.loadAppEvents.bind((0,i.Z)(a)),a.useAppSocialCallback=a.useAppSocialCallback.bind((0,i.Z)(a)),a.quickFix=a.quickFix.bind((0,i.Z)(a)),a.updateTrial=a.updateTrial.bind((0,i.Z)(a)),a.updateTrialEndState=a.updateTrialEndState.bind((0,i.Z)(a)),a.handleSorting=a.handleSorting.bind((0,i.Z)(a)),a.openEditShopifyTrialModal=a.openEditShopifyTrialModal.bind((0,i.Z)(a)),a.updateShopifyTrialEndState=a.updateShopifyTrialEndState.bind((0,i.Z)(a)),a.updateShopifyTrial=a.updateShopifyTrial.bind((0,i.Z)(a)),a.updateUserCountState=a.updateUserCountState.bind((0,i.Z)(a)),a.updateUserCount=a.updateUserCount.bind((0,i.Z)(a)),a.openEditUserCountModal=a.openEditUserCountModal.bind((0,i.Z)(a)),a.userInstalledCheck=a.userInstalledCheck.bind((0,i.Z)(a)),a.markAsCancelled=a.markAsCancelled.bind((0,i.Z)(a)),a}return(0,s.Z)(n,[{key:"componentDidMount",value:function(){this.fetchData({page:this.state.page,pageSize:this.state.pageSize})}},{key:"fetchData",value:function(e){this.setState({loading:!0,checkedArray:[]});var t=this.state.searchString;this.state.specialSearch&&(t=this.state.specialSearch,this.setState({specialSearch:""})),this.props.actions.admin.fetchPaginatedFilteredData(e.pageSize,e.page,this.state.sorted,t,this.state.customerMode,this.state.archiveMode,this.fetchDataCallback)}},{key:"fetchDataCallback",value:function(e){this.setState({data:e.rows,totalPages:e.pages,totalApps:e.totalApps,loading:!1})}},{key:"updateSearchString",value:function(e){var t=this;this.setState({searchString:e},(function(){""===t.state.searchString&&t.fetchData({page:t.state.page,pageSize:t.state.pageSize})}))}},{key:"onlyStore",value:function(e){var t=this;this.setState({specialSearch:e,searchString:e},(function(){t.fetchData({page:t.state.page,pageSize:t.state.pageSize})}))}},{key:"openEditTrialModal",value:function(e){this.setState({showEditTrialModal:!0,appToBeEdited:e._id})}},{key:"openEditShopifyTrialModal",value:function(e){this.setState({showEditShopifyTrialModal:!0,appToBeEdited:e._id})}},{key:"prettifyDate",value:function(e){var t=new Date(e),n=t.getMonth(),o=t.getDate(),s=t.getFullYear();return["January","February","March","April","May","June","July","August","September","October","November","December"][n]+" "+o+", "+s}},{key:"deleteApp",value:function(e){var t=this;if(confirm("Are you sure you want to delete this app?  This will affect all users who are linked to this app and is not undoable.")){this.props.actions.app.updateApp(e._id,{deleted:!0},(function(){t.fetchData({page:t.state.page,pageSize:t.state.pageSize})}))}}},{key:"undeleteApp",value:function(e){var t=this;if(confirm("Are you sure you want to undelete this app?  This will affect all users who are linked to this app and is not undoable.")){this.props.actions.app.updateApp(e._id,{deleted:!1},(function(){t.fetchData({page:t.state.page,pageSize:t.state.pageSize})}))}}},{key:"quickFix",value:function(e){var t=this;if(confirm("Are you sure you want to change this app?  This will affect all users who are linked to this app.")){var n={chosenOptions:Object.assign({},e.chosenOptions,{socialApp:!0})};this.props.actions.app.updateApp(e._id,n,(function(){t.fetchData({page:t.state.page,pageSize:t.state.pageSize})}))}}},{key:"makeAdmin",value:function(e){var t=this,n={admin:!e.admin};this.props.actions.app.updateApp(e._id,n,(function(){t.fetchData({page:t.state.page,pageSize:t.state.pageSize})}))}},{key:"updateTrial",value:function(){var e=this,t={trialEndDate:D(this.state.trialEndString).format()};this.props.actions.app.updateApp(this.state.appToBeEdited,t,(function(){alert("success"),e.fetchData({page:e.state.page,pageSize:e.state.pageSize}),e.setState({showEditTrialModal:!1})}))}},{key:"updateUserCount",value:function(){var e=this,t={activeUsers:this.state.userCountStr
1ing};this.props.actions.app.updateApp(this.state.appToBeEdited,t,(function(){alert("success"),e.fetchData({page:e.state.page,pageSize:e.state.pageSize}),e.setState({showEditUserCountModal:!1})}))}},{key:"updateShopifyTrial",value:function(){var e=this,t={shopifyTrialExtraDays:Number(this.state.shopifyTrialEndString),needsExtendedShopifyTrial:0!==Number(this.state.shopifyTrialEndString)};this.props.actions.app.updateApp(this.state.appToBeEdited,t,(function(){alert("success"),e.fetchData({page:e.state.page,pageSize:e.state.pageSize}),e.setState({showEditShopifyTrialModal:!1})}))}},{key:"setAsPartner",value:function(e){var t=this,n={partnerApp:!0};e.chosenOptions&&e.chosenOptions.shopifyAccessToken?(n.shopifyTrialExtraDays=365,n.needsExtendedShopifyTrial=!0):n.trialEndDate=D().add(365,"day").format(),this.props.actions.app.updateApp(e._id,n,(function(){t.fetchData({page:t.state.page,pageSize:t.state.pageSize})}))}},{key:"partnerPaywallSkip",value:function(e){var t=this,n={chosenOptions:Object.assign({},e.chosenOptions,{partnerPaywallSkip:!0})};this.props.actions.app.updateApp(e._id,n,(function(){t.fetchData({page:t.state.page,pageSize:t.state.pageSize})}))}},{key:"preUseApp",value:function(e){var t=this,n=R.H+"/app/fetchOne",o={appId:e._id},s={headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem("jwtToken")},method:"post",body:JSON.stringify(o)};fetch(n,s).then((function(e){if(!e.ok)throw Error(e.statusText);return e.json()})).then((function(e){e&&e[0]&&t.useApp(e[0])})).catch((function(){}))}},{key:"useApp",value:function(e){e.impersonateMode=!0,"instagram"===e.subscriptionPlan||e.chosenOptions&&e.chosenOptions.socialApp?this.props.actions.app.useApp(e,this.useAppSocialCallback):this.props.actions.app.useApp(e,this.useAppCallback)}},{key:"useAppCallback",value:function(e){var t=!1;if("paused"===e.subscriptionPlan||"unsubscribed"===e.subscriptionPlan||!e.monthlyStripeAccountId&&!e.shopifyChargeId&&!e.partner&&"Vintage Founder"!==e.appTitle||e.needsExtendedShopifyTrial)if(e.chosenOptions&&!e.chosenOptions.shopifyAccessToken){var n=new Date,o=e.trialEndDate;(Date.parse(o)<Date.parse(n)||"paused"===e.subscriptionPlan||"unsubscribed"===e.subscriptionPlan)&&(t=!0)}else t=!0;e.chosenOptions&&e.chosenOptions.partnerPaywallSkip&&(t=!1),t?this.props.history.push("/app/main/paywall"):this.props.history.push("/app/main/design"),e.partnerApp&&!e.acceptedPartnerToS&&this.props.history.push("/app/main/partnerToS"),$({title:"Warning!",text:"Changes made while in Impersonation Mode will update the client's live app.",type:"warning",confirmButtonText:"I understand"}),this.userInstalledCheck(e)}},{key:"useAppSocialCallback",value:function(e){!e.monthlyStripeAccountId&&!e.shopifyChargeId&&!e.partner&&"Vintage Founder"!==e.appTitle||e.needsExtendedShopifyTrial?this.props.history.push("/app/main/paywall"):this.props.history.push("/app/main/shoppableInstagram"),$({title:"Warning!",text:"Changes made while in Impersonation Mode will update the client's live app.",type:"warning",confirmButtonText:"I understand"})}},{key:"copyBuildScript",value:function(e){void 0===e.chosenOptions.storeUrl&&(e.chosenOptions.storeUrl="");var t="";e.chosenOptions.customPages&&e.chosenOptions.customPages[0]&&e.chosenOptions.customPages[0].media&&(t=e.chosenOptions.customPages[0].media);var n="";e.chosenOptions.customPages&&e.chosenOptions.customPages[1]&&e.chosenOptions.customPages[1].media&&(n=e.chosenOptions.customPages[1].media);var o="";e.chosenOptions.customPages&&e.chosenOptions.customPages[2]&&e.chosenOptions.customPages[2].media&&(o=e.chosenOptions.customPages[2].media);var s="";e.chosenOptions.customPages&&e.chosenOptions.customPages[3]&&e.chosenOptions.customPages[3].media&&(s=e.chosenOptions.customPages[3].media);var i="";e.chosenOptions.customPages&&e.chosenOptions.customPages[4]&&e.chosenOptions.customPages[4].media&&(i=e.chosenOptions.customPages[4].media);var a="sh theScript.sh "+e.ownerId+" '"+e.chosenOptions.title+"' "+e.chosenOptions.shopify+" "+e.chosenOptions.bigcommerce+" '"+e.chosenOptions.iconUrl+"' '"+e.chosenOptions.storeUrl+"' false 'com.sandbox."+e.packageId+"' '"+e.googleSignInId+"' '"+e.uaProdKey+"' '"+e.uaProdSec+"' '"+t+"' '"+n+"' '"+o+"' '"+s+"' '"+i+"' '"+e.chosenOptions.splashBackgroun
1d+"' '#ffffff' "+e._id+" '1172424636124298' '"+e.chosenOptions.title+"' 'sbcappname' true true ''";this.createFontScript(e),prompt("Copy to clipboard: Ctrl+C",a)}},{key:"consoleLogApp",value:function(e){}},{key:"createFontScript",value:function(e){var t='#!/usr/bin/env bash\n\nSCRIPTPATH=$(dirname $0)\nFONTFILENAMERAW=""\nFONTFILENAME=""\n\n';if(e.chosenOptions.mainFontFile&&(t+="curl "+e.chosenOptions.mainFontFile+' > $SCRIPTPATH/downloadedFonts/font.ttf\nsleep 3\nFONTFILENAMERAW=$(mdls -name com_apple_ats_name_family $SCRIPTPATH/downloadedFonts/font.ttf)\necho "$FONTFILENAMERAW"\nFONTFILENAMERAW=${FONTFILENAMERAW/com_apple_ats_name_family/}\nFONTFILENAMERAW=${FONTFILENAMERAW/=/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\(/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\"/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\"/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\)/}\nFONTFILENAME=$(echo $FONTFILENAMERAW)\necho "$FONTFILENAME"\ncp $SCRIPTPATH/downloadedFonts/font.ttf $SCRIPTPATH/android/app/src/main/assets/fonts/"$FONTFILENAME".ttf\ncp $SCRIPTPATH/downloadedFonts/font.ttf $SCRIPTPATH/ios/Fonts/"$FONTFILENAME".ttf\nrm $SCRIPTPATH/downloadedFonts/font.ttf\nsed -i -e "s/_FONTNAME/$FONTFILENAME/" $SCRIPTPATH/components/visibleOptions.js\n\n'),e.chosenOptions.buttonFontFile&&(t+="curl "+e.chosenOptions.buttonFontFile+' > $SCRIPTPATH/downloadedFonts/font.ttf\nsleep 3\nFONTFILENAMERAW=$(mdls -name com_apple_ats_name_family $SCRIPTPATH/downloadedFonts/font.ttf)\necho "$FONTFILENAMERAW"\nFONTFILENAMERAW=${FONTFILENAMERAW/com_apple_ats_name_family/}\nFONTFILENAMERAW=${FONTFILENAMERAW/=/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\(/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\"/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\"/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\)/}\nFONTFILENAME=$(echo $FONTFILENAMERAW)\necho "$FONTFILENAME"\ncp $SCRIPTPATH/downloadedFonts/font.ttf $SCRIPTPATH/android/app/src/main/assets/fonts/"$FONTFILENAME".ttf\ncp $SCRIPTPATH/downloadedFonts/font.ttf $SCRIPTPATH/ios/Fonts/"$FONTFILENAME".ttf\nrm $SCRIPTPATH/downloadedFonts/font.ttf\nsed -i -e "s/_FONTNAME/$FONTFILENAME/" $SCRIPTPATH/components/visibleOptions.js\n\n'),e.chosenOptions.textFontFile&&(t+="curl "+e.chosenOptions.textFontFile+' > $SCRIPTPATH/downloadedFonts/font.ttf\nsleep 3\nFONTFILENAMERAW=$(mdls -name com_apple_ats_name_family $SCRIPTPATH/downloadedFonts/font.ttf)\necho "$FONTFILENAMERAW"\nFONTFILENAMERAW=${FONTFILENAMERAW/com_apple_ats_name_family/}\nFONTFILENAMERAW=${FONTFILENAMERAW/=/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\(/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\"/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\"/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\)/}\nFONTFILENAME=$(echo $FONTFILENAMERAW)\necho "$FONTFILENAME"\ncp $SCRIPTPATH/downloadedFonts/font.ttf $SCRIPTPATH/android/app/src/main/assets/fonts/"$FONTFILENAME".ttf\ncp $SCRIPTPATH/downloadedFonts/font.ttf $SCRIPTPATH/ios/Fonts/"$FONTFILENAME".ttf\nrm $SCRIPTPATH/downloadedFonts/font.ttf\nsed -i -e "s/_FONTNAME/$FONTFILENAME/" $SCRIPTPATH/components/visibleOptions.js\n\n'),e.chosenOptions.titleFontFile&&(t+="curl "+e.chosenOptions.titleFontFile+' > $SCRIPTPATH/downloadedFonts/font.ttf\nsleep 3\nFONTFILENAMERAW=$(mdls -name com_apple_ats_name_family $SCRIPTPATH/downloadedFonts/font.ttf)\necho "$FONTFILENAMERAW"\nFONTFILENAMERAW=${FONTFILENAMERAW/com_apple_ats_name_family/}\nFONTFILENAMERAW=${FONTFILENAMERAW/=/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\(/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\"/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\"/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\)/}\nFONTFILENAME=$(echo $FONTFILENAMERAW)\necho "$FONTFILENAME"\ncp $SCRIPTPATH/downloadedFonts/font.ttf $SCRIPTPATH/android/app/src/main/assets/fonts/"$FONTFILENAME".ttf\ncp $SCRIPTPATH/downloadedFonts/font.ttf $SCRIPTPATH/ios/Fonts/"$FONTFILENAME".ttf\nrm $SCRIPTPATH/downloadedFonts/font.ttf\nsed -i -e "s/_FONTNAME/$FONTFILENAME/" $SCRIPTPATH/components/visibleOptions.js\n\n'),e.chosenOptions.categoryFontFile&&(t+="curl "+e.chosenOptions.categoryFontFile+' > $SCRIPTPATH/downloadedFonts/font.ttf\nsleep 3\nFONTFILENAMERAW=$(mdls -name com_apple_ats_name_family $SCRIPTPATH/downloadedFonts/font.ttf)\necho "$FONTFILENAMERAW"\nFONTFILENAMERAW=${FONTFILENAMERAW/com_apple_ats_name_family/}\nFONTFILENAMERAW=${FONTFILENAMERAW/=/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\(/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\"/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\"/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\)/}\nFONTFILENAME=$(echo $FONTFILENAMERAW)\necho "$FONTFILENAME"\ncp $SCRIPTPATH/downloadedFonts/font.ttf $SCRIPTPATH/android/app/src/main/assets/fonts/"$FONTFILENAME".ttf\ncp $SCRIPTPATH/downloadedFonts/font.ttf $SCRIPTPATH/ios/Fonts/"$FONTFILENAME".ttf\nrm $SCRIPTPATH/downloadedFonts/font.ttf\nsed -i -e "s/_FONTNAME/$FONTFILENAME/" $SCRIPTPATH/components/visibleOptions.js\n\n'),e.chosenOptions.customPageFontFile&&(t+="curl "+e.chosenOptions.customPageFontFile+' >
1 $SCRIPTPATH/downloadedFonts/font.ttf\nsleep 3\nFONTFILENAMERAW=$(mdls -name com_apple_ats_name_family $SCRIPTPATH/downloadedFonts/font.ttf)\necho "$FONTFILENAMERAW"\nFONTFILENAMERAW=${FONTFILENAMERAW/com_apple_ats_name_family/}\nFONTFILENAMERAW=${FONTFILENAMERAW/=/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\(/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\"/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\"/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\)/}\nFONTFILENAME=$(echo $FONTFILENAMERAW)\necho "$FONTFILENAME"\ncp $SCRIPTPATH/downloadedFonts/font.ttf $SCRIPTPATH/android/app/src/main/assets/fonts/"$FONTFILENAME".ttf\ncp $SCRIPTPATH/downloadedFonts/font.ttf $SCRIPTPATH/ios/Fonts/"$FONTFILENAME".ttf\nrm $SCRIPTPATH/downloadedFonts/font.ttf\nsed -i -e "s/_FONTNAME/$FONTFILENAME/" $SCRIPTPATH/components/visibleOptions.js\n\n'),e.chosenOptions.homeItemFontFile&&(t+="curl "+e.chosenOptions.homeItemFontFile+' > $SCRIPTPATH/downloadedFonts/font.ttf\nsleep 3\nFONTFILENAMERAW=$(mdls -name com_apple_ats_name_family $SCRIPTPATH/downloadedFonts/font.ttf)\necho "$FONTFILENAMERAW"\nFONTFILENAMERAW=${FONTFILENAMERAW/com_apple_ats_name_family/}\nFONTFILENAMERAW=${FONTFILENAMERAW/=/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\(/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\"/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\"/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\)/}\nFONTFILENAME=$(echo $FONTFILENAMERAW)\necho "$FONTFILENAME"\ncp $SCRIPTPATH/downloadedFonts/font.ttf $SCRIPTPATH/android/app/src/main/assets/fonts/"$FONTFILENAME".ttf\ncp $SCRIPTPATH/downloadedFonts/font.ttf $SCRIPTPATH/ios/Fonts/"$FONTFILENAME".ttf\nrm $SCRIPTPATH/downloadedFonts/font.ttf\nsed -i -e "s/_FONTNAME/$FONTFILENAME/" $SCRIPTPATH/components/visibleOptions.js\n\n'),e.chosenOptions.homeCategories)for(var n=0;n<e.chosenOptions.homeCategories.length;n++)e.chosenOptions.homeCategories&&e.chosenOptions.homeCategories[n]&&e.chosenOptions.homeCategories[n].fontFile&&(t+="curl "+e.chosenOptions.homeCategories[n].fontFile+' > $SCRIPTPATH/downloadedFonts/font.ttf\nsleep 3\nFONTFILENAMERAW=$(mdls -name com_apple_ats_name_family $SCRIPTPATH/downloadedFonts/font.ttf)\necho "$FONTFILENAMERAW"\nFONTFILENAMERAW=${FONTFILENAMERAW/com_apple_ats_name_family/}\nFONTFILENAMERAW=${FONTFILENAMERAW/=/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\(/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\"/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\"/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\)/}\nFONTFILENAME=$(echo $FONTFILENAMERAW)\necho "$FONTFILENAME"\ncp $SCRIPTPATH/downloadedFonts/font.ttf $SCRIPTPATH/android/app/src/main/assets/fonts/"$FONTFILENAME".ttf\ncp $SCRIPTPATH/downloadedFonts/font.ttf $SCRIPTPATH/ios/Fonts/"$FONTFILENAME".ttf\nrm $SCRIPTPATH/downloadedFonts/font.ttf\nsed -i -e "s/_FONTNAME/$FONTFILENAME/" $SCRIPTPATH/components/visibleOptions.js\n\n');if(e.chosenOptions.homeItems)for(var o=0;o<e.chosenOptions.homeItems.length;o++)e.chosenOptions.homeItems[o]&&e.chosenOptions.homeItems[o].fontFile&&(t+="curl "+e.chosenOptions.homeItems[o].fontFile+' > $SCRIPTPATH/downloadedFonts/font.ttf\nsleep 3\nFONTFILENAMERAW=$(mdls -name com_apple_ats_name_family $SCRIPTPATH/downloadedFonts/font.ttf)\necho "$FONTFILENAMERAW"\nFONTFILENAMERAW=${FONTFILENAMERAW/com_apple_ats_name_family/}\nFONTFILENAMERAW=${FONTFILENAMERAW/=/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\(/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\"/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\"/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\)/}\nFONTFILENAME=$(echo $FONTFILENAMERAW)\necho "$FONTFILENAME"\ncp $SCRIPTPATH/downloadedFonts/font.ttf $SCRIPTPATH/android/app/src/main/assets/fonts/"$FONTFILENAME".ttf\ncp $SCRIPTPATH/downloadedFonts/font.ttf $SCRIPTPATH/ios/Fonts/"$FONTFILENAME".ttf\nrm $SCRIPTPATH/downloadedFonts/font.ttf\nsed -i -e "s/_FONTNAME/$FONTFILENAME/" $SCRIPTPATH/components/visibleOptions.js\n\n');if(e.chosenOptions.homeMarquees)for(var s=0;s<e.chosenOptions.homeMarquees.length;s++)e.chosenOptions.homeMarquees[s]&&e.chosenOptions.homeMarquees[s].fontFile&&(t+="curl "+e.chosenOptions.homeMarquees[s].fontFile+' > $SCRIPTPATH/downloadedFonts/font.ttf\nsleep 3\nFONTFILENAMERAW=$(mdls -name com_apple_ats_name_family $SCRIPTPATH/downloadedFonts/font.ttf)\necho "$FONTFILENAMERAW"\nFONTFILENAMERAW=${FONTFILENAMERAW/com_apple_ats_name_family/}\nFONTFILENAMERAW=${FONTFILENAMERAW/=/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\(/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\"/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\"/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\)/}\nFONTFILENAME=$(echo $FONTFILENAMERAW)\necho "$FONTFILENAME"\ncp $SCRIPTPATH/downloadedFonts/font.ttf $SCRIPTPATH/android/app/src/main/assets/fonts/"$FONTFILENAME".ttf\ncp $SCRIPTPATH/downloadedFonts/font.ttf $SCRIPTPATH/ios/Fonts/"$FONTFILENAME".ttf\nrm $SCRIPTPATH/downloadedFonts/font.ttf\nsed -i -e "s/_FONTNAME/$FONTFILENAME/" $SCRIPTPATH/components/visibleOptions.js\n\n');if(e.chosenOptions.homeVideos)for(var i=0;i<e.chosenOptions.homeVideos.length;i++)e.chosenOptions.homeVideos[i]&&e.chosenOptions.homeVideos[i].fontFile&&(t+="curl "+e.chosenOptions.homeVideos[i].fontFile+' >
1 $SCRIPTPATH/downloadedFonts/font.ttf\nsleep 3\nFONTFILENAMERAW=$(mdls -name com_apple_ats_name_family $SCRIPTPATH/downloadedFonts/font.ttf)\necho "$FONTFILENAMERAW"\nFONTFILENAMERAW=${FONTFILENAMERAW/com_apple_ats_name_family/}\nFONTFILENAMERAW=${FONTFILENAMERAW/=/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\(/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\"/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\"/}\nFONTFILENAMERAW=${FONTFILENAMERAW/\\)/}\nFONTFILENAME=$(echo $FONTFILENAMERAW)\necho "$FONTFILENAME"\ncp $SCRIPTPATH/downloadedFonts/font.ttf $SCRIPTPATH/android/app/src/main/assets/fonts/"$FONTFILENAME".ttf\ncp $SCRIPTPATH/downloadedFonts/font.ttf $SCRIPTPATH/ios/Fonts/"$FONTFILENAME".ttf\nrm $SCRIPTPATH/downloadedFonts/font.ttf\nsed -i -e "s/_FONTNAME/$FONTFILENAME/" $SCRIPTPATH/components/visibleOptions.js\n\n');var a=document.createElement("a");a.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),a.setAttribute("download","fontScript.sh"),a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a)}},{key:"getBillingInfo",value:function(e){var t=this;this.props.actions.app.checkShopifyChargeId(e.shopifyChargeId,e.shopifyChargeType,e.chosenOptions.shopifyAccessToken,e.chosenOptions.shopifyStoreName,(function(e){if(e&&e.status&&"declined"===e.status);else if(e&&e.status&&"active"===e.status)if(e.return_url&&e.return_url.indexOf("yearly")>-1){var n=new Date(e.created_at);n.setFullYear(n.getFullYear()+1);var o={yearly:!0,dateSince:e.created_at,currentPlan:e.name,accountStatus:e.status,nextBillDate:n,test:e.test};t.setState({billingOverviewInfo:o,showBillingModal:!0})}else{var s={yearly:!1,dateSince:e.activated_on,currentPlan:e.name,accountStatus:e.status,nextBillDate:e.billing_on,test:e.test};t.setState({billingOverviewInfo:s,showBillingModal:!0})}}))}},{key:"openEditDeploymentStatusModal",value:function(e){this.setState({showAppOptionsModal:!1,showEditDeploymentStatusModal:!0,appToBeEdited:e._id,appToBeEditedOptions:e.chosenOptions,deploymentStatusStringANDROID:e.googleProgress,deploymentStatusStringIOS:e.appleProgress})}},{key:"openEditCustomerSupportTierModal",value:function(e){this.setState({showAppOptionsModal:!1,showEditCustomerSupportTierModal:!0,appToBeEdited:e._id,fullAppToBeEdited:e,appToBeEditedOptions:e.chosenOptions,customerSupportPlanToBeEdited:e.customerSupportPlan,customerSupportCustomPriceToBeEdited:e.customerSupportCustomPrice})}},{key:"openEditPackageIdModal",value:function(e){this.setState({showAppOptionsModal:!1,showEditPackageIdModal:!0,appToBeEdited:e._id,appToBeEditedOptions:e.chosenOptions,packageIdString:e.packageId})}},{key:"openEditUserCountModal",value:function(e){this.setState({showAppOptionsModal:!1,showEditUserCountModal:!0,appToBeEdited:e._id,appToBeEditedOptions:e.chosenOptions,userCountString:e.activeUsers})}},{key:"openEditSubscriptionModal",value:function(e){this.setState({showAppOptionsModal:!1,showEditSubscriptionModal:!0,appToBeEdited:e._id,fullAppToBeEdited:e,appToBeEditedOptions:e.chosenOptions,packageIdString:e.packageId})}},{key:"openEditStoreLinkModal",value:function(e){var t="",n="";e.chosenOptions.versionApp&&(t=e.chosenOptions.versionApp.android.version,n=e.chosenOptions.versionApp.ios.version),this.setState({showAppStoreModal:!0,appToBeEdited:e._id,appToBeEditedOptions:e.chosenOptions,playStoreString:e.googlePlay,itunesString:e.itunesStore,androidVersionString:t,appleVersionString:n})}},{key:"updatePackageIdState",value:function(e){var t=e.target.value;return this.setState({packageIdString:t})}},{key:"updateSubscriptionPlanState",value:function(e){var t=e.target.value;return this.setState({subscriptionPlanString:t})}},{key:"updateDeploymentStatusState",value:function(e){return"ios"===e.target.name?this.setState({deploymentStatusStringIOS:e.target.value}):"android"===e.target.name?this.setState({deploymentStatusStringANDROID:e.target.value}):void 0}},{key:"updateCustomerSupportTierState",value:function(e){var t=this.state.customerSupportCustomPriceToBeEdited;"enterprise"!==e&&(t=0),this.setState({customerSupportPlanToBeEdited:e,customerSupportCustomPriceToBeEdited:t})}},{key:"updateCustomerSupportCustomPriceState",value:function(e){return this.setState({customerSupportCustomPriceToBeEdited:e.target.value})}},{key:"updateStoreLinkState",value:function(e){return"itunes"===e.target.name?this.setState({itunesString:e.target.value}):"playStore"===e.target.name?this.setState({playStoreString:e.target.value}):"appleVersionString"===e.target.name?this.setState({appleVersionString:e.target.value}):"androidVersionString"===e.target.name?this.setState({androidVersionString:e.target.value}):void 0}},{key:"updateTrialEndState",value:function(e){return this.setState({trialEndString:e.target.value})}},{key:"updateUserCountState",value:function(e){return this.setState({userCountStr
1ing:e.target.value})}},{key:"updateShopifyTrialEndState",value:function(e){return this.setState({shopifyTrialEndString:e.target.value})}},{key:"updatePackageId",value:function(){var e=this,t={packageId:this.state.packageIdString};this.props.actions.app.updateApp(this.state.appToBeEdited,t,(function(t,n){alert("success "+n.packageId),e.fetchData({page:e.state.page,pageSize:e.state.pageSize}),e.setState({showEditPackageIdModal:!1})}))}},{key:"updateSubscriptionPlan",value:function(){var e=this,t={subscriptionPlan:this.state.subscriptionPlanString};this.props.actions.app.updateApp(this.state.appToBeEdited,t,(function(t,n){alert("success "+n.subscriptionPlan),e.fetchData({page:e.state.page,pageSize:e.state.pageSize}),e.setState({showEditSubscriptionModal:!1})}))}},{key:"updateDeploymentStatus",value:function(){var e=this,t={appleProgress:this.state.deploymentStatusStringIOS,googleProgress:this.state.deploymentStatusStringANDROID};this.props.actions.app.updateApp(this.state.appToBeEdited,t,(function(t,n){alert("success "),e.fetchData({page:e.state.page,pageSize:e.state.pageSize}),e.setState({showEditDeploymentStatusModal:!1})}))}},{key:"prePreUpdateCustomerSupportTier",value:function(){var e=this,t=this.state.fullAppToBeEdited,n=this.state.customerSupportPlanToBeEdited,o=this.state.customerSupportCustomPriceToBeEdited;if("advanced"===n?o=249:"basic"===n&&(o=0),(t.dateSubscribed||t.lastBilled)&&"trial"!==t.subscriptionPlan&&t.monthlyStripeAccountId){var s=t.lastBilled,i=t.dateSubscribed,a=t.trialEndDate,r=!1,p=!t.yearlySubscription,l=t.yearlySubscription,d=s;d||(i?d=i:a?(r=!0,d=a):(r=!0,d=Date.now()));var c=D(d).add(1,"months"),h=D(d).add(1,"years");r||(p?d=c:l&&(d=h));var u=D(),f=d.diff(u,"days")+1;if(f>0){var m=o/30*f;this.setState({showEditCustomerSupportTierModal:!1,showCustomerConfirmationSwal:!0,customerConfirmationSwalNumberOfDays:f,customerConfirmationSwalPrice:m,customerConfirmationSwalPlan:n,customerConfirmationSwalBillDate:d,customerConfirmationSwalPlatform:"stripe"})}}else t.shopifyChargeId&&this.props.actions.app.checkShopifyChargeId(t.shopifyChargeId,t.shopifyChargeType,t.chosenOptions.shopifyAccessToken,t.chosenOptions.shopifyStoreURL.replace(".myshopify.com",""),(function(t){if(t&&t.status){var s=D(t.billing_on),i=D(),a=s.diff(i,"days")+1;if(a>0){var r=o/30*a;e.setState({showEditCustomerSupportTierModal:!1,showCustomerConfirmationSwal:!0,customerConfirmationSwalNumberOfDays:a,customerConfirmationSwalPrice:r,customerConfirmationSwalPlan:n,customerConfirmationSwalBillDate:s,customerConfirmationSwalPlatform:"shopify"})}}else t.fullError&&e.setState({loadingShopifyInfo:!1,shopifyInfoError:"Error from Shopify: "+t.fullError,shopifyClearTokens:t.clearAuthTokens})}))}},{key:"preUpdateCustomerSupportTier",value:function(){var e=this,t=(this.state.fullAppToBeEdited,this.state.customerSupportPlanToBeEdited),n=b.H+"/payment/immediateProratedCustomerSupportCharge",o={price:this.state.customerSupportCustomPriceToBeEdited,plan:t,appId:this.state.appToBeEdited,platform:this.state.customerConfirmationSwalPlatform,billDate:this.state.customerConfirmationSwalBillDate},s={headers:{Accept:"application/json","Content-Type":"application/json"},method:"post",body:JSON.stringify(o)};fetch(n,s).then((function(e){return e.json()})).then((function(t){t.success?e.updateCustomerSupportTier():t.errorType&&t.errorMessage&&alert('"'+t.errorType+'" '+t.errorMessage),e.setState({showCustomerConfirmationSwal:!1})})).catch((function(e){throw e}))}},{key:"updateCustomerSupportTier",value:function(){var e=this,t={customerSupportPlan:this.state.customerSupportPlanToBeEdited,customerSupportCustomPrice:Number(this.state.customerSupportCustomPriceToBeEdited)};this.props.actions.app.updateApp(this.state.appToBeEdited,t,(function(t,n){alert("success "),e.fetchData({page:e.state.page,pageSize:e.state.pageSize}),e.setState({showEditCustomerSupportTierModal:!1})}))}},{key:"updateStoreLinks",value:function(){var e=this,t={googlePlay:this.state.playStoreString,itunesStore:this.state.itunesString},n=JSON.parse(JSON.stringify(this.state.appToBeEditedOptions)),o={ios:{version:this.state.appleVersionString,url:this.state.itunesString},android:{version:this.state.androidVersionString,url:this.state.playStoreString}};n.versionApp=o,t.chosenOptions=n,this.props.actions.app.updateApp(this.state.appToBeEdited,t,(function(t,n){alert("success "+n.googlePlay+" "+n.itunesStore),e.fetchData({page:e.state.page,pageSize:e.state.pageSize}),e.setState({showAppStoreModal:!1})}))}},{key:"setAppForPreview",value:function(e,t){var n=this,o={superAdminPreviewApp:e._id};
1t||(o.superAdminPreviewApp=""),this.props.actions.user.updateUser(this.props.user._id,o,(function(){n.fetchData({page:n.state.page,pageSize:n.state.pageSize})}))}},{key:"addToWorking",value:function(e){var t=this,n=[];this.props.user.superAdminWorkingApps&&(n=JSON.parse(JSON.stringify(this.props.user.superAdminWorkingApps)));for(var o=-1,s=0;s<n.length;s++)n[s]===e._id&&(o=s);-1===o?n.push(e._id):n.splice(o,1);var i={superAdminWorkingApps:n};this.props.actions.user.updateUser(this.props.user._id,i,(function(){t.fetchData({page:t.state.page,pageSize:t.state.pageSize})}))}},{key:"constructOptionsButton",value:function(e){var t=this;return(0,L.jsxs)(c.z,{onClick:function(){return t.openAdminAppModal(e)},children:[(0,L.jsx)(d.G,{style:{marginLeft:3},icon:l.Dfb}),(0,L.jsx)(d.G,{style:{marginLeft:3},icon:l.Dfb}),(0,L.jsx)(d.G,{style:{marginLeft:3},icon:l.Dfb})]})}},{key:"openAdminAppModal",value:function(e){this.setState({appForModal:e,showAppOptionsModal:!0})}},{key:"closeAdminAppModal",value:function(){this.setState({appForModal:{},showAppOptionsModal:!1})}},{key:"getMoreShopifyInfo",value:function(e){var t=this;if(this.setState({showFurtherDetailsModal:!1,showShopifyInfoModal:!0,loadingShopifyInfo:!0,shopifyAppToFetch:e}),e.shopifyChargeId&&e.shopifyChargeType&&e.chosenOptions.shopifyAccessToken)this.props.actions.app.checkShopifyChargeId(e.shopifyChargeId,e.shopifyChargeType,e.chosenOptions.shopifyAccessToken,e.chosenOptions.shopifyStoreURL.replace(".myshopify.com",""),(function(n){if(n&&n.status){var o=n;if(o.shopifyAccessToken=e.chosenOptions.shopifyAccessToken,o.shopifyStoreName=e.chosenOptions.shopifyStoreURL.replace(".myshopify.com",""),o.shopifyChargeType=e.shopifyChargeType,"yearly"===e.shopifyChargeType){var s=new Date(n.created_at);s.setFullYear(s.getFullYear()+1),o.activated_on=new Date(n.created_at).toDateString(),o.billing_on=s.toDateString()}t.setState({loadingShopifyInfo:!1,shopifyInfo:o})}else n.fullError&&t.setState({loadingShopifyInfo:!1,shopifyInfoError:"Error from Shopify: "+n.fullError,shopifyClearTokens:n.clearAuthTokens})}));else{var n="This app does not have the required data to fetch info from Shopify. \nMissing: \n";e.shopifyChargeId||(n+="- shopifyChargeId \n"),e.shopifyChargeType||(n+="- shopifyChargeType \n"),e.chosenOptions.shopifyAccessToken||(n+="- chosenOptions.shopifyAccessToken \n"),this.setState({loadingShopifyInfo:!1,shopifyInfoError:n})}}},{key:"closeShopifyInfoModal",value:function(){this.setState({loadingShopifyInfo:!1,shopifyInfoError:"",showShopifyInfoModal:!1,shopifyInfo:{},shopifyAppToFetch:{},shopifyClearTokens:!1})}},{key:"cancelShopifySub",value:function(){var e=this;confirm("Are you sure you want to cancel this subscription?")&&(this.state.shopifyInfo.id&&this.state.shopifyInfo.shopifyChargeType&&this.state.shopifyInfo.shopifyAccessToken&&this.state.shopifyInfo.shopifyStoreName?this.props.actions.app.cancelShopifyCharge(this.state.shopifyInfo.id,this.state.shopifyInfo.shopifyChargeType,this.state.shopifyInfo.shopifyAccessToken,this.state.shopifyInfo.shopifyStoreName,(function(t){t.error?alert("Unable to cancel subscription."):(alert("Subscription cancelled."),e.getMoreShopifyInfo(e.state.shopifyAppToFetch))})):alert("Unable to cancel subscription."))}},{key:"clearShopifyTokens",value:function(){var e=this,t={chosenOptions:JSON.parse(JSON.stringify(this.state.shopifyAppToFetch.chosenOptions)),shopifyChargeId:"",shopifyChargeType:""};t.chosenOptions.shopifyAccessToken="",t.chosenOptions.shopifyStoreName="",this.props.actions.app.updateApp(this.state.shopifyAppToFetch._id,t,(function(){e.closeShopifyInfoModal(),e.fetchData({page:e.state.page,pageSize:e.state.pageSize})}))}},{key:"markAsCancelled",value:function(){var e=this;this.props.actions.app.updateApp(this.state.shopifyAppToFetch._id,{subscriptionPlan:"unsubscribed"},(function(){e.closeShopifyInfoModal(),e.fetchData({page:e.state.page,pageSize:e.state.pageSize})}))}},{key:"changeMode",value:function(e){var t=this;"customerMode"===e?this.setState({customerMode:!this.state.customerMode},(function(){t.fetchData({page:t.state.page,pageSize:t.state.pageSize})})):"archiveMode"===e&&this.setState({archiveMode:!this.state.archiveMode},(function(){t.fetchData({page:t.state.page,pageSize:t.state.pageSize})}))}},{key:"checkApp",value:function(e){var t=this.state.checkedArray,n=t.indexOf(e._id);n>-1?t.splice(n,1):t.push(e._id),this.setState({checkedArray:t})}},{key:"userInstalledCheck",value:function(e){var t=e.activeUsers,n="";if(t&&t>=5e3&&"grow"!==e.subscriptionPlan&&(n="grow"),t&&t>=1e4&&(n="growPlus"),t&&t>=15e3&&(n="growPlus550"),t&&t>=2e4&&(n="growPlus700"),t&&t>=25e3&&(n="growPlus850"),t&&t>=3e4&&(n="growPlus1000"),t&&t>=35e3&&(n="growPlus1150"),t&&t>=4e4&&(n="growPlus1300"),t&&t>=45e3&&(n="growPlus1450"),t&&t>=5e4&&(n="growPlus1600"),t&&t>=55e3&&(n="growPlus1750"),t&&t>=6e4&&(n="growPlus1900"),t&&t>=65e3&&(n="growPlus2050"),t&&t>=7e4&&(n="growPlus2200"),t&&t>=75e3&&(n="growPlus2350"),t&&t>=8e4&&(n="growPlus2500"),t&&t>=85e3&&(n="growPlus2650"),t&&t>=9e4&&(n="growPlus2800"),t&&t>=95e3&&(n="growPlus2950"),n&&this.props.actions.app.updateApp(e._id,{subscriptionPlan:n},(function(){})),n&&e.shopifyChargeId){var o=b.H+"/payment/addUsageToShopifyCharge",s={chargeId:e.shopifyChargeId,plan:n,storeName:e.chosenOptions.shopifyStoreName,apiAuth:e.chosenOptions.shopifyAccessToken},i={headers:{Accept:"application/json","Content-Type":"application/json"},method:"post",body:JSON.stringify(s)};fetch(o,i).then((function(e){return e.json()})).then((function(e){})).catch((function(e){throw e}))}}},{key:"archiveBatch",value:function(){var e=this,t=b.H+"/app/batchArchive",n={appIds:this.state.checkedArray},o={headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem("jwtToken")},method:"post",body:JSON.stringify(n)};fetch(t,o).then((function(e){return e.json()})).then((function(t){t.message?e.fetchData({page:e.state.page,pageSize:e.state.pageSize}):alert(t.error)}
1)).catch((function(e){throw alert("There was an error with your request."),e}))}},{key:"openFurtherDetailsModal",value:function(e){var t=JSON.parse(JSON.stringify(e));if(e.lastBilled){var n=new Date(e.lastBilled),o=n.getUTCFullYear()+"/"+(n.getUTCMonth()+1)+"/"+n.getUTCDate();t.isShopify=!1,t.nextBillDate=o}else e.shopifyChargeId&&(t.isShopify=!0);t.storeUrl="",e.chosenOptions&&e.chosenOptions.shopifyStoreURL?t.storeUrl="https://"+e.chosenOptions.shopifyStoreURL:e.chosenOptions&&e.chosenOptions.bcStoreHash?t.storeUrl="https://store-"+e.chosenOptions.bcStoreHash+".mybigcommerce.com":e.chosenOptions&&e.chosenOptions.threeDCartStoreURL&&(t.storeUrl=e.chosenOptions.threeDCartStoreURL),this.setState({showFurtherDetailsModal:!0,appBeingExamined:t}),this.loadAppEvents(e)}},{key:"loadAppEvents",value:function(e){var t=this;this.setState({loadingEvents:!0}),this.props.actions.event.fetchAppEvents(e._id,(function(e){t.setState({loadingEvents:!1,appEvents:e})}))}},{key:"packageAssets",value:function(e){var t="#!/usr/bin/env bash\n\nSCRIPTPATH=$(dirname $0)\n\nsh theScript.sh "+e.ownerId+" '"+e.chosenOptions.title+"' "+e.chosenOptions.shopify+" "+e.chosenOptions.bigcommerce+" '"+e.chosenOptions.iconUrl+"' '"+e.chosenOptions.storeUrl+"' false 'com.sandbox."+e.packageId+"' '"+e.googleSignInId+"' 'sSXF0deBROiU1Nt4C5GVGw' '__NtzsBSRsmQrHJhl5kKCg' '' '' '' '' '' '"+e.chosenOptions.splashBackground+"' '#ffffff' "+e._id+" '274331966514861' '"+e.chosenOptions.title+"'\n\nmkdir $SCRIPTPATH/buildMaterials\n\ncurl -o $SCRIPTPATH/buildMaterials/icon.png "+e.chosenOptions.iconUrl+"\n\ncurl -o $SCRIPTPATH/buildMaterials/googlePlayBanner.png "+e.chosenOptions.bannerUrl+"\n\n",n=new(S());n.file("buildScript.sh",t),n.file("shortDescription.txt",e.chosenOptions.shortDesc),n.file("longDescription.t",e.chosenOptions.longDesc),n.file("README.txt","WHAT TO DO WITH THIS BUNDLE: \n\n- copy the buildScript.sh file into the root of the SandBox-Previewer-React-Native directory, overwriting any existing file with the same name\n- run the file using 'sh buildScript.sh', it may ask for a password, just input the password you use to log in to your computer\n- this will create a directory called 'buildMaterials' in the root of SandBox-Previewer-React-Native (if it did not already exist), this will contain the assets you need to upload to Google Play\n- the project should now be configured to build the app you downloaded this bundle for, you can proceed normally using 'sh theScript.sh -build' and/or xcode"),n.generateAsync({type:"blob"}).then((function(e){(0,f.saveAs)(e,"buildKit.zip")}))}},{key:"handleSorting",value:function(e){var t=this,n=JSON.parse(JSON.stringify(this.state.sorted)),o=[];1===n.length&&n[0].id===e?n[0].desc&&(o=[{id:e,desc:!1}]):o=[{id:e,desc:!0}],this.setState({sorted:o},(function(){t.fetchData({page:t.state.page,pageSize:t.state.pageSize})}))}},{key:"render",value:function(){var e=this,t=[{id:"checkbox",show:!0,Header:function(){return(0,L.jsx)("span",{style:Z.header})},accessor:function(e){return e},Cell:function(t){return(0,L.jsx)("div",{className:"checkbox-container checkbox-container-admin",style:{backgroundColor:e.props.user.superAdminPreviewApp===t.value._id?"yellow":"transparent",marginLeft:10},children:(0,L.jsx)(h.X,{checked:e.state.checkedArray.indexOf(t.value._id)>-1,className:"checkBoxAdmin",onChange:function(){return e.checkApp(t.value)}})})},width:50},{id:"icon",show:this.state.displayColumns.title,Header:function(){return(0,L.jsx)("span",{style:Z.header,children:"ICON"})},accessor:function(e){return e},Cell:function(t){return(0,L.jsx)("div",{style:{backgroundColor:e.props.user.superAdminPreviewApp===t.value._id?"yellow":"white"},children:t.value&&t.value.chosenOptions&&t.value.chosenOptions.iconUrl?(0,L.jsx)("img",{src:t.value.chosenOptions.iconUrl,style:{height:30,width:30}}):null})},width:60},{id:"title",show:this.state.displayColumns.title,Header:function(){return(0,L.jsxs)("span",{style:Z.headerSortable,onClick:function(){e.handleSorting("title")},children:[(0,L.jsx)(d.G,{style:Z.faIcon,icon:l.zDS}),"APP NAME",e.state.sorted[0]&&"title"===e.state.sorted[0].id&&e.state.sorted[0].desc?" \u25b2":"",e.state.sorted[0]&&"title"===e.state.sorted[0].id&&!e.state.sorted[0].desc?" \u25bc":""]})},accessor:function(e){return e},Cell:function(t){return(0,L.jsx)("a",{style:{cursor:"pointer",fontSize:10,textDecoration:"underline"},onClick:function(){return e.preUseApp(t.value)},children:t.value&&t.value.chosenOptions&&t.value.chosenOptions.title&&"Neaw App"!==t.value.chosenOptions.title?t.value.chosenOptions.title:t.value.chosenOptions.shopifyStoreName?t.value.chosenOptions.shopifyStoreName:t.value.chosenOptions.bcStoreHash?t.value.chosenOptions.bcStoreHash:t.value.chosenOptions.threeDCartStoreUrl})}},{id:"fullname",show:this.state.displayColumns.fullName,Header:function(){return(0,L.jsxs)("span",{style:Z.header,children:[(0,L.jsx)(d.G,{style:Z.faIcon,icon:l.ILF}),"USER'S NAME"]})},accessor:function(e){return e},Cell:function(t){return(0,L.jsx)("a",{style:{cursor:"pointer",fontSize:10,textDecoration:"underline"},onClick:function(){return e.openFurtherDetailsModal(t.value)},children:t.value&&t.value.chosenOptions&&t.value.chosenOptions.ownerName&&" "!==t.value.chosenOptions.ownerName?t.value.chosenOptions.ownerName:t.value&&t.value.ownerEmail?t.value.ownerEmail:"Default Name"})}},{id:"created",show:this.state.displayColumns.created,Header:function(){return(0,L.jsxs)("span",{style:Z.header,children:[(0,L.jsx)(x(),{border:!1,name:"calendar-o",style:{marginRight:5}}),"CREATED"]})},accessor:function(t){return e.prettifyDate(t.created)},Cell:function(e){return(0,L.jsx)("span",{style:{fontSize:10},children:e.value})},width:125},{id:"store",show:this.state.displayColumns.store,Header:function(){return(0,L.jsx)("span",{style:Z.header,children:"STORE TYPE"})},accessor:function(e){return e},Cell:function(t){return(0,L.jsxs)("div",{children:[t.value&&t.value.chosenOptions&&t.value.chosenOptions.shopifyAccessToken?(0,L.jsx)("a",{onClick:function(){return e.onlyStore("onlySF")},style:{color:"#95BF47",fontSize:10,textDecoration:"underline",cursor:"pointer"},children:"SHOPIFY"}):null,t.value&&t.value.chosenOptions&&t.value.chosenOptions.bcAccessToken?(0,L.jsx)("a",{onClick:function(){return e.onlyStore("onlyBC")},style:{color:"#5555ff",fontSize:10,textDecoration:"underline",cursor:"pointer"},children:"BIGCOMMERCE"}):null,t.value&&t.value.chosenOptions&&t.value.chosenOptions.threeDCartAccessToken||t.value.chosenOptions.threeDCart?(0,L.jsx)("a",{onClick:function(){return e.onlyStore("only3D")},style:{color:"#22AC60",fontSize:10,textDecoration:"underline",cursor:"pointer"},children:"3DCART"}):null]})}},{id:"payment",show:this.state.displayColumns.payment,Header:function(){return(0,L.jsx)("span",{style:Z.header,children:"PAYMENT"})},accessor:function(e){return e},Cell:function(e){return(0,L.jsxs)("div",{children:[e.value&&e.value.chosenOptions&&e.value.monthlyStripeAccountId?(0,L.jsx)("span",{style:{color:"#6772e5",fontSize:10},children:"STRIPE"}):null,e.value&&e.value.chosenOptions&&e.value.shopifyChargeId?(0,L.jsx)("span",{style:{color:"#95BF47",fontSize:10},children:"SHOPIFY"}):null,e.value&&e.value.chosenOptions&&!e.value.shopifyChargeId&&!e.value.monthlyStripeAccountId?(0,L.jsx)("span",{style:{color:"#ff7c00",fontSize:10},children:"NONE YET"}):null]})}},{id:"revenue",show:this.state.displayColumns.payment,Header:function(){return(0,L.jsx)("span",{style:Z.header,children:"REVENUE"})},accessor:function(e){return e},Cell:function(e){return(0,L.jsx)("span",{style:{fontSize:10},children:e.value.revenue?e.value.revenue:"Coming Soon"})}},{id:"lastBilled",show:this.state.displayColumns.billing,Header:function(){return(0,L.jsx)("span",{style:Z.header,children:"NEXT BILL DATE"})},accessor:function(e){if(e.lastBilled){var t=new Date(e.lastBilled),n=new Date(t.setMonth(t.getMonth()+1));return{isShopify:!1,nextBillDate:n.getUTCFullYear()+"/"+(n.getUTCMonth()+1)+"/"+n.getUTCDate(),fullApp:e}}if(e.shopifyChargeId)return{isShopify:!0,fullApp:e};
1if(e.trialEndDate){var o=new Date(e.trialEndDate),s=new Date(o.setMonth(o.getMonth()));return{isShopify:!1,nextBillDate:s.getUTCFullYear()+"/"+(s.getUTCMonth()+1)+"/"+s.getUTCDate(),fullApp:e}}return{}},Cell:function(t){return(0,L.jsxs)("div",{children:[t.value&&t.value.nextBillDate?(0,L.jsx)("span",{style:{fontSize:10},children:t.value.nextBillDate}):null,t.value&&t.value.isShopify?(0,L.jsx)("span",{style:{fontSize:10,cursor:"pointer"},children:(0,L.jsx)("a",{onClick:function(){return e.getMoreShopifyInfo(t.value.fullApp)},children:"Shopify Billing Info"})}):null,!t.value||t.value.isShopify||t.value.nextBillDate?null:(0,L.jsx)("span",{style:{fontSize:10,color:"grey"},children:"Not Subscribed"})]})}},{id:"trialEndDate",show:this.state.displayColumns.trialEndDate,Header:function(){return(0,L.jsxs)("span",{style:Z.headerSortable,onClick:function(){e.handleSorting("trialEndDate")},children:["DAYS UNTIL TRIAL ENDS",e.state.sorted[0]&&"trialEndDate"===e.state.sorted[0].id&&e.state.sorted[0].desc?" \u25b2":"",e.state.sorted[0]&&"trialEndDate"===e.state.sorted[0].id&&!e.state.sorted[0].desc?" \u25bc":""]})},accessor:function(e){var t="Ended";if(e.trialEndDate){var n=D(e.trialEndDate),o=D();(t=n.diff(o,"days"))<1&&(t="Trial Ended")}return t},Cell:function(e){return(0,L.jsx)("span",{style:{fontSize:10},children:e.value})}},{id:"trialEndDate2",show:this.state.displayColumns.trialEndDate,Header:function(){return(0,L.jsxs)("span",{style:Z.headerSortable,onClick:function(){e.handleSorting("trialEndDate2")},children:["TRIAL END DATE",e.state.sorted[0]&&"trialEndDate2"===e.state.sorted[0].id&&e.state.sorted[0].desc?" \u25b2":"",e.state.sorted[0]&&"trialEndDate2"===e.state.sorted[0].id&&!e.state.sorted[0].desc?" \u25bc":""]})},accessor:function(e){var t="No Trial";return e.trialEndDate&&(t=D(e.trialEndDate).format("MM-DD-YYYY")),t},Cell:function(e){return(0,L.jsx)("span",{style:{fontSize:10},children:e.value})}},{id:"tier",show:this.state.displayColumns.tier,Header:function(){return(0,L.jsxs)("span",{style:Z.headerSortable,onClick:function(){e.handleSorting("tier")},children:["TIER",e.state.sorted[0]&&"tier"===e.state.sorted[0].id&&e.state.sorted[0].desc?" \u25b2":"",e.state.sorted[0]&&"tier"===e.state.sorted[0].id&&!e.state.sorted[0].desc?" \u25bc":""]})},accessor:function(e){var t=new Date(e.trialEndDate);return t.setDate(t.getDate()+1),e.subscriptionPlan&&(e.monthlyStripeAccountId||e.shopifyChargeId)?t>new Date?"instagram"===e.subscriptionPlan||e.chosenOptions&&e.chosenOptions.socialApp?"Social Trial":"Trial":e.subscriptionPlan.charAt(0).toUpperCase()+e.subscriptionPlan.slice(1):e.monthlyStripeAccountId||e.shopifyChargeId?"None Yet":"instagram"===e.subscriptionPlan||e.chosenOptions&&e.chosenOptions.socialApp?"Social Paywall":"Paywall"},Cell:function(e){return(0,L.jsx)("span",{style:{fontSize:10},children:e.value})}},{id:"publishStatus",show:this.state.displayColumns.publishStatus,Header:function(){return(0,L.jsx)("span",{style:Z.header,children:"PUBLISH STATUS"})},accessor:function(e){return e},Cell:function(e){return(0,L.jsx)("span",{style:{fontSize:10},children:e.value.submittedForReview?"Published":"instagram"===e.value.subscriptionPlan?"N/A":"Pending..."})}},{id:"deploymentStatus",show:this.state.displayColumns.deploymentStatus,Header:function(){return(0,L.jsx)("span",{style:Z.header,children:"DEPLOYMENT STATUS"})},accessor:function(e){return e},Cell:function(t){return(0,L.jsxs)("div",{onClick:function(){return e.openEditDeploymentStatusModal(t.value)},style:{cursor:"pointer"},children:[(0,L.jsxs)("p",{children:["Apple: ",t.value.appleProgress]}),(0,L.jsxs)("p",{children:["Android: ",t.value.googleProgress]})]})},width:175},{id:"activeUsers",show:this.state.displayColumns.activeUsers,Header:function(){return(0,L.jsxs)("span",{style:Z.headerSortable,onClick:function(){e.handleSorting("activeUsers")},children:["USERS",e.state.sorted[0]&&"activeUsers"===e.state.sorted[0].id&&e.state.sorted[0].desc?" \u25b2":"",e.state.sorted[0]&&"activeUsers"===e.state.sorted[0].id&&!e.state.sorted[0].desc?" \u25bc":""]})},accessor:function(e){return e},Cell:function(e){return(0,L.jsx)("span",{style:{fontSize:10},children:e.value.activeUsers})},width:75},{id:"roughSize",show:this.state.displayColumns.roughSize,Header:function(){return(0,L.jsx)("span",{style:Z.header,children:"ROUGH DATA SIZE"})},accessor:function(e){return function(e){for(var t=[],n=[e],o=0;n.length;){var s=n.pop();if("boolean"===typeof s)o+=4;else if("string"===typeof s)o+=2*s.length;else if("number"===typeof s)o+=8;else if("object"===typeof s&&-1===t.indexOf(s))for(var i in t.push(s),s)n.push(s[i])}return o/1024}(e)},Cell:function(e){return(0,L.jsx)("span",{style:{fontSize:10},children:e.value.toFixed(1)+" KB"})},width:75},{id:"tools",show:this.state.displayColumns.tools,Header:function(){return(0,L.jsxs)("span",{style:Z.header,children:[(0,L.jsx)(d.G,{style:Z.faIcon,icon:l.b7W}),"TOOLS"]})},accessor:function(e){return e},Cell:function(t){return e.constructOptionsButton(t.value)}}];return(0,L.jsxs)("div",{style:Z.section,children:[(0,L.jsxs)(A.Z,{style:{padding:"0",marginBottom:10,display:"flex",justifyContent:"space-between"},children:[(0,L.jsx)(E.Z,{xs:2,children:this.state.checkedArray.length>0?(0,L.jsx)(c.z,{primary:!0,id:"orange-button",onClick:function(){return e.archiveBatch()},style:{padding:"5px 0px"},children:"Archive Selected"}):null}),(0,L.jsx)(E.Z,{xs:4,children:(0,L.jsx)(u.n,{placeholder:"Enter a search term...",value:this.state.searchString,onChange:this.updateSearchString,id:"searchInputAdmin"})}),(0,L.jsx)(E.Z,{xs:1,style:{maxWidth:"none"},children:(0,L.jsx)(c.z,{primary:!0,id:"orange-button",onClick:function(){return e.fetchData({page:e.state.page,pageSize:e.state.pageSize})},children:"Search"})}),(0,L.jsx)(E.Z,{xs:2,children:(0,L.jsx)(h.X,{label:"Has Active Payment Data",checked:this.state.customerMode,id:"customerMode",name:"customerMode",onChange:function(){return e.changeMode("customerMode")}})}),(0,L.jsx)(E.Z,{xs:2,children:(0,L.jsx)(h.X,{label:"Show Archived Apps",checked:this.state.archiveMode,id:"archiveMode",name:"archiveMode",onChange:function(){return e.changeMode("archiveMode")}})})]}),(0,L.jsx)(W,{columns:t,data:this.state.data,pageManual:this.state.page,pageSizeManual:this.state.pageSize,pageCount:this.state.totalPages,onPageChange:function(t){e.setState({page:t},(function(){e.fetchData({page:e.state.page,pageSize:e.state.pageSize})}))},onPageSizeChange:function(t,n){e.setState({page:n,pageSize:t},(function(){e.fetchData({page:e.state.page,pageSize:e.state.pageSize})}))},loading:this.state.loading}),(0,L.jsxs)(y.Z,{show:this.state.showCustomerConfirmationSwal,onHide:function(){return e.setState({showCustomerConfirmationSwal:!1})},children:[(0,L.jsx)(y.Z.Header,{closeButton:!0,children:(0,L.jsx)(y.Z.Title,{children:"Confirmation"})}),(0,L.jsx)(y.Z.Body,{children:(0,L.jsx)("p",{children:"This action will immediately charge the client $"+this.state.customerConfirmationSwalPrice.toFixed(2)+", which is a prorated amount for the '"+this.state.customerConfirmationSwalPlan+"' plan which will bill in its entirety "+this.state.customerConfirmationSwalNumberOfDays+" days from now. Are you sure you wish to proceed?"})}),(0,L.jsxs)(y.Z.Footer,{children:[(0,L.jsx)(c.z,{onClick:this.preUpdateCustomerSupportTier,children:"Yes"}),(0,L.jsx)(c.z,{onClick:function(){return e.setState({showCustomerConfirmationSwal:!1})},children:"No"})]})]}),(0,L.jsx)(y.Z,{show:this.state.showFurtherDetailsModal,onHide:function(){return e.setState({showFurtherDetailsModal:!1,appBeingExamined:{}})},centered:!0,style:{zIndex:1e4},size:"xl",children:(0,L.jsxs)("div",{children:[(0,L.jsx)(y.Z.Header,{style:{color:"black",borderBottom:"none"},closeButton:!0,children:(0,L.jsx)(y.Z.Title,{children:"Further Details"})}),(0,L.jsx)(y.Z.Body,{style:{color:"black"},children:(0,L.jsxs)("div",{children:[(0,L.jsxs)("div",{style:{width:"45%",height:500,float:"left",borderRightStyle:"solid",borderRightWidth:1,borderRightColor:"#000000",marginRight:"5%"},children:[(0,L.jsx)("h2",{style:{textAlign:"center",fontSize:18,margin:10,fontWeight:600},children:"App Information"}),(0,L.jsxs)("table",{style:{width:"100%"},children:[(0,L.jsxs)("tr",{children:[(0,L.jsx)("th",{children:"Name"}),(0,L.jsx)("td",{children:this.state.appBeingExamined.chosenOptions&&this.state.appBeingExamined.chosenOptions.ownerName})]}),(0,L.jsxs)("tr",{children:[(0,L.jsx)("th",{children:"Email"}),(0,L.jsx)("td",{children:this.state.appBeingExamined.chosenOptions&&this.state.appBeingExamined.ownerEmail})]}),(0,L.jsxs)("tr",{children:[(0,L.jsx)("th",{children:"Phone"}),(0,L.jsx)("td",{children:this.state.appBeingExamined.chosenOptions&&this.state.appBeingExamined.chosenOptions.phone})]}),(0,L.jsxs)("tr",{children:[(0,L.jsx)("th",{children:"Created Date"}),(0,L.jsx)("td",{children:this.prettifyDate(this.state.appBeingExamined.created)})]}),(0,L.jsxs)("tr",{children:[(0,L.jsx)("th",{children:"Store Name"}),(0,L.jsx)("td",{children:this.state.appBeingExamined.chosenOptions&&this.state.appBeingExamined.chosenOptions.title&&"New App"!==this.state.appBeingExamined.chosenOptions.title?this.state.appBeingExamined.chosenOptions&&this.state.appBeingExamined.chosenOptions.title:this.state.appBeingExamined.chosenOptions&&this.state.appBeingExamined.chosenOptions.shopifyStoreName?this.state.appBeingExamined.chosenOptions&&this.state.appBeingExamined.chosenOptions.shopifyStoreName:this.state.appBeingExamined.chosenOptions&&this.state.appBeingExamined.chosenOptions.bcStoreHash})]}),(0,L.jsxs)("tr",{children:[(0,L.jsx)("th",{children:"Store URL"}),(0,L.jsx)("td",{children:(0,L.jsx)("a",{href:this.state.appBeingExamined.storeUrl,target:"_blank",rel:"noreferrer",children:this.state.appBeingExamined.storeUrl})})]}),(0,L.jsxs)("tr",{children:[(0,L.jsx)("th",{children:"Total Downloads"}),(0,L.jsx)("td",{children:"TBD"})]}),(0,L.jsxs)("tr",{children:[(0,L.jsx)("th",{children:"Active Users"}),(0,L.jsx)("td",{children:this.state.appBeingExamined.activeUsers?this.state.appBeingExamined.activeUsers:0})]}),(0,L.jsxs)("tr",{children:[(0,L.jsx)("th",{children:"Inactive Users"}),(0,L.jsx)("td",{children:"TBD"})]}),(0,L.jsxs)("tr",{children:[(0,L.jsx)("th",{children:"Payment Type"}),(0,L.jsxs)("td",{children:[this.state.appBeingExamined.chosenOptions&&this.state.appBeingExamined.monthlyStripeAccountId?"STRIPE":null,this.state.appBeingExamined.chosenOptions&&this.state.appBeingExamined.shopifyChargeId?"SHOPIFY":null]})]}),(0,L.jsxs)("tr",{children:[(0,L.jsx)("th",{children:"Last Payment"}),(0,L.jsxs)("td",{children:[this.state.appBeingExamined&&this.state.appBeingExamined.nextBillDate?this.state.appBeingExamined.nextBillDate:null,this.state.appBeingExamined&&this.state.appBeingExamined.isShopify?(0,L.jsx)("span",{style:{fontSize:12,cursor:"pointer"},children:(0,L.jsx)("a",{onClick:function(){return e.getMoreShopifyInfo(e.state.appBeingExamined)},children:"Click for Shopify Charge Info"})}):null]})]}),(0,L.jsxs)("tr",{children:[(0,L.jsx)("th",{children:"Tier"}),(0,L.jsx)("td",{children:this.state.appBeingExamined.subsciptionPlan?this.state.appBeingExamined.subscriptionPlan.charAt(0).toUpperCase()+this.state.appBeingExamined.subscriptionPlan.slice(1):new Date(this.state.appBeingExamined.trialEndDate)>new Date?"Trial":"Expired"})]})]})]}
1),(0,L.jsxs)("div",{style:{width:"50%",float:"right",height:500,overflowY:"scroll"},children:[(0,L.jsx)("h2",{style:{textAlign:"center",fontSize:18,margin:10,fontWeight:600},children:"Recent Active User Events (In-App)"}),this.state.loadingEvents?(0,L.jsx)("p",{children:"Loading...."}):(0,L.jsxs)("table",{style:{width:"100%"},children:[(0,L.jsxs)("tr",{children:[(0,L.jsx)("th",{children:"USER"}),(0,L.jsx)("th",{children:"TYPE"}),(0,L.jsx)("th",{children:"TIMESTAMP"})]}),this.state.appEvents.map((function(e,t){return(0,L.jsxs)("tr",{children:[(0,L.jsx)("td",{children:e.customerId}),(0,L.jsx)("td",{children:e.description}),(0,L.jsx)("td",{children:e.timeStamp})]},t)}))]})]})]})})]})}),(0,L.jsx)(y.Z,{show:this.state.showBillingModal,onHide:function(){return e.setState({showBillingModal:!1})},centered:!0,style:{zIndex:1e4},children:(0,L.jsxs)("div",{children:[(0,L.jsx)(y.Z.Header,{style:{color:"black",borderBottom:"none"},closeButton:!0}),(0,L.jsx)(y.Z.Body,{style:{color:"black",paddingBottom:100},children:(0,L.jsxs)("div",{children:[(0,L.jsxs)(A.Z,{style:{marginBottom:20,marginLeft:5},children:[(0,L.jsxs)("h3",{className:"account-page-header",style:{fontWeight:700},children:["Current Plan"," "]}),(0,L.jsx)("h3",{className:"account-page-header",children:(0,L.jsx)("span",{children:this.state.billingOverviewInfo.currentPlan})}),this.state.billingOverviewInfo.test?(0,L.jsx)("h3",{className:"account-page-header",children:(0,L.jsx)("span",{style:{color:"orange"},children:"Test"})}):null]}),(0,L.jsxs)(A.Z,{style:{marginBottom:20,marginLeft:5},children:[(0,L.jsxs)("h3",{className:"account-page-header",style:{fontWeight:700},children:["Member Since"," "]}),(0,L.jsx)("h3",{className:"account-page-header",children:(0,L.jsx)("span",{children:this.state.billingOverviewInfo.dateSince})})]}),(0,L.jsxs)(A.Z,{style:{marginBottom:20,marginLeft:5},children:[(0,L.jsxs)("h3",{className:"account-page-header",style:{fontWeight:700},children:["Next Bill Date"," "]}),(0,L.jsx)("h3",{className:"account-page-header",children:(0,L.jsx)("span",{children:this.state.billingOverviewInfo.nextBillDate})})]})]})})]})}),(0,L.jsxs)(y.Z,{show:this.state.showEditPackageIdModal,onHide:function(){return e.setState({showEditPackageIdModal:!1})},children:[(0,L.jsx)(y.Z.Header,{closeButton:!0,children:(0,L.jsx)(y.Z.Title,{children:"Edit Package Id"})}),(0,L.jsxs)(y.Z.Body,{children:[(0,L.jsx)("h4",{children:"Package Id"}),(0,L.jsx)(T.Z,{horizontal:!0,children:(0,L.jsx)(F.Z,{controlId:"term",children:(0,L.jsx)(E.Z,{sm:12,children:(0,L.jsx)(I.Z,{className:"customInputText",type:"text",name:"packageId",placeholder:"packageId",value:this.state.packageIdString,onChange:this.updatePackageIdState})})})})]}),(0,L.jsxs)(y.Z.Footer,{children:[(0,L.jsx)(c.z,{onClick:function(){return e.setState({showEditPackageIdModal:!1})},children:"Close"}),(0,L.jsx)(c.z,{onClick:this.updatePackageId,children:"Update"})]})]}),(0,L.jsxs)(y.Z,{show:this.state.showEditSubscriptionModal,onHide:function(){return e.setState({showEditSubscriptionModal:!1})},children:[(0,L.jsx)(y.Z.Header,{closeButton:!0,children:(0,L.jsx)(y.Z.Title,{children:"Edit Subscription PLan"})}),(0,L.jsxs)(y.Z.Body,{children:[(0,L.jsx)("h4",{children:"Enter thew new subscription plan in all lower case, ie; 'launch'"}),(0,L.jsx)(T.Z,{horizontal:!0,children:(0,L.jsx)(F.Z,{controlId:"term",children:(0,L.jsx)(E.Z,{sm:12,children:(0,L.jsx)(I.Z,{className:"customInputText",type:"text",name:"subscriptionPlan",placeholder:"subscription plan",value:this.state.subscriptionPlanString,onChange:this.updateSubscriptionPlanState})})})})]}),(0,L.jsxs)(y.Z.Footer,{children:[(0,L.jsx)(c.z,{onClick:function(){return e.setState({showEditSubscriptionModal:!1})},children:"Close"}),(0,L.jsx)(c.z,{onClick:this.updateSubscriptionPlan,children:"Update"})]})]}),(0,L.jsxs)(y.Z,{show:this.state.showEditDeploymentStatusModal,onHide:function(){return e.setState({showEditDeploymentStatusModal:!1})},children:[(0,L.jsx)(y.Z.Header,{closeButton:!0,children:(0,L.jsx)(y.Z.Title,{children:"Edit Deployment Status"})}),(0,L.jsxs)(y.Z.Body,{children:[(0,L.jsx)("h4",{children:"Apple App Store"}),(0,L.jsx)(T.Z,{horizontal:!0,children:(0,L.jsx)(F.Z,{controlId:"term",children:(0,L.jsx)(E.Z,{sm:12,children:(0,L.jsx)(I.Z,{className:"customInputText",type:"text",name:"ios",placeholder:"deployment status",value:this.state.deploymentStatusStringIOS,onChange:this.updateDeploymentStatusState})})})}),(0,L.jsx)("h4",{children:"Google Play Store"}),(0,L.jsx)(T.Z,{horizontal:!0,children:(0,L.jsx)(F.Z,{controlId:"term",children:(0,L.jsx)(E.Z,{sm:12,children:(0,L.jsx)(I.Z,{className:"customInputText",type:"text",name:"android",placeholder:"deployment status",value:this.state.deploymentStatusStringANDROID,onChange:this.updateDeploymentStatusState})})})})]}),(0,L.jsxs)(y.Z.Footer,{children:[(0,L.jsx)(c.z,{onClick:function(){return e.setState({showEditDeploymentStatusModal:!1})},children:"Close"}),(0,L.jsx)(c.z,{onClick:this.updateDeploymentStatus,children:"Update"})]})]}),(0,L.jsxs)(y.Z,{show:this.state.showEditCustomerSupportTierModal,onHide:function(){return e.setState({showEditCustomerSupportTierModal:!1})},children:[(0,L.jsx)(y.Z.Header,{closeButton:!0,children:(0,L.jsx)(y.Z.Title,{children:"Edit Support Tier"})}),(0,L.jsxs)(y.Z.Body,{children:[(0,L.jsx)("h4",{children:"Select Customer Support Tier"}),(0,L.jsxs)("div",{children:[(0,L.jsx)(h.X,{label:"Basic",checked:"basic"===this.state.customerSupportPlanToBeEdited,id:"customerTierBasic",name:"customerTierBasic",onChange:function(){return e.updateCustomerSupportTierState("basic")},style:{marginRight:10}}),(0,L.jsx)("br",{}),(0,L.jsx)(h.X,{label:"Advanced",checked:"advanced"===this.state.customerSupportPlanToBeEdited,id:"customerTierAdvanced",name:"customerTierAdvanced",onChange:function(){return e.updateCustomerSupportTierState("advanced")},style:{marginRight:10}}),(0,L.jsx)("br",{}),(0,L.jsx)(h.X,{label:"Enterprise",checked:"enterprise"===this.state.customerSupportPlanToBeEdited,id:"customerTierEnterprise",name:"customerTierEnterprise",onChange:function(){return e.updateCustomerSupportTierState("enterprise")},style:{marginRight:10}}),(0,L.jsx)("br",{})]}),(0,L.jsx)("h4",{children:"Enterprise Support Tier Price"}),(0,L.jsx)(T.Z,{horizontal:!0,children:(0,L.jsx)(F.Z,{controlId:"term",children:(0,L.jsx)(E.Z,{sm:12,children:(0,L.jsx)(I.Z,{disabled:"enterprise"!==this.state.customerSupportPlanToBeEdited,className:"customInputText",type:"text",name:"custom price",placeholder:"custom price",value:this.state.customerSupportCustomPriceToBeEdited,onChange:this.updateCustomerSupportCustomPriceState})})})})]}),(0,L.jsxs)(y.Z.Footer,{children:[(0,L.jsx)(c.z,{onClick:this.prePreUpdate
1CustomerSupportTier,children:"Update"}),(0,L.jsx)(c.z,{onClick:function(){return e.setState({showEditCustomerSupportTierModal:!1})},children:"Close"})]})]}),(0,L.jsxs)(y.Z,{show:this.state.showAppStoreModal,onHide:function(){return e.setState({showAppStoreModal:!1})},children:[(0,L.jsx)(y.Z.Header,{closeButton:!0,children:(0,L.jsx)(y.Z.Title,{children:"Modify App Store Links"})}),(0,L.jsxs)(y.Z.Body,{children:[(0,L.jsx)("h4",{children:"Google Play Store"}),(0,L.jsx)(T.Z,{horizontal:!0,children:(0,L.jsxs)(F.Z,{controlId:"term",children:[(0,L.jsx)(E.Z,{sm:12,children:(0,L.jsx)(I.Z,{className:"customInputText",type:"text",name:"playStore",placeholder:"Play Store URL",value:this.state.playStoreString,onChange:this.updateStoreLinkState})}),(0,L.jsx)(E.Z,{sm:12,children:(0,L.jsx)(I.Z,{className:"customInputText",type:"text",name:"androidVersionString",placeholder:"Version Number",value:this.state.androidVersionString,onChange:this.updateStoreLinkState})})]})}),(0,L.jsx)("h4",{children:"Apple App Store"}),(0,L.jsx)(T.Z,{horizontal:!0,children:(0,L.jsxs)(F.Z,{controlId:"term",children:[(0,L.jsx)(E.Z,{sm:12,children:(0,L.jsx)(I.Z,{className:"customInputText",type:"text",name:"itunes",placeholder:"App Store URL",value:this.state.itunesString,onChange:this.updateStoreLinkState})}),(0,L.jsx)(E.Z,{sm:12,children:(0,L.jsx)(I.Z,{className:"customInputText",type:"text",name:"appleVersionString",placeholder:"Version Number",value:this.state.appleVersionString,onChange:this.updateStoreLinkState})})]})}),(0,L.jsxs)("p",{children:['<script type="text/javascript">',"var i=(/iphone|ipad|ipod/i.test(navigator.userAgent.toLowerCase()));","var a=(/android/i.test(navigator.userAgent.toLowerCase()));","var t='"+this.state.itunesString+"';","var g='"+this.state.playStoreString+"';","if(i||a){","if(confirm('This store has a mobile app!  Would you like to download the mobile app?')){","if(i&&t){","window.open(t);","}else if(a && g){","window.open(g);","}","}","}","<\/script>"]})]}),(0,L.jsxs)(y.Z.Footer,{children:[(0,L.jsx)(c.z,{onClick:this.updateStoreLinks,children:"Update"}),(0,L.jsx)(c.z,{onClick:function(){return e.setState({showAppStoreModal:!1})},children:"Close"})]})]}),(0,L.jsxs)(y.Z,{show:this.state.showEditTrialModal,onHide:function(){return e.setState({showEditTrialModal:!1})},children:[(0,L.jsx)(y.Z.Header,{closeButton:!0,children:(0,L.jsx)(y.Z.Title,{children:"Edit Trial End Date"})}),(0,L.jsxs)(y.Z.Body,{children:[(0,L.jsx)("h4",{children:"Date"}),(0,L.jsx)(T.Z,{horizontal:!0,children:(0,L.jsx)(F.Z,{controlId:"term",children:(0,L.jsx)(E.Z,{sm:12,children:(0,L.jsx)(I.Z,{className:"customInputText",type:"text",name:"term",placeholder:"Date (Important: mm/dd/yyyy format)",onChange:this.updateTrialEndState})})})})]}),(0,L.jsxs)(y.Z.Footer,{children:[(0,L.jsx)(c.z,{onClick:this.updateTrial,children:"Update"}),(0,L.jsx)(c.z,{onClick:function(){return e.setState({showEditTrialModal:!1})},children:"Close"})]})]}),(0,L.jsxs)(y.Z,{show:this.state.showEditUserCountModal,onHide:function(){return e.setState({showEditUserCountModal:!1})},children:[(0,L.jsx)(y.Z.Header,{closeButton:!0,children:(0,L.jsx)(y.Z.Title,{children:"Edit User Count"})}),(0,L.jsxs)(y.Z.Body,{children:[(0,L.jsx)("h4",{children:"Users"}),(0,L.jsx)(T.Z,{horizontal:!0,children:(0,L.jsx)(F.Z,{controlId:"term",children:(0,L.jsx)(E.Z,{sm:12,children:(0,L.jsx)(I.Z,{className:"customInputText",type:"text",name:"term",placeholder:"Number of users",onChange:this.updateUserCountState})})})})]}),(0,L.jsxs)(y.Z.Footer,{children:[(0,L.jsx)(c.z,{onClick:this.updateUserCount,children:"Update"}),(0,L.jsx)(c.z,{onClick:function(){return e.setState({showEditUserCountModal:!1})},children:"Close"})]})]}),(0,L.jsxs)(y.Z,{show:this.state.showEditShopifyTrialModal,onHide:function(){return e.setState({showEditShopifyTrialModal:!1})},children:[(0,L.jsx)(y.Z.Header,{closeButton:!0,children:(0,L.jsx)(y.Z.Title,{children:"Enter Number of Extra Days (10, 30, 60, or 365)"})}),(0,L.jsxs)(y.Z.Body,{children:[(0,L.jsx)("h4",{children:"Date"}),(0,L.jsx)(T.Z,{horizontal:!0,children:(0,L.jsx)(F.Z,{controlId:"term",children:(0,L.jsx)(E.Z,{sm:12,children:(0,L.jsx)(I.Z,{className:"customInputText",type:"text",name:"term",placeholder:"Number of days",onChange:this.updateShopifyTrialEndState})})})})]}),(0,L.jsxs)(y.Z.Footer,{children:[(0,L.jsx)(c.z,{onClick:this.updateShopifyTrial,children:"Update"}),(0,L.jsx)(c.z,{onClick:function(){return e.setState({showEditShopifyTrialModal:!1})},children:"Close"})]})]}),(0,L.jsxs)(y.Z,{show:this.state.showAppOptionsModal,onHide:this.closeAdminAppModal,centered:!0,size:"md",children:[(0,L.jsx)(y.Z.Header,{closeButton:!0,children:(0,L.jsx)(y.Z.Title,{style:{fontFamily:"Inter",letterSpacing:"-0.022em",fontWeight:"bold"},children:"APP OPTIONS"})}),(0,L.jsxs)(y.Z.Body,{children:[!this.props.user.specialPermissionTier||"customerSuccess"!==this.props.user.specialPermissionTier&&"admin"!==this.props.user.specialPermissionTier?null:(0,L.jsxs)("div",{style:{marginBottom:10},children:[(0,L.jsx)("p",{style:{fontSize:14,fontWeight:"bold"},children:"Customer Success"}),(0,L.jsx)("a",{style:Z.modalLink,onClick:function(){return e.openEditCustomerSupportTierModal(e.state.appForModal)},children:"Edit Customer Support Tier"}),this.state.appForModal.shopifyChargeId?(0,L.jsx)("a",{bsStyle:"primary",onClick:function(){return e.getMoreShopifyInfo(e.state.appForModal)},style:{fontFamily:"Inter",fontStyle:"normal"},children:"View Shopify Billing Info"}):null,(0,L.jsx)("a",{style:Z.modalLink,onClick:function(){return e.openEditStoreLinkModal(e.state.appForModal)},children:"Add/Edit App Store Links and Version Numbers"}),null,this.state.appForModal.partnerApp?null:(0,L.jsx)("a",{style:Z.modalLink,onClick:function(){return e.setAsPartner(e.state.appForModal)},children:"Make Partner"}),(0,L.jsx)("a",{style:Z.modalLink,onClick:function(){return e.partnerPaywallSkip(e.state.appForModal)},children:"Partner Paywall Skip"}),this.state.appForModal.chosenOptions&&this.state.appForModal.chosenOptions.shopifyAccessToken?(0,L.jsx)("a",{style:Z.modalLink,onClick:function(){return e.openEditShopifyTrialModal(e.state.appForModal)},children:"Update Shopify Trial End"}):(0,L.jsx)("a",{style:Z.modalLink,onClick:function(){return e.openEditTrialModal(e.state.appForModal)},children:"Update Trial End"})]}),!this.props.user.specialPermissionTier||"qa"!==this.props.user.specialPermissionTier&&"developer"!==this.props.user.specialPermissionTier&&"admin"!==this.props.user.specialPermissionTier?null:(0,L.jsxs)("div",{style:{marginBottom:10},children:[(0,L.jsx)("p",{style:{fontSize:14,fontWeight:"bold"},children:"QA"}),(0,L.jsx)("a",{style:Z.modalLink,onClick:function(){return e.addToWorking(e.state.appForModal)},children:this.props.user.superAdminWorkingApps.indexOf(this.state.appForModal._id)>-1?'Remove This App from "Working On" Apps':'Add This App to "Working On" Apps'})]}),!this.props.user.specialPermissionTier||"developer"!==this.props.user.specialPermissionTier&&"admin"!==this.props.user.specialPermissionTier?null:(0,L.jsxs)("div",{style:{marginBottom:10},children:[(0,L.jsx)("p",{style:{fontSize:14,fontWeight:"bold"},children:"Developer"}),(0,L.jsx)("a",{style:Z.modalLink,onClick:function(){return e.openEditDeploymentStatusModal(e.state.appForModal)},children:"Edit Deployment Status"}),(0,L.jsx)("a",{style:Z.modalLink,onClick:function(){return e.consoleLogApp(e.state.appForModal)}}),(0,L.jsx)("a",{style:Z.modalLink,onClick:function(){return e.openEditPackageIdModal(e.state.appForModal)},children:"Edit Package Id"}),(0,L.jsx)("a",{style:Z.modalLink,onClick:function(){return e.copyBuildScript(e.state.appForModal)},children:"Copy Build Script"}),(0,L.jsx)("a",{style:Z.modalLink,onClick:function(){return e.packageAssets(e.state.appForModal)},children:"Download App Build Bundle Kit"})]}),this.props.user.specialPermissionTier&&"admin"===this.props.user.specialPermissionTier?(0,L.jsxs)("div",{style:{marginBottom:10},children:[(0,L.jsx)("p",{style:{fontSize:14,fontWeight:"bold"},children:"Admin"}),(0,L.jsx)("a",{style:Z.modalLink,onClick:function(){return e.quickFix(e.state.appForModal)},children:"Make Social App"}),(0,L.jsx)("a",{style:Z.modalLink,onClick:function(){return e.makeAdmin(e.state.appForModal)},children:"Make Admin"}),(0,L.jsx)("a",{style:Z.modalLink,onClick:function(){return e.openEditUserCountModal(e.state.appForModal)},children:"Edit User Count"}),this.state.appForModal.deleted?(0,L.jsx)("a",{style:Z.modalLink,onClick:function(){return e.undeleteApp(e.state.appForModal)},children:"Undelete/Unsuspend App"}):(0,L.jsx)("a",{style:Z.modalLink,onClick:function(){return e.deleteApp(e.state.appForModal)},children:"Delete/Suspend App"})]}):null]}),(0,L.jsx)(y.Z.Footer,{children:(0,L.jsx)(c.z,{onClick:this.closeAdminAppModal,children:"Close"})})]}),(0,L.jsxs)(y.Z,{show:this.state.showShopifyInfoModal,onHide:this.closeShopifyInfoModal,centered:!0,size:"lg",children:[(0,L.jsx)(y.Z.Header,{closeButton:!0,children:(0,L.jsx)(y.Z.Title,{children:"Shopify Information"})}),(0,L.jsx)(y.Z.Body,{children:(0,L.jsxs)("div",{children:[this.state.loadingShopifyInfo?(0,L.jsx)("p",{children:"Loading..."}):null,this.state.shopifyInfoError?(0,L.jsx)("p",{children:this.state.shopifyInfoError}):null,this.state.shopifyInfo&&this.state.shopifyInfo.status?(0,L.jsxs)("div",{children:[this.state.shopifyInfo.test?(0,L.jsx)("p",{children:(0,L.jsx)("span",{style:{fontWeight:600,color:"orange"},children:"TEST"})}):null,(0,L.jsxs)("p",{children:[(0,L.jsx)("span",{style:{fontWeight:600},children:"Subscription Name:"})," ",this.state.shopifyInfo.name]}),(0,L.jsxs)("p",{children:[(0,L.jsx)("span",{style:{fontWeight:600},children:"Status:"})," ",this.state.shopifyInfo.status]}),(0,L.jsxs)("p",{children:[(0,L.jsx)("span",{style:{fontWeight:600},children:"Interval:"})," ",this.state.shopifyInfo.shopifyChargeType]}),(0,L.jsxs)("p",{children:[(0,L.jsx)("span",{style:{fontWeight:600},children:"Price:"})," $",this.state.shopifyInfo.price]}),(0,L.jsxs)("p",{children:[(0,L.jsx)("span",{style:{fontWeight:600},children:"Activated On:"})," ",this.state.shopifyInfo.activated_on]}),(0,L.jsxs)("p",{children:[(0,L.jsx)("span",{style:{fontWeight:600},children:"Next Billing On:"})," ",this.state.shopifyInfo.billing_on]}),this.state.shopifyInfo.trial_days?(0,L.jsxs)("p",{children:[(0,L.jsx)("span",{style:{fontWeight:600},children:"Trial Length:"})," ",this.state.shopifyInfo.trial_days," (Trial Ends on:"," ",this.state.shopifyInfo.trial_ends_on,")"]}):null]}):null]})}),(0,L.jsxs)(y.Z.Footer,{children:[this.state.shopifyInfo&&this.state.shopifyInfo.status&&"active"===this.state.shopifyInfo.status?(0,L.jsx)(c.z,{onClick:this.cancelShopifySub,children:"Cancel Subscription"}):null,this.state.shopifyInfo&&this.state.shopifyInfo.status&&"cancelled"===this.state.shopifyInfo.status?(0,L.jsx)(c.z,{onClick:this.markAsCancelled,children:"Mark As Cancelled"}):null,this.state.shopifyClearTokens||this.state.shopifyInfoError?(0,L.jsx)(c.z,{onClick:this.clearShopifyTokens,children:"Clear Shopify Tokens"}):null,(0,L.jsx)(c.z,{onClick:this.closeShopifyInfoModal,children:"Close"})]})]})]})}}]),n}(g.Component);var z=(0,O.$j)((function(e,t){return{app:e.app,user:e.user,openConfigPage:t.openConfigPage}}),(function(e){return{actions:{user:(0,P.DE)(k,e),app:(0,P.DE)(j,e),admin:(0,P.DE)(v,e),event:(0,P.DE)(w,e)}}}));t.default=(0,P.qC)(z,C.EN)(H)}}]);
2//# sourceMappingURL=4088.d9765640.chunk.js.map

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.