PageSourceSearch

https://cdn.stackby.com/build/2161.aa21b5a48a67b9d7b8a2.bundle.js

js stackby.com collected 2026-09-24 09:37:50 UTC 195,567 bytes, 2 lines download raw bytes

1/*! For license information please see 2161.aa21b5a48a67b9d7b8a2.bundle.js.LICENSE.txt */
2"use strict";(self.webpackChunkStackby_webapp=self.webpackChunkStackby_webapp||[]).push([[2161],{42161:(e,t,o)=>{o.r(t),o.d(t,{default:()=>Pn});var n=o(71083),a=o(2543),i=o(52666),r=o.n(i),s=o(379),l=o.n(s),c=o(26621),d=o.n(c),u=o(63110),p=o.n(u),h=o(71468),m=o(33365),v=o(56429),f=o(53070),b=o(77698),y=o(21345),g=o(89253),w=o(92672),k=o(17041),S=o(9003),C=o(47298),I=o(35777),x=o(69126),A=o(59879),j=o(4713),T=o(68420),O=o(33670),D=o(13387),R=o(35907),N=o(92257),E=o(49607),M=o(73591),P=o(67061),L=o(70510),B=o(96763);function V(e){return V="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},V(e)}function F(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,U(n.key),n)}}function U(e){var t=function(e,t){if("object"!=V(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!=V(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==V(t)?t:t+""}function W(e,t,o){return t=G(t),function(e,t){if(t&&("object"==V(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,H()?Reflect.construct(t,o||[],G(e).constructor):t.apply(e,o))}function H(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(H=function(){return!!e})()}function G(e){return G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},G(e)}function z(e,t){return z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},z(e,t)}const J=function(e){function t(e){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(o=W(this,t,[e])).state={columnList:[],viewList:[]},o.renderActionTypes=o.renderActionTypes.bind(o),o.getColumnFields=o.getColumnFields.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&z(e,t)}(t,e),o=t,a=[{key:"componentDidMount",value:function(){this.getColumnFields()}},{key:"getColumnFields",value:function(){var e=this,t=this.props,o=t.tableId,a=t.stackId;n.A.get("/api/v1/getfield/"+a+"/"+o).then(function(t){B.log(t);var o=t.data.data.views,n=t.data.fields;e.setState({columnList:n,viewList:o})}).catch(function(e){B.log(e)})}},{key:"renderActionTypes",value:function(){}},{key:"render",value:function(){return(0,L.jsx)("div",{children:this.renderActionTypes()})}}],a&&F(o.prototype,a),i&&F(o,i),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,a,i}(l().Component);var K=o(96763);function q(e){return q="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},q(e)}function Y(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Q(n.key),n)}}function Q(e){var t=function(e,t){if("object"!=q(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!=q(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==q(t)?t:t+""}function $(e,t,o){return t=Z(t),function(e,t){if(t&&("object"==q(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,X()?Reflect.construct(t,o||[],Z(e).constructor):t.apply(e,o))}function X(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(X=function(){return!!e})()}
2function Z(e){return Z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Z(e)}function ee(e,t){return ee=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ee(e,t)}var te=[{key:1,value:"CR_ROW",text:"When record created"},{key:2,value:"UP_ROW",text:"When record updated"}],oe=[{key:1,value:"CR_ROW",text:"Create record"},{key:2,value:"UP_ROW",text:"Update record"},{key:3,value:"S_EMAIL",text:"Send Email"},{key:4,value:"SMS",text:"Send sms"},{key:5,value:"MS_TEAM",text:"Send ms team message in channel"},{key:6,value:"SLACK",text:"Send slack message"}],ne=function(e){function t(e){var o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),o=$(this,t,[e]);var n=e.item,a=n.name,i=n.triggeredAutomationId,r=n.description,s=n.actionId,l=void 0===s?null:s,c=n.tableId,d=void 0===c?null:c,u=n.viewId,p=void 0===u?null:u,h=n.isTurnedOn,m=void 0!==h&&h,v=n.action,f=void 0===v?[]:v;return o.state={item:e.item,name:a,description:r||" ",triggeredAutomationId:i,tableOptions:e.table.tableList.map(function(e,t){return{key:t,value:e.tableId,text:e.name}}),updateLoading:!1,triggerId:null,actionId:l,tableId:d,viewId:p,isTurnedOn:m,triggerType:null,action:f,trigger:null,triggerParams:null,getTriggerLoader:!1,triggerActiveIndex:0,actionsActiveIndex:0,renameAutomationOpen:!1},o.onTriggerChange=o.onTriggerChange.bind(o),o.onTableChange=o.onTableChange.bind(o),o.updateAutomation=o.updateAutomation.bind(o),o.onActionChange=o.onActionChange.bind(o),o.onAuOnOff=o.onAuOnOff.bind(o),o.addAction=o.addAction.bind(o),o.triggerCreate=o.triggerCreate.bind(o),o.getTriggerList=o.getTriggerList.bind(o),o.triggerUpdate=o.triggerUpdate.bind(o),o.getActionList=o.getActionList.bind(o),o.updateAction=o.updateAction.bind(o),o.deleteAction=o.deleteAction.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ee(e,t)}(t,e),o=t,a=[{key:"componentDidMount",value:function(){this.getTriggerList(),this.getActionList()}},{key:"onTriggerChange",value:function(e,t){var o=t.value,n=this.state.action;this.setState({triggerType:o,action:n})}},{key:"onTableChange",value:function(e,t){var o=t.value;K.log("onTableChange ...."),this.setState({tableId:o})}},{key:"updateAutomation",value:function(){var e=this,t=this.state,o=(t.item,t.triggerId,t.triggeredAutomationId),n=t.name,a=t.isTurnedOn,i=t.tableId,r=(t.viewId,t.description),s=(t.triggerType,t.action,t.actionId,this.props.table.stackId);this.setState({updateLoading:!0});var l={triggeredAutomationId:o,name:n,isTurnedOn:a,description:r,tableId:i};this.props.updateAutomation(s,l).then(function(){e.setState({updateLoading:!1,renameAutomationOpen:!1})})}},{key:"onAuOnOff",value:function(){var e=this,t=this.state.isTurnedOn;this.setState({isTurnedOn:0===t?1:0}),setTimeout(function(){e.updateAutomation()},100)}},{key:"addAction",value:function(){var e=this,t=this.state,o=(t.triggerId,t.triggeredAutomationId),a=(t.triggerType,t.action),i=this.props.table.stackId;this.setState({actionLoading:!0});var r={triggeredAutomationId:o};n.A.post("/api/v1/eventautomationaction/"+i+"/create",r).then(function(t){K.log(t),e.setState({actionLoading:!1,actionsActiveIndex:a.length}),e.getActionList()}).catch(function(e){K.log(e)})}},{key:"onActionChange",value:function(e,t){var o=e.value,n=(e.id,this.state.action);K.log("onActionChange ...."),n[t].actionType=o,this.setState({action:n}),this.updateAction(o,t)}},{key:"updateAction",value:function(e,t){var o=this.state,a=(o.triggerId,o.triggeredAutomationId,o.triggerType,o.action),i=this.props.table.stackId;K.log("action...",a[t].actionId);var r={actionType:e,actionId:a[t].actionId};n.A.post("/api/v1/eventautomationaction/"+i+"/update",r).then(function(e){K.log(e)}).catch(function(e){K.log(e)})}},{key:"deleteAction",value:function(e){var t=this,o=this.state,a=(o.triggerId,o.triggeredAutomationId,o.triggerType,o.action,this.props.table.stackId),i={actionId:e};n.A.post("/api/v1/eventautomationaction/"+a+"/delete",i).then(function(e){t.setState({actionsActiveIndex:-1}),t.getActionList()}).catch(function(e){K.log(e)})}},{key:"getActionList",value:function(){var e=this,t=this.state,o=(t.triggerId,t.triggeredAutomationId),a=(t.triggerType,this.props.table.stackId),i={triggeredAutomationId:o};
2n.A.post("/api/v1/eventautomationaction/"+a+"/list",i).then(function(t){K.log(t),e.setState({action:t.data.data.reverse()})}).catch(function(e){K.log(e)})}},{key:"getTriggerList",value:function(){var e=this,t=this.state,o=(t.triggerId,t.triggeredAutomationId),a=(t.triggerType,this.props.table.stackId),i={triggeredAutomationId:o};this.setState({getTriggerLoader:!0}),n.A.post("/api/v1/eventautomationtrigger/".concat(a,"/list"),i).then(function(t){var o=t.data.data;o&&e.setState({trigger:o,triggerId:o.triggerId,tableId:o.tableId,triggerType:o.triggerType}),e.setState({getTriggerLoader:!1})}).catch(function(t){K.log(t),e.setState({getTriggerLoader:!1})})}},{key:"triggerCreate",value:function(){var e=this,t=this.state,o=(t.triggerId,t.triggeredAutomationId),a=(t.triggerType,this.props.table.stackId),i={triggeredAutomationId:o};n.A.post("/api/v1/eventautomationtrigger/".concat(a,"/create"),i).then(function(t){var o=t.data.data[0];e.setState({trigger:o,triggerId:o.triggerId,tableId:o.tableId,triggerType:o.triggerType,triggerActiveIndex:1})}).catch(function(e){K.log(e)})}},{key:"triggerUpdate",value:function(){var e=this,t=this.state,o=t.triggerId,a=(t.triggeredAutomationId,t.triggerType),i=t.tableId,r=t.triggerParams,s=this.props.table.stackId,l={triggerId:o,triggerType:a,tableId:i,triggerParams:r};n.A.post("/api/v1/eventautomationtrigger/".concat(s,"/update"),l).then(function(t){e.setState({triggerActiveIndex:0})}).catch(function(e){K.log(e)})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){}},{key:"render",value:function(){var e=this,t=this.state,o=t.name,n=t.getTriggerLoader,a=t.triggeredAutomationId,i=t.actionLoading,r=void 0!==i&&i,s=t.trigger,l=t.triggerType,c=t.tableOptions,d=(t.updateLoading,t.triggerId,t.actionId,t.tableId),u=(t.viewId,t.isTurnedOn),p=t.action,h=t.triggerActiveIndex,m=t.actionsActiveIndex,f=t.renameAutomationOpen,b="";s&&(b=te.find(function(e){return e.value==l||""})),K.log("triiger",b);var y=(0,L.jsxs)("div",{children:[(0,L.jsxs)("div",{className:"field",children:[(0,L.jsx)("div",{className:"label",children:"Trigger"}),(0,L.jsx)(j.A,{fluid:!0,onChange:this.onTriggerChange,value:l,placeholder:"Select trigger",options:te})]}),(0,L.jsxs)("div",{className:"field",children:[(0,L.jsx)("div",{className:"label",children:"Table"}),(0,L.jsx)(j.A,{fluid:!0,onChange:this.onTableChange,value:d,placeholder:"Select table",options:c})]}),(0,L.jsx)(v.A,{style:{marginTop:"10px"},onClick:this.triggerUpdate,children:"Done"})]}),g=function(t,o){return(0,L.jsxs)("div",{children:[(0,L.jsxs)("div",{className:"field",children:[(0,L.jsx)("div",{className:"label",children:"Action"}),(0,L.jsx)(j.A,{fluid:!0,onChange:function(t,n){return e.onActionChange(n,o)},value:t.actionType,id:"type",placeholder:"Select action",options:oe},o)]},o),(0,L.jsx)(J,{action:t,tableId:d,stackId:e.props.table.stackId}),(0,L.jsxs)("div",{className:"action-footer",children:[(0,L.jsx)(A.MdDelete,{fontSize:"18px",onClick:function(){return e.deleteAction(t.actionId)}}),(0,L.jsx)(v.A,{children:"Done"})]})]})},w=[{menuItem:"Steps",render:function(){return(0,L.jsx)(T.A.Pane,{attached:!1,className:"steps",children:(0,L.jsx)("div",{children:n?(0,L.jsx)("div",{style:{display:"flex",alignItems:"center",height:"45vh",justifyContent:"center"},children:(0,L.jsx)("img",{src:"https://stackbybucketprod.s3-ap-southeast-1.amazonaws.com/landingpage/stack_loader.gif",width:"50px"})}):(0,L.jsx)("div",{children:s?(0,L.jsxs)("div",{children:[(0,L.jsx)("div",{className:"main-label",children:"trigger"}),(0,L.jsx)(O.A,{className:"triggermain-comp",as:D.A,vertical:!0,children:(0,L.jsxs)(D.A.Item,{children:[(0,L.jsx)(O.A.Title,{active:1===h,content:b?b.text:"Select trigger",index:h,onClick:function(){return e.setState({triggerActiveIndex:0==h?1:0})}}),(0,L.jsx)(O.A.Content,{active:1===h,content:y})]})}),(0,L.jsx)(A.MdArrowDownward,{fontSize:"40px"}),(0,L.jsx)("div",{className:"main-label",children:"Actions"}),p.map(function(t,o){return(0,L.jsx)(O.A,{className:"triggermain-comp",as:D.A,vertical:!0,children:(0,L.jsxs)(D.A.Item,{children:[(0,L.jsx)(O.A.Title,{active:m==o,content:t.actionType?oe.find(function(e){return e.value==t.actionType}).text:"Select action",index:m,onClick:function(){return e.setState({actionsActiveIndex:m==o?-1:o})}}),(0,L.jsx)(O.A.Content,{active:m==o,content:g(t,o)})]})})}),(0,L.jsx)("div",{className:"action-create-button",children:(0,L.jsx)(v.A,{loading:r,primary:!0,style:{marginTop:"10px"},onClick:e.addAction,children:"+ Add Action"})})]}):(0,L.jsx)("div",{className:"create-trigger",children:(0,L.jsx)(v.A,{primary:!0,onClick:e.triggerCreate,children:"Create trigger"})})})})})}},{menuItem:"History",render:function(){return(0,L.jsx)(T.A.Pane,{attached:!1,children:"History"})}}];return(0,L.jsxs)("div",{id:"AuEdit",children:[(0,L.jsxs)("div",{className:"au-edit-header",children:[(0,L.jsxs)("div",{onClick:this.props.goBack,className:"au-edit-backbutton",children:[(0,L.jsxs)("div",{style:{display:"flex",alignItems:"center",fontWeight:"600"},children:[(0,L.jsx)(R.A,{name:"angle left",lable:!0}),"Back"]}),(0,L.jsx)(A.MdDelete,{onClick:function(){return e.props.deleteAu(a)},fontSize:"18px"})]}),(0,L.jsxs)("div",{className:"au-edit-header-main",style:{display:"flex",justifyContent:"space-between"},children:[f?(0,L.jsx)("div",{children:(0,L.jsx)(N.A,{autoFocus:!0,value:o,onChange:function(t){return e.setState({name:t.target.value})},onKeyPress:function(t){return"Enter"==t.key&&e.updateAutomation()}})}):(0,L.jsx)(E.A,{text:o,className:"au-edit-automationname",children:(0,L.jsxs)(E.A.Menu,{children:[(0,L.jsx)(E.A.Item,{icon:"edit",text:"rename automation",onClick:function(){return e.setState({renameAutomationOpen:!0})}}),(0,L.jsx)(E.A.Item,{icon:"delete",text:"delete automation",onClick:function(){return e.props.deleteAu(a)}})]})}),(0,L.jsx)("div",{children:(0,L.jsxs)("div",{className:"on-off-automation",children:["OFF",(0,L.jsx)(M.A,{toggle:!0,checked:1==u,onChange:this.onAuOnOff,style:{marginLeft:"5px",marginRight:"5px"}}),"ON"]})})]})]}),(0,L.jsx)("div",{className:"au-edit-body",children:(0,L.jsx)(T.A,{menu:{secondary:!0,pointing:!0},panes:w}
2)})]})}}],a&&Y(o.prototype,a),i&&Y(o,i),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,a,i}(s.Component);var ae={updateAutomation:P.FZ};const ie=(0,h.Ng)(function(e){return{auth:e.auth,table:e.table,automation:e.automation}},ae)(ne);function re(e){var t=e.item,o=t.name,n=t.isTurnedOn;t.triggeredAutomationId;return(0,L.jsx)("div",{className:"au-item",onClick:function(){return e.editAu(e.index)},children:(0,L.jsxs)("div",{className:"au-item-body",children:[(0,L.jsxs)("div",{className:"au-item-body-name",children:[(0,L.jsx)(A.MdFlashAuto,{fontSize:"20px"}),(0,L.jsx)("div",{className:"name",children:o})]}),(0,L.jsxs)("div",{className:"au-item-body-status",children:[(0,L.jsx)("div",{className:"status",children:0==n?"OFF":"ON"}),(0,L.jsx)(R.A,{name:"angle right",style:{fontSize:"20px"}})]})]})})}function se(e){return se="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},se(e)}function le(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ce(n.key),n)}}function ce(e){var t=function(e,t){if("object"!=se(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!=se(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==se(t)?t:t+""}function de(e,t,o){return t=pe(t),function(e,t){if(t&&("object"==se(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ue()?Reflect.construct(t,o||[],pe(e).constructor):t.apply(e,o))}function ue(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ue=function(){return!!e})()}function pe(e){return pe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pe(e)}function he(e,t){return he=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},he(e,t)}var me=function(e){function t(e){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(o=de(this,t,[e])).state={list:null,action:[],isEditAu:!1,width:350,loading:!0},o.createAutomation=o.createAutomation.bind(o),o.editAutomation=o.editAutomation.bind(o),o.deleteAutomation=o.deleteAutomation.bind(o),o.updateAutomation=o.updateAutomation.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&he(e,t)}(t,e),o=t,(n=[{key:"componentDidMount",value:function(){this.props.fetchAutomation(this.props.table.stackId)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.setState({loading:e.automation.loading,list:e.automation.list})}},{key:"createAutomation",value:function(){this.props.createAutomation(this.props.table.stackId,{name:"Automation "+this.state.list.length})}},{key:"editAutomation",value:function(e){this.setState({isEditAu:e})}},{key:"deleteAutomation",value:function(e){var t=this;this.props.deleteAutomation(this.props.table.stackId,{triggeredAutomationId:e}).then(function(){t.setState({isEditAu:!1})})}},{key:"updateAutomation",value:function(e){this.props.updateAutomation(this.props.table.stackId,e)}},{key:"render",value:function(){var e=this,t=this.state,o=t.list,n=t.isEditAu,a=t.width,i=t.loading;return t.action,(0,L.jsx)("div",{className:"autoamtion-wapper",children:(0,L.jsx)(b.p,{className:"automation-panel",disableDragging:!0,enableResizing:{left:!0},size:{width:a,height:"auto"},minWidth:100,maxWidth:1e4,onResize:function(t,o,n,a,i){e.setState({width:n.offsetWidth})},children:(0,L.jsxs)("div",{id:"Automation",className:"",children:[(0,L.jsxs)("div",{className:"title-automation",children:["AUTOMATIONS",(0,L.jsx)(g.A,{icon:"md-close",fontSize:"18px",color:"#414141",onClick:function(){return e.props.onClose()}})]}),i?(0,L.jsx)("div",{style:{display:"flex",alignItems:"center",height:"100vh",justifyContent:"center",flexDirection:"column"},children:(0,L.jsx)("img",{src:"https://stackbybucketprod.s3-ap-southeast-1.amazonaws.com/landingpage/stack_loader.gif",width:"50px"})}):!1===n?(0,L.jsx)("div",{children:(0,L.jsxs)(l().Fragment,{children:[(0,L.jsx)("div",{className:"header",children:o.length>0&&(0,L.jsx)("div",{className:"btn-add-at",onClick:this.createAutomation,children:"+ New Automation"})}),(0,L.jsx)("div",{className:"automation-header",children:"AUTOMATION LIST"}),(0,L.jsx)("div",{className:"body",children:o.length?o.map(function(t,o){return(0,L.jsx)(re,{editAu:e.editAutomation,index:o,item:t},o)}):(0,L.jsx)("div",{className:"btn-create-automation",onClick:this.createAutomation,children:(0,L.jsx)(v.A,{primary:!0,children:"Create an automation"})})}),(0,L.jsx)("div",{className:"automation-header",style:{marginTop:"8px"},children:"POPULAR AUTOMATIONS"})]})}):(0,L.jsx)(ie,{deleteAu:this.deleteAutomation,item:o[n],goBack:function(){return e.setState({isEditAu:!1})}})]})})})}}])&&le(o.prototype,n),a&&le(o,a),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,n,a}(l().Component);var ve={fetchAutomation:P.OM,createAutomation:P.Ue,deleteAutomation:P.lg,updateAutomation:P.FZ};const fe=(0,h.Ng)(function(e){return{socketData:e.socketData,auth:e.auth,table:e.table,automation:e.automation}},ve)(me);
2var be=o(48009),ye=o(46856),ge=o(61474),we=o(37190),ke=o(60355),Se=o(25383),Ce=o(33792),Ie=o(64928),xe=o(43859);function Ae(){var e,t,o="function"==typeof Symbol?Symbol:{},n=o.iterator||"@@iterator",a=o.toStringTag||"@@toStringTag";function i(o,n,a,i){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return je(c,"_invoke",function(o,n,a){var i,s,l,c=0,d=a||[],u=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,o){return i=t,s=0,l=e,p.n=o,r}};function h(o,n){for(s=o,l=n,t=0;!u&&c&&!a&&t<d.length;t++){var a,i=d[t],h=p.p,m=i[2];o>3?(a=m===n)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=h&&((a=o<2&&h<i[1])?(s=0,p.v=n,p.n=i[1]):h<m&&(a=o<3||i[0]>n||n>m)&&(i[4]=o,i[5]=n,p.n=m,s=0))}if(a||o>1)return r;throw u=!0,n}return function(a,d,m){if(c>1)throw TypeError("Generator is already running");for(u&&1===d&&h(d,m),s=d,l=m;(t=s<2?e:l)||!u;){i||(s?s<3?(s>1&&(p.n=-1),h(s,l)):p.n=l:p.v=l);try{if(c=2,i){if(s||(a="next"),t=i[a]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);i=e}else if((t=(u=p.n<0)?l:o.call(n,p))!==r)break}catch(t){i=e,s=1,l=t}finally{c=1}}return{value:t,done:u}}}(o,a,i),!0),c}var r={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var d=[][n]?t(t([][n]())):(je(t={},n,function(){return this}),t),u=c.prototype=s.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,je(e,a,"GeneratorFunction")),e.prototype=Object.create(u),e}return l.prototype=c,je(u,"constructor",c),je(c,"constructor",l),l.displayName="GeneratorFunction",je(c,a,"GeneratorFunction"),je(u),je(u,a,"Generator"),je(u,n,function(){return this}),je(u,"toString",function(){return"[object Generator]"}),(Ae=function(){return{w:i,m:p}})()}function je(e,t,o,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}je=function(e,t,o,n){function i(t,o){je(e,t,function(e){return this._invoke(t,o,e)})}t?a?a(e,t,{value:o,enumerable:!n,configurable:!n,writable:!n}):e[t]=o:(i("next",0),i("throw",1),i("return",2))},je(e,t,o,n)}function Te(e,t,o,n,a,i,r){try{var s=e[i](r),l=s.value}catch(e){return void o(e)}s.done?t(l):Promise.resolve(l).then(n,a)}var Oe={position:"bottom-left",autoClose:!0,closeButton:!1},De=o(15180),Re=o(10159),Ne=o(86663),Ee=o(53249),Me=o(62986),Pe=o(9872),Le=o(96763);function Be(e){return Be="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},Be(e)}function _e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ve(n.key),n)}}function Ve(e){var t=function(e,t){if("object"!=Be(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!=Be(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Be(t)?t:t+""}function Fe(e,t,o){return t=We(t),function(e,t){if(t&&("object"==Be(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ue()?Reflect.construct(t,o||[],We(e).constructor):t.apply(e,o))}function Ue(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ue=function(){return!!e})()}function We(e){return We=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},We(e)}function He(e,t){return He=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},He(e,t)}var Ge=[{key:1,value:1,text:"Owner",tags:"Can fully configure and edit stacks, and manage workspace settings and billing"},{key:2,value:2,text:"Creator",tags:"Can fully configure and edit this stack"},{key:3,value:3,text:"Editor",tags:"Can edit records and views, but cannot configure tables or fields"},{key:4,value:4,text:"Commenter",tags:"Can comment on records"},{key:5,value:5,text:"Read only",tags:"Cannot edit or comment"}],ze={position:"bottom-left",autoClose:!0,closeButton:!1},Je=function(e){function t(e){var o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),o=Fe(this,t,[e]);var n=(e.table||{}).addInviteMemberModelData,a=(void 0===n?{}:n)||{},i=a.inviteEmail,r=void 0===i?"":i,s=a.row,l=a.column;return o.state={inviteEmail:r,type:"stack",permissions:Ge,inviteButtonDisable:!1,invitePermission:2,inviteLoading:!1,row:s,column:l,isConfirmModalOpen:!1,errorMessage:!1,confirmMessage:!1},o.close=o.close.bind(o),o.handlePermissionTypeChange=o.handlePermissionTypeChange.bind(o),o.inviteMember=o.inviteMember.bind(o),o.checkEmail=o.checkEmail.bind(o),o.updateCellValue=o.updateCellValue.bind(o),o.handleConfirmModal=o.handleConfirmModal.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&He(e,t)}(t,e),o=t,a=[{key:"componentDidMount",value:function(){this.checkEmail(this.state.inviteEmail)}},{key:"componentWillUnmount",value:function(){}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){}},{key:"updateCellValue",value:function(e){var t=(this.props||{}).table,o=void 0===t?{}:t,n=(o||{}).stackId,a=void 0===n?"":n,i=this.state,r=i.column,s=i.row,l=r||{},c=l.columnId,d=void 0===c?"":c,u=l.type,p=void 0===u?"":u,h=[];if("multiCollaborator"==p){h=s[d]||[];
2try{"string"==typeof h&&""!==h&&(h=JSON.parse(h))}catch(e){Le.error(e)}h.push(e)}else"collaborator"==p&&(h=[e]);this.props.updateCellValue(a,r.columnId,s.rowId,JSON.stringify(h),o)}},{key:"close",value:function(){this.props.closeAddInviteMemberModel()}},{key:"handlePermissionTypeChange",value:function(e,t){var o=t.value;this.setState({type:o})}},{key:"checkEmail",value:function(e){e&&/\S+@\S+\.\S+/.test(e)?this.setState({inviteButtonDisable:!1}):this.setState({inviteButtonDisable:!0})}},{key:"inviteMember",value:function(){var e=this,t=this.state,o=t.type,a=t.inviteEmail,i=t.invitePermission,r=(t.searchedUser,t.errorMessage,this.props.table||{}),s=r.workspaceId,l=void 0===s?"":s,c=r.stackId,d=void 0===c?"":c,u=this.props.table.stackUsers,p=void 0===u?[]:u;this.setState({isConfirmModalOpen:!1}),this.state.inviteLoading||(document.getElementById("InviteButton").innerText="Sending invite...",setTimeout(function(){document.getElementById("InviteButton").innerText="Sending invite and add to record"},1500));var h={email:a.trim(),accessType:i,message:"",isSharingEnable:0,workspaceId:l},v="workspace"===o?l:d;p.some(function(e){return e.email===a})?setTimeout(function(){e.setState({errorMessage:!0})},1500):(this.setState({errorMessage:!1}),n.A.post("/api/v1/"+o+"action/"+v+"/invite",h).then(function(t){var o=JSON.parse((0,Pe.Y)(t.data.data));m.oR.info("Invitation sent to "+a,ze),e.updateCellValue(o.inviteId),e.setState({inviteLoading:!1},function(){e.close()})}).catch(function(t){var n,a,i;e.setState({inviteLoading:!1});var r="Error ".concat(o," invite");503==(null===(n=t.response)||void 0===n?void 0:n.status)?r="".concat(o.charAt(0).toUpperCase()+o.slice(1)," users limit reached"):504==(null===(a=t.response)||void 0===a?void 0:a.status)?r="".concat(h.email," already has access to this ").concat(o,"."):505==(null===(i=t.response)||void 0===i?void 0:i.status)&&(r="".concat(h.email," already invited.")),m.oR.error(r,ze)}))}},{key:"handleConfirmModal",value:function(){var e=this;return(0,L.jsxs)(f.A,{id:"ConfirmModal",size:"tiny",open:!0,onClose:function(){return e.setState({isConfirmModalOpen:!1})},closeIcon:!0,style:{zIndex:1100},children:[(0,L.jsxs)("div",{className:"owner-heading",children:["Are you sure you want to make ",this.state.inviteEmail," a workspace owner?"]}),(0,L.jsxs)("div",{className:"owner-content",children:["Granting owner access will give this person the same workspace permissions you have.",(0,L.jsx)("br",{}),(0,L.jsx)("br",{}),"Workspace owners can:",(0,L.jsxs)("ul",{children:[(0,L.jsx)("li",{className:"ws-list",children:"Change the workspace billing plan"}),(0,L.jsx)("li",{className:"ws-list",children:"Add or remove collaborators"}),(0,L.jsx)("li",{className:"ws-list",children:"Delete the workspace"})]})]}),(0,L.jsxs)("div",{className:"button",children:[(0,L.jsx)(v.A,{className:"cancel-btn",onClick:function(){e.setState({isConfirmModalOpen:!1})},children:"Cancel"}),(0,L.jsx)(v.A,{className:"confirm-btn",primary:!0,onClick:this.inviteMember,children:"Confirm"})]})]})}},{key:"render",value:function(){var e=this,t=this.state,o=t.inviteEmail,n=t.type,a=t.permissions,i=t.inviteButtonDisable,r=t.invitePermission,s=t.inviteLoading,l=(t.searchedUser,t.isConfirmModalOpen),c=t.errorMessage,d=(t.confirmMessage,this.props.table||{}),u=d.stackName,p=void 0===u?"":u,h=d.workspaceName;return this.props.table.stackUsers,a=(a="workspace"===n?a:a.filter(function(e){return"Owner"!==e.text})).map(function(e){return{key:e.key,value:e.value,text:e.text,content:(0,L.jsx)("div",{style:{width:"auto",zIndex:10},children:(0,L.jsxs)("h5",{children:[e.text,(0,L.jsx)("div",{style:{fontSize:12},children:e.tags})]})})}}),(0,L.jsxs)("div",{children:[(0,L.jsxs)(f.A,{id:"AddNewCollboratorModel",size:"tiny",open:!0,onClose:this.close,closeIcon:!0,style:{zIndex:1100},children:[(0,L.jsx)(f.A.Header,{children:"Invite a new user"}),(0,L.jsx)(f.A.Content,{scrolling:!0,children:(0,L.jsxs)("div",{className:"form-content",children:[(0,L.jsx)("div",{className:"form-textarea-main",children:(0,L.jsx)("div",{className:"invite-content OnMobileMainView",children:(0,L.jsxs)(Me.A,{children:[(0,L.jsxs)("div",{className:"dropdownlist-align",style:{marginBottom:"16
2px"},children:[(0,L.jsx)("div",{className:"list-item",style:{marginBottom:"4px"},children:(0,L.jsx)("span",{className:"list-item-title",children:"Email"})}),(0,L.jsxs)("div",{className:"list-item",style:{display:"flex",alignItems:"center"},children:[(0,L.jsx)("input",{className:"email-input-css",style:{width:"66.66667%"},placeholder:"",value:o,onChange:function(t){e.checkEmail(t.target.value),e.setState({inviteEmail:t.target.value})},autoFocus:!0}),o.length>0&&(0,L.jsx)(g.A,{icon:"md-close",className:"search-close",fontSize:"14px",color:"#212121",onClick:function(){e.setState({inviteEmail:""})}})]})]}),(0,L.jsxs)("div",{className:"invite-content",children:[(0,L.jsx)("div",{className:"list-item-title",style:{marginBottom:"4px"},children:"Invite as"}),(0,L.jsxs)("div",{className:"collaborater-content",children:[(0,L.jsxs)("label",{className:"stack-content",children:[(0,L.jsx)(M.A,{checked:"stack"==n,name:"typeGroup",value:"stack",onChange:this.handlePermissionTypeChange}),(0,L.jsxs)("div",{style:{marginLeft:"8px"},children:[(0,L.jsx)("div",{className:"collaborater-text",children:"Stack Collaborator"}),(0,L.jsxs)("div",{children:[(0,L.jsxs)("span",{className:"list-item-title",children:["Allow Stack collaborator to access "," "]})," ",p,(0,L.jsx)("span",{className:"collaborater-help-content",children:(0,L.jsx)("a",{href:"https://help.stackby.com/en/articles/176-inviting-a-stack-user",target:"_blank",style:{display:"flex",alignItems:"center"},children:(0,L.jsx)(g.A,{icon:"ios-help-circle-outline",fontSize:"16px"})})})]})]})]}),(0,L.jsxs)("label",{className:"stack-content",children:[(0,L.jsx)(M.A,{checked:"workspace"==n,name:"typeGroup",value:"workspace",onChange:this.handlePermissionTypeChange}),(0,L.jsxs)("div",{style:{marginLeft:"8px"},children:[(0,L.jsx)("div",{className:"collaborater-text",children:"Workspace Collaborator"}),(0,L.jsxs)("div",{children:[(0,L.jsxs)("span",{className:"list-item-title",children:["Allow Workspace collaborator to access "," "]})," ",h,(0,L.jsx)("span",{className:"collaborater-help-content",children:(0,L.jsx)("a",{href:"https://help.stackby.com/en/articles/175-inviting-a-workspace-user",target:"_blank",style:{display:"flex",alignItems:"center"},children:(0,L.jsx)(g.A,{icon:"ios-help-circle-outline",fontSize:"16px"})})})]})]})]})]})]}),(0,L.jsxs)("div",{className:"dropdownlist-align",children:[(0,L.jsx)("div",{className:"list-item",style:{marginBottom:"4px"},children:(0,L.jsx)("span",{className:"list-item-title",children:"Permission"})}),(0,L.jsx)("div",{className:"list-item",children:(0,L.jsx)(E.A,{style:{width:"240px",textAlign:"center"},placeholder:"*Permission",selection:!0,className:"dropdown-optionlist OnMobileView email-input-css",clearable:"true",defaultValue:r,options:a,onChange:function(t,o){return e.setState({invitePermission:o.value})}})})]})]})})}),c&&(0,L.jsx)("span",{className:"invite-error-message",children:"".concat(o," already has access to this ").concat(n,".")}),(0,L.jsxs)("div",{className:"button",children:[(0,L.jsx)(v.A,{className:"cancel-btn",onClick:this.close,children:"Cancel"}),1===r&&"workspace"===n?(0,L.jsx)(v.A,{primary:!0,width:4,onClick:function(){e.setState({isConfirmModalOpen:!0})},disabled:i,loading:s,id:"InviteButton",children:"Send invite and add to record"}):(0,L.jsx)(v.A,{primary:!0,width:4,onClick:this.inviteMember,disabled:i,loading:s,id:"InviteButton",children:"Sending invite and add to record"})]})]})})]}),l&&this.handleConfirmModal()]})}}],a&&_e(o.prototype,a),i&&_e(o,i),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,a,i}(l().Component),Ke={closeAddInviteMemberModel:De.oG,updateCellValue:De.xU};const qe=(0,h.Ng)(function(e){return{table:e.table,auth:e.auth,socket:e.socket,workspace:e.workspace}},Ke)(Je);var Ye=o(9515),Qe=o(55969),$e=o(23615),Xe=o(27089),Ze=o(85658);function et(e){return et="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},et(e)}function tt(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ot(n.key),n)}}function ot(e){var t=function(e,t){if("object"!=et(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!=et(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==et(t)?t:t+""}function nt(e,t,o){return t=it(t),function(e,t){if(t&&("object"==et(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}
2(e,at()?Reflect.construct(t,o||[],it(e).constructor):t.apply(e,o))}function at(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(at=function(){return!!e})()}function it(e){return it=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},it(e)}function rt(e,t){return rt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rt(e,t)}var st=["alphavantage","clearbit","mattermark","hunter","pagespeed","youtube","github","fullcontact","translate","naturalLanguage","intercom","mailchimp","serpstat","verifybee","fbpostinsight","facebookAds","sendfox","zerobounce","clearout","snov.io","builtwith","analytics","analyticsv4","yt-analytics","moz","ahrefs","search-console","sharecount","instamediainsight","twitter","lemlist","Alexawebinformationservice","semrush","linkedin-pages","linkedin-ads","coinmarketcap","shopify","datagma","crunchbase","hubspot"],lt=["slack","ms-team","whatsapp","twilio","11za"],ct=function(e){function t(e){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(o=nt(this,t,[e])).state={showAppModalDescriptionId:null,showAppModalDescription:!1,showUpgradeButton:e.showUpgradeButton,activeTabIndex:e.activeTabIndex?e.activeTabIndex:0},o.close=o.close.bind(o),o.renderCard=o.renderCard.bind(o),o.createView=o.createView.bind(o),o.getDataFromChild=o.getDataFromChild.bind(o),o.handleTabChange=o.handleTabChange.bind(o),o.onApiConnectorClick=o.onApiConnectorClick.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rt(e,t)}(t,e),o=t,n=[{key:"componentDidMount",value:function(){}},{key:"close",value:function(){this.props.closeAddInviteMemberModel()}},{key:"createView",value:function(e){var t=(e||{}).key,o=this.props.table,n=o||{},i=n.lastViewId,r=void 0===i?null:i,s=n.stackId,l={tableId:o.lastTableId,name:(0,a.capitalize)(t),type:t,copyViewId:"",copyMode:"new",sequenceViewId:o?r:null};this.props.createView(s,l),Gleap.trackEvent("User Create ".concat((0,a.capitalize)(t)," View"),{auth:this.props.auth}),(0,k.Of)(this.props.auth,"","User perform create view"),this.props.closeAddMoreModal()}},{key:"renderCard",value:function(e,t,o,n){return(0,L.jsxs)(Ye.A.Content,{children:[(0,L.jsx)(Qe.A,{floated:"left",size:"mini",src:e,style:{height:"80px",width:"80px"}}),(0,L.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,L.jsx)(Ye.A.Header,{style:{fontSize:"17px",fontWeight:"700",marginBottom:"7px",marginTop:"3px",color:"#414141"},children:t}),(0,L.jsx)(Ye.A.Meta,{style:{color:"darkslategray",fontSize:"12px"},children:o})]})]})}},{key:"getDataFromChild",value:function(){this.setState(function(e){return{showAppModalDescription:!e.showAppModalDescription,activeTabIndex:2}})}},{key:"handleTabChange",value:function(e,t){this.setState({activeTabIndex:t.activeIndex})}},{key:"onApiConnectorClick",value:function(e){var t=this.props.table.workspaceId,o=(e||{}).key;this.props.history.push("/integrate/".concat(o,"/configure?workspaceId=").concat(t))}},{key:"openRespectiveMenu",value:function(e){this.props.openRespectiveMenu(e)}},{key:"onNotificationClick",value:function(e){var t=this.props.table.workspaceId,o=(e||{}).key;this.props.history.push("/integrate/".concat(o,"/configure?workspaceId=").concat(t))}},{key:"onWorkflowAutomationClick",value:function(e){this.props.table.workspaceId;var t=(e||{}).key;switch(this.props.close(),t){case"zapier":return window.open("https://zapier.com/apps/stackby/integrations");case"n8n":return window.open("https://n8n.io/integrations/stackby/");case"Integrately":return window.open("https://integrately.com/integrations/stackby");case"integromat":return window.open("https://www.make.com/en/integrations/stackby?fromImt=1");case"Pabbly":return window.open("https://www.pabbly.com/connect/integrations/stackby/");case"11Za":window.open("https://11za.com/","_blank")}}},{key:"render",value:function(){var e=this,t=this.state,o=t.showAppModalDescription,n=t.showAppModalDescriptionId,a=t.showUpgradeButton,i=(t.activeTabIndex,this.props.table),r=i.lastTableId,c=i.tableList,d=(void 0===c?[]:c).find(function(e){return e.tableId==r}),u=[{menuItem:"Views",render:function(){return(0,L.jsx)(T.A.Pane,{attached:!1,children:(0,L.jsx)("div",{className:"content-wrapper",children:(0,L.jsx)($e.A.Column,{id:"AllFeatureModal",mobile:16,tablet:6,computer:13,children:(0,L.jsxs)("div",{className:"feature-box",children:[(0,L.jsxs)("div",{className:"main-title",children:[(0,L.jsx)("h2",{children:"Views"}),(0,L.jsx)("p",{children:"Visualize your data in different layouts"})]}),(0,L.jsx)("div",{className:"grid-integration grid-section",children:(0,y.viewList)().filter(function(e){return 1==d.isSync?!["form","update"].includes(e.ke
2y):e}).map(function(t,o){return(0,L.jsx)(l().Fragment,{children:"newSection"!=t.key&&(0,L.jsx)("a",{className:"integrationLink",onClick:function(){return e.createView(t)},children:(0,L.jsxs)("div",{className:"integration-card",children:[(0,L.jsx)("div",{className:"inte-logoSection",children:(0,L.jsx)("img",{src:t.logo,className:"inte-logo"})}),(0,L.jsxs)("div",{className:"inte-caption",children:[(0,L.jsxs)("div",{className:"inte-title",children:[" ",t.name," "]}),(0,L.jsxs)("div",{className:"inte-type",children:[" ",t.description," "]})]})]})},o)})})})]})})})})}},{menuItem:"Data",render:function(){return(0,L.jsx)(T.A.Pane,{attached:!1,children:(0,L.jsx)("div",{className:"content-wrapper",children:(0,L.jsx)($e.A.Column,{id:"AllFeatureModal",mobile:16,tablet:6,computer:13,children:(0,L.jsxs)("div",{className:"feature-box",children:[(0,L.jsxs)("div",{className:"main-title",children:[(0,L.jsx)("h2",{children:"Data"}),(0,L.jsx)("p",{children:"Import your data from different sources"})]}),(0,L.jsx)("div",{className:"grid-integration grid-section",children:(0,y.dataList)().map(function(t,o){return(0,L.jsx)("a",{className:"integrationLink",onClick:function(){e.openRespectiveMenu(t)},children:(0,L.jsxs)("div",{className:"integration-card",children:[(0,L.jsx)("div",{className:"inte-logoSection",children:(0,L.jsx)("img",{src:t.logo,className:"inte-logo"})}),(0,L.jsxs)("div",{className:"inte-caption",children:[(0,L.jsxs)("div",{className:"inte-title",children:[" ",t.name," "]}),(0,L.jsxs)("div",{className:"inte-type",children:[" ",t.description," "]})]})]})},o)})})]})})})})}},{menuItem:"Apps",render:function(){return(0,L.jsx)(T.A.Pane,{attached:!1,children:(0,L.jsx)("div",{className:"content-wrapper",children:(0,L.jsx)($e.A.Column,{id:"AllFeatureModal",mobile:16,tablet:6,computer:13,children:(0,L.jsxs)("div",{className:"feature-box",children:[(0,L.jsxs)("div",{className:"main-title",children:[(0,L.jsx)("h2",{children:"Apps"}),(0,L.jsx)("p",{children:"Build custom dashboards with different apps in the marketplace"})]}),(0,L.jsx)("div",{className:"grid-integration",style:{gridTemplateColumns:"repeat(auto-fill, minmax(260px, 1fr))"},children:y.blockList.map(function(t,o){return(0,L.jsx)("a",{className:"integrationLink",onClick:function(){e.setState({showAppModalDescription:!0,showAppModalDescriptionId:t.id})},children:(0,L.jsxs)("div",{className:"integration-card",style:{height:86},children:[(0,L.jsx)("div",{className:"inte-logoSection",children:(0,L.jsx)("img",{src:t.src,className:"inte-logo"})}),(0,L.jsxs)("div",{className:"inte-caption",children:[(0,L.jsxs)("div",{className:"inte-title",children:[" ",t.name," "]}),(0,L.jsxs)("div",{className:"inte-type",children:[" ",t.description," "]})]})]})},o)})})]})})})})}},{menuItem:"API Connectors",render:function(){return(0,L.jsx)(T.A.Pane,{attached:!1,children:(0,L.jsx)("div",{className:"content-wrapper",children:(0,L.jsx)($e.A.Column,{id:"AllFeatureModal",mobile:16,tablet:6,computer:13,children:(0,L.jsxs)("div",{className:"feature-box",children:[(0,L.jsxs)("div",{className:"main-title",children:[(0,L.jsx)("h2",{children:"API Connectors"}),(0,L.jsx)("p",{children:"Connect columns to third party APIs to bring rich information in tables"})]}),(0,L.jsx)("div",{className:"grid-integration",children:(0,y.integrations)().map(function(t,o){if(st.includes(t.key))return(0,L.jsx)("a",{className:"integrationLink",onClick:function(){return e.onApiConnectorClick(t)},children:(0,L.jsxs)("div",{className:"integration-card",children:[(0,L.jsx)("div",{className:"inte-logoSection",children:(0,L.jsx)("img",{src:t.logo,className:"inte-logo"})}),(0,L.jsxs)("div",{className:"inte-caption",children:[(0,L.jsxs)("div",{className:"inte-title",children:[" ",t.name," "]}),(0,L.jsxs)("div",{className:"inte-type",children:[" ",t.type," "]})]})]})},o)})})]})})})})}},{menuItem:"Notifications",render:function(){return(0,L.jsx)(T.A.Pane,{attached:!1,children:(0,L.jsx)("div",{className:"content-wrapper",children:(0,L.jsx)($e.A.Column,{id:"AllFeatureModal",mobile:16,tablet:6,computer:13,children:(0,L.jsxs)("div",{className:"feature-box",children:[(0,L.jsxs)("div",{className:"main-title",children:[(0,L.jsx)("h2",{children:"Notifications"}),(0,L.jsx)("p",{children:"Integrate with existing tools you might use"})]}),(0,L.jsx)("div",{className:"grid-integration",children:(0,y.integrations)().map(function(t,o){if(lt.includes(t.key))return(0,L.jsx)("a",{className:"integrationLink",onClick:function(){return e.onNotificationClick(t)},children:(0,L.jsxs)("div",{className:"integration-card",children:[(0,L.jsx)("div",{className:"inte-logoSection",children:(0,L.jsx)("img",{src:t.logo,className:"inte-logo"})}),(0,L.jsxs)("div",{className:"inte-caption",children:[(0,L.jsxs)("div",{className:"inte-title",children:[" ",t.name," "]}),(0,L.jsxs)("div",{className:"inte-type",children:[" ",t.type," "]})]})]})},o)})})]})})})})}}];return(0,L.jsx)(s.Fragment,{children:(0,L.jsx)(f.A,{closeIcon:!0,open:!0,onClose:function(){return e.props.close()},className:"app-modal",size:"small",children:(0,L.jsx)(f.A.Content,{scrolling:!0,style:{height:"calc(500vh)",overflowX:"hidden"},children:o?(0,L.jsx)(Xe.A,{children:(0,L.jsx)(Ze.A,{appData:y.blockList.find(function(e){return e.id===n}),getBack:this.getDataFromChild,handleExploreBlock:this.props.handleExploreBlock,handleUpgradeApps:this.props.handleUpgradeApps,showUpgradeButton:a})}):(0,L.jsx)(Xe.A,{children:(0,L.jsx)("div",{style:{marginTop:"25px"},children:(0,L.jsx)(T.A,{className:"tab",defaultActiveIndex:this.state.activeTabIndex,onTabChange:this.handleTabChange,menu:{secondary:!0,pointing:!0},panes:u})})})})})})}}],n&&tt(o.prototype,n),i&&tt(o,i),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,n,i}(l().Component),dt={closeAddInviteMemberModel:De.oG,createView:De.O8};const ut=(0,h.Ng)(function(e){return{table:e.table,auth:e.auth}},dt)(ct);var pt=o(96174),ht=o(66248),mt=o(98027),vt=o(42903),ft=o(1654),bt=o(80902),yt=o(20512),gt=o(96763);function wt(e){return wt="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},wt(e)}function kt(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)}return o}function St(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};
2t%2?kt(Object(o),!0).forEach(function(t){Ct(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):kt(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}function Ct(e,t,o){return(t=xt(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function It(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,xt(n.key),n)}}function xt(e){var t=function(e,t){if("object"!=wt(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!=wt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==wt(t)?t:t+""}function At(e,t,o){return t=Tt(t),function(e,t){if(t&&("object"==wt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,jt()?Reflect.construct(t,o||[],Tt(e).constructor):t.apply(e,o))}function jt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(jt=function(){return!!e})()}function Tt(e){return Tt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Tt(e)}function Ot(e,t){return Ot=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ot(e,t)}function Dt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var n,a,i,r,s=[],l=!0,c=!1;try{if(i=(o=o.call(e)).next,0===t){if(Object(o)!==o)return;l=!1}else for(;!(l=(n=i.call(o)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=o.return&&(r=o.return(),Object(r)!==r))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Rt(e,t);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?Rt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rt(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}var Nt={position:"bottom-left",autoClose:!0,closeButton:!1},Et=function(e){function t(e){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(o=At(this,t,[e])).state={viewData:{},columnSchema:e.columnSchema,stackId:"",showColumnNamesInCards:e.showColumnNamesInCards,cardCoverGalleryImageColumnId:e.cardCoverGalleryImageColumnId,cardFooterSelectorColumnId:e.cardFooterSelectorColumnId,kanbanSelectedColumnId:e.kanbanSelectedColumnId,isLock:e.isLock,accessType:e.accessType,isPersonalView:e.isPersonalView},o._ColumnFields=o._ColumnFields.bind(o),o.hideAll=o.hideAll.bind(o),o.showAll=o.showAll.bind(o),o.setWrapperRef=o.setWrapperRef.bind(o),o.handleClickOutside=o.handleClickOutside.bind(o),o.onDragEnd=o.onDragEnd.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ot(e,t)}(t,e),o=t,i=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.setState({columnSchema:e.columnSchema,showColumnNamesInCards:e.showColumnNamesInCards,cardCoverGalleryImageColumnId:e.cardCoverGalleryImageColumnId,cardFooterSelectorColumnId:e.cardFooterSelectorColumnId,kanbanSelectedColumnId:e.kanbanSelectedColumnId,isLock:e.isLock,isPersonalView:e.isPersonalView})}},{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.handleClickOutside),this.setState({viewData:this.props.viewData,columnSchema:this.props.columnSchema,stackId:this.props.stackId,showColumnNamesInCards:this.props.showColumnNamesInCards,cardCoverGalleryImageColumnId:this.props.cardCoverImageColumnId,cardFooterSelectorColumnId:this.props.cardFooterSelectorColumnId,kanbanSelectedColumnId:this.props.kanbanSelectedColumnId})}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.handleClickOutside)}},{key:"setWrapperRef",value:function(e){this.wrapperRef=e}},{key:"handleClickOutside",value:function(e){this.wrapperRef&&this.wrapperRef.contains(e.target)}},{key:"onDragEnd",value:function(e){var t=this,o=this.state.viewData,n=e.destination,a=e.source,i=e.draggableId,r=new Array(i);if(n){var s=function(e,t,o){var n=Array.from(e),a=Dt(n.splice(t,1),1)[0];return n.splice(o,0,a),n}(this.state.columnSchema,a.index,n.index);this.setState({columnSchema:s});var l={idArray:r,tableId:o.tableId,index:n.index+2,viewId:o.viewId};this.props.moveColumn(this.props.stackId,l).then(function(e){(0,k.Io)(t.props.auth,"User Column action",{stack_id:t.props.stackId,action_type:"column move",table_id:o.tableId,column_id:r.toString(),view_id:o.lastViewId}),m.oR.info("Column move",Nt)}).catch(function(e){m.oR.error("Error Moving Rows",Nt),gt.log("err",e)})}}},{key:"_ColumnFields",value:function(){var e=this,t=this.state,o=t.columnSchema,n=t.isLock,a=(t.accessType,t.isPersonalView);return(0,L.jsx)(ht.JY,{onDragEnd:this.onDragEnd,children:(0,L.jsx)(ht.gL,{droppableId:"droppable",type:"COLUMN",className:"droppable",ignoreContainerClipping:!0,children:function(t,i){return(0,L.jsxs)("div",St(St({},t.droppableProps),{},{ref:t.innerRef,children:[o.map(function(t,o){return 0!=o?(0,L.jsx)(ht.sx,{isDragDisabled:!!(Re.Fr||n||a),draggableId:t.columnId,index:o,children:function(i,r){return(0,L.jsx)("div",St(St(St({ref:i.innerRef},i.draggableProps),i.dragHandleProps),{},{children:(0,L.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},className:"filter-box sort-box hidefield-box flex items-center",children:[(0,L.jsx)(vt.A,{onChange:function(){return!n&&e.updateColumnSchema([t.columnId],t.isVisible?0:1)},checked:0==t.isVisible,label:(0,L.jsx)("label",{children:t.name})}),!n||!a&&(0,L.jsx)("div",{children:(0,L.jsx)(mt.WhN,{style:{color:"#909090",opacity:.7,marginRight:"7px",marginLeft:"4px"}})})]},"list-".concat(o))}))}},t.columnId):""}),t.placeholder]}))}})})}},{key:"hideAll",value:function(e,t){var o=this.props.table,n=this.props.table.columnSchema.slice(1).map(function(e){return e.columnId}),a={columnIds:JSON.stringify(n),visibility:""+e,tableId:o.lastTableId,viewId:o.lastViewId};this.props.changeColumnVisibility(this.state.stackId,a).catch(function(e){m.oR.error("Error Update Column",{position:"bottom-left",autoClose:!0,closeButton:!1})}),(0,k.Io)(this.props.auth,"User Column action",{stack_id:this.state.stackId,action_type:"column ".concat(0==e?"hide all":"unhide all"),table_id:o.lastTableId,column_id:n.toString(),view_id:o.lastViewId})}},{key:"showAll",value:function(e,t){var o=this.props.table,n=this.props.table.columnSchema.slice(1).map(function(e){return e.columnId}),a={columnIds:JSON.stringify(n),visibility:""+e,tableId:o.lastTableId,viewId:o.lastViewId};this.props.changeColumnVisibility(this.state.stackId,a).catch(function(e){m.oR.error("Error Update Column",{position:"bottom-left",autoClose:!0,closeButton:!1})}),(0,k.Io)(this.props.auth,"User Column action",{stack_id:this.state.stackId,action_type:"column ".concat(0==e?"hide all":"unhide all"),table_id:o.lastTableId,column_id:n.toString(),view_id:o.lastViewId})}},{key:"updateColumnSchema",value:function(e,t){var o=this,i=this.state,r=i.columnSchema,s=i.viewData,l=(0,a.findIndex)(r,{columnId:e[0]}),c=(0,a.extend)((0,a.find)(r,{columnId:e[0]}),{isVisible:t});r[l]=c,this.setState({columnSchema:r});var d={columnIds:JSON.stringify(e),visibility:""+t,tableId:s.tableId,viewId:s.viewId};n.A.post("/api/v1/columnaction/"+this.state.stackId+"/visibility",d).then(function(n){(0,k.Io)(o.props.auth,"User Column action",{stack_id:o.state.stackId,action_type:"column ".concat(0==t?"hide":"unhide"),table_id:s.tableId,column_id:e.toString(),view_id:s.viewId})}).catch(function(e){m.oR.error("Error Update Column",{position:"bottom-left",autoClose:!0,closeButton:!1})})}},{key:"getCoverImageDropdownItems",value:function(e){var t=e.filter(function(e){if("lookup"==e.type){if("multipleAttachment"==(e.typeOptions||{}).foreignColumnType)return e}else if("multipleAttachment"===e.type)return e}),o=[{key:"no-cover-image",text:"No cover Image",value:"no-cover-image"}];return t.forEach(function(e){o.push({key:e.columnId,text:e.name,value:e.columnId})}),o}},{key:"getFooterCollaboratorDropdownItems",value:function(e){var t=this,o=e.filter(function(e){return"collaborator"===e.type||"multiCollaborator"===e.type}),n=[{key:"no-footer-collaborators",text:"No footer Collaborator",value:"no-footer-collaborators"}];return o.forEach(function(e){e.columnId!=t.state.kanbanSelectedColumnId&&n.push({key:e.columnId,text:e.name,value:e.columnId})}),n}},{key:"render",value:function(){var e=this,t=this.state,o=(t.viewData,t.columnSchema),n=t.showColumnNamesInCards,a=t.cardCoverGalleryImageColumnId,i=(t.cardFooterSelectorColumnId,t.isLock),r=t.accessType,s=t.isPersonalView,l=this.props,c=l.handleShowColumnNamesInCards,d=l.setCardCoverGalleryImageColumnId;return l.setCardFooterSelectorColumnId,o.map(function(e){return e.columnId}),(0,L.jsxs)("div",{id:"CustomizeGalleryCardsModel",className:"model-float",children:[(0,L.jsxs)("div",{className:"".concat(i||s&&"customizgallerymodel-disable"),children:[(0,L.jsxs)("div",{className:"showColumnNameDiv",children:["Cover Image","no-cover-image"!==a&&(0,L.jsxs)("div",{className:"radiotoggle-cropfit",children:[" ","Crop",(0,L.jsx)(ft.A,{checked:n,onChange:c}),"Fit"]})]}),(0,L.jsxs)("div",{className:"cardCoverImageColumnSelect",children:[(0,L.jsx)("div",{className:"divHeading",children:"Select Top Cover Image Column"}),(0,L.jsx)(E.A,{placeholder:"Select column",fluid:!0,search:!0,selection:!0,disabled:i||s,options:this.getCoverImageDropdownItems(o),onChange:d,defaultValue:a,className:"dropdown-image-column"})]}),(0,L.jsxs)("div",{className:"HideColumnDiv",children:[(0,L.jsx)("div",{className:"divHeading",children:"Hide Columns"}),(0,L.jsx)("div",{className:"sort",children:this._ColumnFields()})]}),!(i||s)&&(0,L.jsxs)("div",{className:"ButtonDiv",children:[(0,L.jsx)(v.A,{content:"Hide all",size:"small",onClick:function(t){return e.hideAll(0,t)}}),(0,L.jsx)(v.A,{content:"Show all",size:"small",onClick:function(t){return e.showAll(1,t)}})]})]}),i&&(0,L.jsx)(bt.A,{accessType:r}),s&&(0,L.jsx)(yt.A,{})]})}}
2],i&&It(o.prototype,i),r&&It(o,r),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,i,r}(l().Component);const Mt=(0,h.Ng)(function(e){return{socket:e.socket,table:e.table,auth:e.auth}},{changeColumnVisibility:De.FR,moveColumn:De.A8})(Et);function Pt(e){return Pt="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},Pt(e)}function Lt(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)}return o}function Bt(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Lt(Object(o),!0).forEach(function(t){_t(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Lt(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}function _t(e,t,o){return(t=Wt(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function Vt(e){return function(e){if(Array.isArray(e))return Ft(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Ft(e,t);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?Ft(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ft(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}function Ut(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Wt(n.key),n)}}function Wt(e){var t=function(e,t){if("object"!=Pt(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!=Pt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Pt(t)?t:t+""}function Ht(e,t,o){return t=zt(t),function(e,t){if(t&&("object"==Pt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Gt()?Reflect.construct(t,o||[],zt(e).constructor):t.apply(e,o))}function Gt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Gt=function(){return!!e})()}function zt(e){return zt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zt(e)}function Jt(e,t){return Jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Jt(e,t)}var Kt={position:"bottom-left",autoClose:!0,closeButton:!1},qt=function(e){function t(e){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(o=Ht(this,t,[e])).state={searchstackValue:"",searchedStack:[],activeIndex:0},o.handleSearchChange=o.handleSearchChange.bind(o),o.handleKeyPress=o.handleKeyPress.bind(o),o.setWrapperRef=o.setWrapperRef.bind(o),o.handleClickOutside=o.handleClickOutside.bind(o),o._fetchData=o._fetchData.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jt(e,t)}(t,e),o=t,n=[{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyPress),document.addEventListener("mousedown",this.handleClickOutside),null!=this.props.workspace.workspaceData&&this.props.workspace.workspaceData||this._fetchData()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyPress),document.removeEventListener("mousedown",this.handleClickOutside)}},{key:"setWrapperRef",value:function(e){this.wrapperRef=e}},{key:"handleClickOutside",value:function(e){this.wrapperRef&&!this.wrapperRef.contains(e.target)&&setTimeout(function(){this.props.close()}.bind(this),100)}},{key:"handleKeyPress",value:function(e){var t=this.state,o=t.activeIndex,n=t.searchedStack,a=document.querySelector(".searchstack-list-main");if(a&&n.length>0){for(var i=document.getElementsByClassName("search-stack-list")[0]?document.getElementsByClassName("search-stack-list")[0].offsetHeight:document.getElementById("search-stack-list").childNodes[0].offsetHeight,r=0,s=0;s<o+1;s++)r+=i;a.scrollTop=40===e.keyCode&&r+90>a.clientHeight?a.scrollTop+i+10:a.scrollTop-i}var l=e&&e.key;if("ArrowUp"==l&&o>0)this.setState({activeIndex:o-1});else if("ArrowDown"==l&&n.length>o+1)this.setState({activeIndex:o+1});else if("Enter"==l){var c=n.find(function(e,t){return t==o});this.props.history.push({pathname:"/stack/"+c.stackId+"/"}),this.props.close()}}},{key:"_fetchData",value:function(){var e=this;this.setState({loading:!0}),this.props.fetchUserWorkspace().then(function(e){}).catch(function(t){e.setState({loading:!1}
2),m.oR.error("Error Fetching Workspace",Kt)})}},{key:"handleSearchChange",value:function(e){var t=this.props.workspace,o=t.sharedStacks,n=void 0===o?[]:o,a=t.workspaceData,i=[];a.map(function(t){t.stackData.map(function(t){t.stackName.toLowerCase().includes(e.toLowerCase())&&i.push(t)})}),n.map(function(t){t.stackName.toLowerCase().includes(e.toLowerCase())&&i.push(t)}),i=Vt(i.reduce(function(e,t){return e.set(t.stackId,t)},new Map).values()),this.setState({searchstackValue:e,searchedStack:i,activeIndex:0})}},{key:"render",value:function(){var e=this,t=this.state,o=t.searchstackValue,n=t.searchedStack,a=void 0===n?[]:n,i=t.activeIndex,r=this.props.style,s=void 0===r?{}:r;return(0,L.jsxs)("div",{id:"FindStackModel",children:[(0,L.jsxs)("div",{className:"findstack-main",ref:this.setWrapperRef,style:Bt({},s),children:[(0,L.jsx)("input",{value:o,autoFocus:!0,onChange:function(t){return e.handleSearchChange(t.target.value)},className:"stacksearch-input",placeholder:"Jump to a stack"}),a.length>0&&o&&(0,L.jsx)("div",Bt(Bt({className:"searchstack-list-main",style:{backgroundColor:this.props.isFocused?"yellow":"inherit"}},this.props.innerProps),{},{children:a.map(function(t,o){return(0,L.jsxs)("div",{className:"search-stack-list ".concat(i==o?"active":""," "),onClick:function(){return e.props.history.push({pathname:"/stack/"+t.stackId+"/"})},children:[(0,L.jsx)("div",{className:"stack-icons",style:{backgroundColor:t.color},children:(0,L.jsx)(g.A,{icon:t.icon,fontSize:"22px",color:"#fff"})}),(0,L.jsx)("span",{className:"stack-name",children:t.stackName})]},o)})})),0==a.length&&o&&(0,L.jsx)("div",{className:"no-result",children:"No stack found"})]}),(0,L.jsx)("div",{className:"background"})]})}}],n&&Ut(o.prototype,n),a&&Ut(o,a),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,n,a}(s.Component),Yt={fetchUserWorkspace:Ee.XP};const Qt=(0,h.Ng)(function(e){return{workspace:e.workspace}},Yt)(qt);var $t=o(39264),Xt=o(61351),Zt=o(49841),eo=o(28930),to=o(37481),oo=o(68603),no=o(36168),ao=o(3043),io=o(93198),ro=o(96763);function so(e){return so="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},so(e)}function lo(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,co(n.key),n)}}function co(e){var t=function(e,t){if("object"!=so(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!=so(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==so(t)?t:t+""}function uo(e,t,o){return t=ho(t),function(e,t){if(t&&("object"==so(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,po()?Reflect.construct(t,o||[],ho(e).constructor):t.apply(e,o))}function po(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(po=function(){return!!e})()}function ho(e){return ho=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ho(e)}function mo(e,t){return mo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},mo(e,t)}var vo=function(e){function t(e){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(o=uo(this,t,[e])).state={actionPerformed:null,externlaAccountList:[],selectedAccountId:null,accountIdTodelete:null,selectedOption:"select-account"},o.fetchThirdPartyAccounts=o.fetchThirdPartyAccounts.bind(o),o.openSheetListModal=o.openSheetListModal.bind(o),o.handleAccountSelection=o.handleAccountSelection.bind(o),o.onMessageReceived=o.onMessageReceived.bind(o),o.handleGoogleSheetAuth=o.handleGoogleSheetAuth.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mo(e,t)}(t,e),o=t,a=[{key:"componentDidMount",value:function(){this.fetchThirdPartyAccounts(),window.addEventListener("message",this.onMessageReceived,!1)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("message",this.onMessageReceived,!1)}},{key:"onMessageReceived",value:function(e){var t=this.state,o=t.actionPerformed,n=void 0===o?null:o,a=(t.workspaceId,e.data);if(this.state.openSheetLsitModal||a.openSheetLsitModal&&(this.setState({openSheetLsitModal:a.openSheetLsitModal,selectedAccountId:e.data.data.accountid}),this.openSheetListModal(),this.setState({openSheetLsitModal:null,actionPerformed:null})),"stackCreate"===a.action&&"gsheet"===a.from&&(!n||"stackCreate"!==n)){var i=a.spredsheetId,r=a.sheetName,s=a.selectedAccountId;this.setState({actionPerformed:a.action,selectedAccountId:s}),this.props.createStack(r,"importFilepickerGooglesheet",{url:i,selectedAccountId:s}),this.props.close()}}},{key:"openSheetListModal",value:function(){var e=this.state.selectedAccountId,t=e?"/googlesheet/import/isNewStack?selectedAccountId=".concat(e):"/googlesheet/import/isNewStack";(0,k.AN)(t,1e3,600),this.setState({selectedAccountId:null})}},{key:"fetchThirdPartyAccounts",value:function(){var e=this;n.A.post("/api/v1/thirdpartyaccountactions/list",{type:"gsheet"}).then(function(t){var o=t.data,n=e.state.externlaAccountList;n.push({key:0,value:"select-account",text:"Select Account"}),(o.data&&JSON.parse((0,Pe.Y)(o.data))||[]).data.map(function(e){n.push({key:e.id,value:e.id,text:e.name})}),n.push({key:n.length+1,value:"openGsheetAuth",text:"Add Account",image:{avatar:!0,src:"https://stackbybucketprod.s3-ap-southeast-1.amazonaws.com/sheets.png"}}),e.setState({externlaAccountList:n,selectedOption:"select-account"})}).catch(function(e){ro.log(e),toast.error("Error Paste Data",{position:"bottom-left",autoClose:!0,closeButton:!1})})}},{key:"handleAccountSelection",value:function(e){var t=this;this.state.accountIdTodelete||("openGsheetAuth"===e?this.handleGoogleSheetAuth():this.state.selectedOption!==e&&this.setState({selectedAccountId:e},function(){t.openSheetListModal()}))}},{key:"handleGoogleSheetAuth",value:function(e){n.A.post("/api/v1/googleactions/authspreadsheet").then(function(e){var t=e.data.data;(0,k.AN)(t,600,1e3)}).catch(function(e){ro.log(e),toast.error("Error on google authentication",{position:"bottom-left",autoClose:!0,closeButton:!1})})}},{key:"render",value:function(){return this.state.externlaAccountList,(0,L.jsxs)(f.A,{id:"ImportGoogleSheetModel",size:"tiny",open:!0,style:{border:"2px s
2olid #ddd",backgroundColor:"#fff",borderRadius:"6px"},children:[(0,L.jsxs)(f.A.Header,{className:"header",children:[(0,L.jsx)("h2",{className:"h2-header-text",children:"Google Sheets"}),(0,L.jsx)(g.A,{style:{cursor:"pointer"},icon:"md-close",fontSize:"22px",color:"#212121",onClick:this.props.close})]}),(0,L.jsx)(f.A.Content,{style:{padding:"15px"},children:(0,L.jsx)("div",{style:{height:"250px"},children:(0,L.jsxs)("div",{style:{top:"0"},children:[(0,L.jsx)("h3",{className:"h2-header-text",children:"Google Sheets Importer is in Verification"}),(0,L.jsx)("p",{children:"Please download your google sheets into excel file and then use 'Microsoft Excel' importer to import your data into Stackby."})]})})})]})}}],a&&lo(o.prototype,a),i&&lo(o,i),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,a,i}(s.Component),fo=o(96763);function bo(e){return bo="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},bo(e)}function yo(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)}return o}function go(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?yo(Object(o),!0).forEach(function(t){wo(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):yo(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}function wo(e,t,o){return(t=function(e){var t=function(e,t){if("object"!=bo(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!=bo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==bo(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function ko(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var n,a,i,r,s=[],l=!0,c=!1;try{if(i=(o=o.call(e)).next,0===t){if(Object(o)!==o)return;l=!1}else for(;!(l=(n=i.call(o)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=o.return&&(r=o.return(),Object(r)!==r))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return So(e,t);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?So(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function So(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}var Co=$t.Ts("AhnYl4cTXQDeEvfrPtcebz"),Io={position:"bottom-left",autoClose:!0,closeButton:!1},xo={deleteStack:Ee.wm,createStack:Ee.xv,stackContentDelete:De.ji};const Ao=(0,h.Ng)(function(e){return{table:e.table}},xo)(function(e){var t,o=(e||{}).table,a=(0,s.useRef)(null),i=(0,s.useCallback)(function(){var e=a.current,t=document.getElementById("dashboard");if(e&&t){var o=t.getBoundingClientRect().height;o>0&&(e.style.height="".concat(o,"px"),e.style.maxHeight="".concat(o,"px"))}},[]);(0,s.useEffect)(function(){i(),window.addEventListener("resize",i);var e,t=document.getElementById("dashboard");t&&"undefined"!=typeof ResizeObserver&&(e=new ResizeObserver(i)).observe(t);var o=requestAnimationFrame(i);return function(){cancelAnimationFrame(o),window.removeEventListener("resize",i),e&&e.disconnect()}},[i]);var l=ko((0,s.useState)([]),2),c=l[0],d=l[1],u=ko((0,s.useState)(""),2),p=u[0],h=u[1],b=ko((0,s.useState)({}),2),g=b[0],w=b[1],S=ko((0,s.useState)(!1),2),C=S[0],I=S[1],x=ko((0,s.use
2State)(!1),2),A=x[0],j=x[1],T=ko((0,s.useState)(""),2),O=T[0],D=T[1],E=ko((0,s.useState)({}),2),M=E[0],P=E[1],B=ko((0,s.useState)(!1),2),_=B[0],V=B[1],F=ko((0,s.useState)(!1),2),U=F[0],W=F[1],H=ko((0,s.useState)(null),2),G=H[0],z=H[1],J=ko((0,s.useState)(null),2),K=J[0],q=J[1];(0,s.useEffect)(function(){ae()},[]);var Y,Q,$,X,Z,ee,te,oe,ne,ae=function(){W(!0),(0,to.getTemplates)().then(function(e){var t=e||{},o=t.templatesCategory,n=void 0===o?[]:o;t.templatesList;n=n.filter(function(e){return 1==e.isActive}),d(n),w({templatesList:n}),W(!1)}).catch(function(e){fo.log("e",e),W(!1)})},ie=function(t){var o=(e.table||{}).plan,n=((void 0===o?{}:o)||{}).bytesOfUpload;return new Promise(function(e,o){t.size>n&&o("File is too large"),e()})},re=function(t,o,n){var a=e||{},i=a.stackId,s=a.table,l=((void 0===s?{}:s)||{}).workspaceId,c=void 0===l?"":l;I(!0);var d="st"+r().generate(16),u="tb"+r().generate(16);"importPasteData"==o&&(n={url:JSON.stringify({data:n,firstRowIsColumn:!0})});var p={workspaceId:c,type:o,tableId:u,data:n.url,copyStackId:"",name:t,copyStackRows:"",copyStackComment:"",copySource:"",color:y.freeColorStack[Math.floor(Math.random()*y.freeColorStack.length)],icon:"ios-cloud-upload",info:""};n.selectedAccountId&&(p.selectedAccountId=n.selectedAccountId),e.createStack(d,p,"").then(function(){e.history.push("/stack/"+d),I(!1),D(""),P({}),e.deleteStack(i,{}).then(function(){}).catch(function(e){m.oR.error("Error removing stack",Io)})}).catch(function(e){var t="Error creating stack";503==e.response.status&&(t=(0,k.RV)(e.response.data.error||"")),m.oR.error(t,Io),I(!1),D(""),P({})})};return(0,L.jsxs)("div",{id:"StackSidebar",style:go({background:o.color},e.style),children:[(0,L.jsx)(io.A,{open:Boolean(K),options:K,maxSize:null==o||null===(t=o.plan)||void 0===t?void 0:t.bytesOfUpload,stackId:null==o?void 0:o.stackId,workspaceId:null==o?void 0:o.workspaceId,onClose:function(){return q(null)}}),(0,L.jsxs)("div",{className:"stacksidebar-main",style:{color:y.paidColorStack.includes(o.color)?"black":"white"},children:[(0,L.jsxs)("div",{className:"header",children:[(0,L.jsx)("p",{className:"main-heading",children:"Getting started"}),(0,L.jsx)(Xt.IoClose,{onClick:function(){return e.close()},className:"close-icon"})]}),(0,L.jsx)("p",{className:"sub-heading",children:"Import your work"}),(0,L.jsx)("p",{className:"text-desc",children:"Import your data from spreadsheets and convert columns like in a database."}),(0,L.jsxs)("div",{className:"boxes",children:[(0,L.jsx)("div",{className:"box",onClick:function(){return V(!0)},children:"Google sheet"}),(0,L.jsx)("div",{className:"box",onClick:function(){return e={accept:".csv",allowedFileTypes:[".csv"],transformations:{},onUploadDone:function(e){var t=e.filesUploaded,o=t[0].filename;o=o.substring(0,o.lastIndexOf(".")),z({filename:o,url:t[0].url})},fromSources:["local_file_system","googledrive","dropbox","onedrive","box","gmail","facebook","instagram","github","picasa","onedriveforbusiness","clouddrive","webcam","audio","video"],exposeOriginalFile:!0,onFileSelected:ie},void(0,oo.A)({options:e,filestackClient:Co,onOpenUppy:function(){q(e)}});var e},children:"Access/CSV"}),(0,L.jsx)("div",{className:"box",onClick:function(){return j(!0)},children:"Paste data"}),(0,L.jsx)("div",{className:"box",onClick:function(){return e={accept:".xlsx",allowedFileTypes:[".xlsx"],transformations:{},onUploadDone:function(e){var t=e.filesUploaded,o=t[0].filename;o=o.substring(0,o.lastIndexOf(".")),re(o,"importFilepickerxls",{url:t[0].url,filename:o})},fromSources:["local_file_system","googledrive","dropbox","onedrive","box","gmail","facebook","instagram","github","picasa","onedriveforbusiness","clouddrive","webcam","audio","video"],exposeOriginalFile:!0,onFileSelected:ie},void(0,oo.A)({options:e,filestackClient:Co,onOpenUppy:function(){q(e)}});var e},children:"Excel"})]}),(0,L.jsx)("div",{className:"or-divider",children:(0,L.jsx)("span",{children:"or"})}),(0,L.jsx)("p",{className:"sub-heading",children:"Check out our templates"}),(0,L.jsx)("p",{className:"text-desc",children:"Looking for an inspiration? Our recommended templates will help you build your stack quickly"}),(0,L.jsx)(N.A,{fluid:!0,icon:(0,L.jsx)(R.A,{name:"search",style:{color:"white"}}),iconPosition:"left",placeholder:"Find another template",className:"templates-search-input",onChange:function(e){return function(e){var t=(g||{}).templatesList,o=void 0===t?[]:t;h(e),o=o.filter(function(t){return t.name.toLowerCase().includes(e)||t.title.toLowerCase().includes(e)}),d(o)}(e.target.value)}}),c.length>0&&(0,L.jsx)("p",{className:"bold-heading",children:"Recommended stack for your team"}),(0,L.jsx)("div",{className:"template-list-main",children:U?(0,L.jsx)("div",{className:"loader",children:(0,L.jsxs)(eo.A,{active:!0,inline:"centered",children:["Loading"," "]})}):c.length>0?c.map(function(t,o){if(p||!(o>8))return(0,L.jsxs)("div",{className:"box template-box",onClick:function(){return function(t){var o=e||{},n=o.stackId,a=o.table,i=((void 0===a?{}:a)||{}).workspaceId,s=void 0===i?"":i;I(!0);var l="st"+r().generate(16),c={workspaceId:s,type:"duplicate",tableId:"tb"+r().generate(16),data:"",copyStackId:t?t.shareId:"",copyStackRows:!0,copyStackComment:!1,copySource:"templates"};e.createStack(l,c,"").then(function(){e.history.push("/stack/"+l),I(!1),D(""),P({}),e.deleteStack(n,{}).then(function(){}).catch(function(e){m.oR.error("Error removing stack",Io)})}).catch(function(e){var t="Error creating stack";503==e.response.status&&(t=(0,k.RV)(e.response.data.error||"")),m.oR.error(t,Io),I(!1)})}(t)},children:[(0,L.jsx)("img",{className:"box-img",src:t.coverImageUrl}),(0,L.jsx)("div",{className:"box-template-title",children:t.title.length>30?"".concat(t.title.substring(0,30),"..."):t.title})]},o)}):(0,L.jsx)("div",{className:"bold-heading text-center",children:"Template not available!"})}),(0,L.jsxs)("div",{className:"boxes footer-boxes",children:[(0,L.jsxs)("div",{className:"box tooltip",onClick:function(){return o=(t=e||{}).stackId,t.table,I(!0),void e.stackContentDelete(o,{}).then(function(e){I(!1)}).catch(function(e){I(!1)});var t,o},children:["Delete stack content",(0,L.jsx)("span",{className:"tooltiptextheader",style:{whiteSpace:"pre-wrap",overflowWrap:"break-word",width:"200px",top:"25%"},children:"Delete cell content of the stack and keep the template as it is"})]}),(0,L.jsxs)("div",{className:"box tooltip",onClick:function(){return function(){var t=e||{},o=t.stackId,n=t.table,a=((void 0===n?{}:n)||{}).workspaceId,i=void 0===a?"":a;I(!0);var s="st"+r().generate(16),l={workspaceId:i,type:"default",tableId:"tb"+r().generate(16),data:"",copyStackId:"",name:"Untitled stack",copyStackRows:"",copyStackComment:!1,copySource:"dashboard",color:y.freeColorStack[Math.floor(Math.random()*y.freeColorStack.length)],icon:y.stackIcons[Math.floor(Math.random()*y.stackIcons.length)],info:""};e.createStack(s,l,"").then(function(){e.history.push("/stack/"+s),I(!1),e.deleteStack(o,{}).then(function(){D(""),P({})}).catch(function(e){m.oR.error("Error removing stack",Io)})}).catch(function(e){var t="Error creating stack";503==e.response.status&&(t=(0,k.RV)(e.response.data.error||"")),m.oR.error(t,Io),I(!1),D(""),P({})})}()},children:["Restart from scratch",(0,L.jsx)("span",{className:"tooltiptextheader",style:{whiteSpace:"pre-wrap",overflowWrap:"break-word",top:"25%"},children:"Relaunch a new stack from scratch"})]})]}),(0,L.jsxs)("div",{className:"need-help",children:["Need help?"," ",(0,L.jsx)("p",{className:"need-link",onClick:function(){return window.open("https://help.stackby.com/")},children:"Check out our help center."})]})]}),C&&(0,L.jsx)(ao.A,{loaderText:"Loading stack....."}),A&&(Y=M||{},Q=Y.isShowPaseDetails,$=void 0!==Q&&Q,X=Y.totalColumn,Z=void 0===X?0:X,ee=Y.totalRow,te=void 0===ee?0:ee,oe=Y.columnHeadeNames,ne=void 0===oe?[]:oe,(0,L.jsxs)(f.A,{open:!0,onClose:function(){return j(!1)},size:"small",children:[(0,L.jsx)(f.A.Content,{children:(0,L.jsxs)("div",{className:"paste-content",children:[(0,L.jsx)("div",{className:"paste-header",style:{fontSize:"20px",fontWeight:"bold",margin:"5px 0px 5px 0px"},children:"Paste data from Tables"}),(0,L.jsx)("div",{className:"paste-desc",style:{fontSize:"14px",margin:"5px 0px 5px 0px"},children:"You can also copy a table from any spreadsheet app (such as Excel or Google Sheets) and paste it below."}),(0,L.jsxs)(Me.A,{children:[(0,L.jsx)(Zt.A,{placeholder:"Paste here....",style:{minHeight:200},value:O,onChange:function(e){return function(e){D(e);var t="st"+r().generate(16),o={data:e,firstRowIsColumn:!0};n.A.post("/api/v1/stackaction/"+t+"/pastedata",o).then(function(e){var t=e.data,o=t.data&&JSON.parse((0,Pe.Y)(t.data))||[],n=o.data.split(/\r\n|\r|\n/g)[0],a=o.dataRowCount,i=o.headerNames.length;P({isShowPaseDetails:i>0,totalRow:a,totalColumn:i,columnHeadeNames:n.split(/\t/g)})}).catch(function(e){m.oR.error("Error Paste Data",Io)})}(e.target.value)}}),$?(0,L.jsxs)("div",{className:"paseDetailBlock",children:[te," rows and ",Z," columns with headers:",(0,L.jsx)("div",{className:"columnsName",children:ne.map(function(e,t){return(0,L.jsxs)("span",{children:[" ",e," "]},t)}
2)})]}):""]})]})}),$&&(0,L.jsx)(f.A.Actions,{children:(0,L.jsx)(v.A,{onClick:function(){re("Imported stack","importPasteData",O),j(!1)},content:"Import pasted data",primary:!0})})]})),_&&(0,L.jsx)(vo,{close:function(){return V(!1)},createStack:re}),G&&(0,L.jsx)(no.A,{csvData:G,close:function(){return z(null)},history:e.history,stackId:e.stackId,workspaceId:e.table.workspaceId,openType:"stacksidebar"})]})});var jo=o(128),To=o(95093),Oo=o.n(To),Do=(o(4745),o(96763));function Ro(e,t,o,n){var i=[],r={},s=[],l=[];return t.map(function(e,t){e.index=t,i.push(e.columnId),r[e.columnId]=e}),n&&e.map(function(e,t){var c=(0,a.pick)(e,i),d=!1;(0,a.forEach)(c,function(a,i){if(!d){var c=r[i];if(c){var u;try{u=c.typeOptions}catch(e){Do.log(e),u=null}if(a){switch(c.type){case"date":var p=c.typeOptions;if(null!=p){var h=a/1e3,m=p.dateFormat;if(!0===p.isDateTime)a=Oo().unix(h).format(m+" h:mm A");else a=Oo().unix(h).format(m+"")}break;case"number":if(!u){a+="";break}switch(u.format){case"decimal":case"currency":a=a?parseFloat(a).toFixed(u.precision):"";break;default:a+=""}try{Number(a)==Number(n)&&(s.push({columnIndex:c.index,rowIndex:t}),l.push(e))}catch(e){Do.log(e)}break;case"multiSelect":case"select":var v=c.typeOptions;if(null!=v){a=JSON.parse(a)||[];var f="";a&&a.map(function(e,t){var o=v.choices.find(function(t){return t.value==e});o&&(f=""==f?o.label:f+","+o.label)}),a=f}break;case"multiCollaborator":case"collaborator":a=JSON.parse(a);var b="";a.map(function(e,t){var n=o.find(function(t){return t.id&&t.id==e});n&&(b=""==b?n.name:b+","+n.name)}),a=b;break;case"multipleAttachment":a=JSON.parse(a);var y="";a.map(function(e,t){y=""==y?e.filename:y+","+e.filename}),a=y;break;case"link":try{a=JSON.parse(a);var g="";a.forEach(function(e,t){g+=" "+e.foreignRowDisplayName}),a=g}catch(e){}break;case"lookup":try{a=JSON.parse(a);var w="";a.forEach(function(e,t){w+=" "+e.foreignRowDisplayName}),a=w}catch(e){}}if(!["checkbox","number"].includes(c.type)&&a.trim().toLowerCase().includes(n.trim().toLowerCase()))return s.push({columnIndex:c.index,rowIndex:t}),l.push(e),void(d=!0)}else try{if("formula"===c.type){var k=c.typeOptions;if(null!=k){switch(k.formulaText){case"CREATED_TIME":var S=k.dateFormat;k.isDateTime&&"12"===k.timeFormat&&(S+=" hh:mmA"),k.isDateTime&&"24"===k.timeFormat&&(S+=" HH:mm"),a=Oo()(e.createdAt).format(S);break;case"UPDATED_TIME":S=k.dateFormat,k.isDateTime&&"12"===k.timeFormat&&(S+=" hh:mmA"),k.isDateTime&&"24"===k.timeFormat&&(S+=" HH:mm"),a=Oo()(e.updatedAt).format(S);break;case"ROW_ID()":a=e.rowId}if(a.trim().toLowerCase().includes(n.trim().toLowerCase()))return s.push({columnIndex:c.index,rowIndex:t}),l.push(e),void(d=!0)}}}catch(e){}}}})}),{searchArray:s,rowData:l}}var No=o(96763);function Eo(e){return Eo="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},Eo(e)}function Mo(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Po(n.key),n)}}function Po(e){var t=function(e,t){if("object"!=Eo(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!=Eo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Eo(t)?t:t+""}function Lo(e,t,o){return t=_o(t),function(e,t){if(t&&("object"==Eo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Bo()?Reflect.construct(t,o||[],_o(e).constructor):t.apply(e,o))}function Bo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Bo=function(){return!!e})()}function _o(e){return _o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_o(e)}
2function Vo(e,t){return Vo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Vo(e,t)}var Fo={position:"bottom-left",autoClose:!0,closeButton:!1},Uo=function(e){function t(e){var o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),o=Lo(this,t,[e]);var n=(e.table||{}).addUserByEmailModelData,a=(void 0===n?{}:n)||{},i=a.addEmail,r=void 0===i?"":i,s=a.row,l=a.column;return o.state={addEmail:r,type:"stack",addButtonDisable:!1,addLoading:!1,row:s,column:l,invitePermission:2,errorMessage:!1},o.close=o.close.bind(o),o.addUser=o.addUser.bind(o),o.checkEmail=o.checkEmail.bind(o),o.inviteMember=o.inviteMember.bind(o),o.updateCellValue=o.updateCellValue.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vo(e,t)}(t,e),o=t,a=[{key:"componentDidMount",value:function(){this.checkEmail(this.state.addEmail)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){}},{key:"close",value:function(){this.props.closeAddMultiInviteMemberModel()}},{key:"updateCellValue",value:function(e){var t=(this.props||{}).table,o=void 0===t?{}:t,n=(o||{}).stackId,a=void 0===n?"":n,i=this.state,r=i.column,s=i.row,l=r||{},c=l.columnId,d=void 0===c?"":c,u=l.type,p=void 0===u?"":u,h=[];if("multiCollaborator"==p){h=s[d]||[];try{"string"==typeof h&&""!==h&&(h=JSON.parse(h))}catch(e){No.error(e)}e=JSON.stringify(e),h.push(e)}else"collaborator"==p&&(h=[JSON.stringify(e)]);this.props.updateCellValue(a,r.columnId,s.rowId,JSON.stringify(h),o)}},{key:"checkEmail",value:function(e){e&&/\S+@\S+\.\S+/.test(e)?this.setState({addButtonDisable:!1}):this.setState({addButtonDisable:!0})}},{key:"inviteMember",value:function(){var e=this,t=this.state,o=t.type,a=(t.inviteEmail,t.addEmail),i=t.invitePermission,r=(t.searchedUser,this.props.table||{}),s=r.workspaceId,l=void 0===s?"":s,c=r.stackId,d=void 0===c?"":c;this.setState({inviteLoading:!0});var u={email:a.trim(),accessType:i,message:"",isSharingEnable:0,workspaceId:l},p="workspace"===o?l:d;n.A.post("/api/v1/"+o+"action/"+p+"/invite",u).then(function(t){var o=JSON.parse((0,Pe.Y)(t.data.data));m.oR.info("Invitation sent to "+a,Fo),e.updateCellValue(o.inviteId),e.setState({inviteLoading:!1},function(){e.close()})}).catch(function(t){var n,a,i;e.setState({inviteLoading:!1});var r="Error ".concat(o," invite");503==(null===(n=t.response)||void 0===n?void 0:n.status)?r="".concat(o.charAt(0).toUpperCase()+o.slice(1)," users limit reached"):504==(null===(a=t.response)||void 0===a?void 0:a.status)?r="".concat(u.email," already has access to this ").concat(o,"."):505==(null===(i=t.response)||void 0===i?void 0:i.status)&&(r="".concat(u.email," already invited.")),m.oR.error(r,Fo)})}},{key:"addUser",value:function(){var e=this,t=this.state,o=(t.type,t.addEmail);t.errorMessage,this.state.addLoading||(document.getElementById("addUser").innerText="Processing...",setTimeout(function(){document.getElementById("addUser").innerText="Add user"},600));var a={email:o.trim()};n.A.post("/api/v1/email",a).then(function(t){1===JSON.parse(t.data.data)?e.inviteMember():setTimeout(function(){e.setState({errorMessage:!0})},600)}).catch(function(t){e.setState({addLoading:!1})})}},{key:"render",value:function(){var e=this,t=this.state,o=t.addEmail,n=t.addButtonDisable,a=t.addLoading,i=(t.type,t.errorMessage);return(0,L.jsxs)(f.A,{id:"AddMultiCollboratorModel",size:"tiny",open:!0,onClose:this.close,closeIcon:!0,style:{zIndex:1100},children:[(0,L.jsx)(f.A.Header,{children:"Add user to the collaborator column"}),(0,L.jsx)("div",{className:"add-user-text",children:"You may add anyone with a verified Stackby account to this column by email. Adding someone by email will not notify them or give them access to the stack."}),(0,L.jsx)(f.A.Content,{scrolling:!0,children:(0,L.jsxs)("div",{className:"form-content",children:[(0,L.jsx)("div",{className:"form-textarea-main",children:(0,L.jsx)("div",{className:"invite-content OnMobileMainView",children:(0,L.jsx)(Me.A,{children:(0,L.jsxs)("div",{className:"dropdownlist-align",style:{marginBottom:"16
2px"},children:[(0,L.jsx)("div",{className:"list-item",style:{marginBottom:"6px"},children:(0,L.jsx)("span",{className:"list-item-title",children:"Email"})}),(0,L.jsx)("div",{className:"list-item",children:(0,L.jsx)("input",{className:"email-input-css",value:o,onChange:function(t){e.checkEmail(t.target.value),e.setState({addEmail:t.target.value})},autoFocus:!0})}),i&&(0,L.jsx)("div",{className:"verify-email",children:"This email is not associated with an existing verified Stackby account."})]})})})}),(0,L.jsxs)("div",{className:"button",children:[(0,L.jsx)(v.A,{className:"cancel-btn",onClick:this.close,children:"Cancel"}),(0,L.jsx)(v.A,{primary:!0,width:4,onClick:this.addUser,disabled:n,loading:a,id:"addUser",children:"Add User"})]})]})})]})}}],a&&Mo(o.prototype,a),i&&Mo(o,i),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,a,i}(l().Component),Wo={closeAddMultiInviteMemberModel:De.hs,updateCellValue:De.xU};const Ho=(0,h.Ng)(function(e){return{table:e.table,auth:e.auth,socket:e.socket}},Wo)(Uo);var Go=o(29417);const zo=function(){return(0,L.jsxs)("div",{id:"abortApiContainer",children:[(0,L.jsxs)("div",{children:[(0,L.jsxs)("div",{className:"textDiv",children:[(0,L.jsx)(g.A,{className:"",icon:"md-grid",fontSize:"24px",color:"#666666"}),(0,L.jsx)("span",{children:"Sorry, your data taking much time to load"})]}),(0,L.jsx)("div",{className:"retryBtnDiv",children:(0,L.jsx)("button",{className:"retryBtn",onClick:function(){return window.location.reload()},children:"Refresh Page"})})]}),(0,L.jsx)("div",{})]})};const Jo=function(){return(0,s.useEffect)(function(){var e=document.createElement("script");e.src="https://cdn.jsdelivr.net/npm/[email protected]/dist/confetti.browser.min.js",e.async=!0,document.body.appendChild(e),e.onload=function(){window.confetti&&(window.confetti({particleCount:100,spread:70,origin:{y:.6}}),setTimeout(function(){window.confetti({particleCount:150,spread:100,angle:60,origin:{x:0}}),window.confetti({particleCount:150,spread:100,angle:120,origin:{x:1}})},500))}},[]),null};var Ko=o(68241),qo=o(96763);function Yo(e){return Yo="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},Yo(e)}function Qo(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)}return o}function $o(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Qo(Object(o),!0).forEach(function(t){dn(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Qo(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}function Xo(e){return function(e){if(Array.isArray(e))return Zo(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Zo(e,t);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?Zo(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zo(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}function en(){var e,t,o="function"==typeof Symbol?Symbol:{},n=o.iterator||"@@iterator",a=o.toStringTag||"@@toStringTag";function i(o,n,a,i){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return tn(c,"_invoke",function(o,n,a){var i,s,l,c=0,d=a||[],u=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,o){return i=t,s=0,l=e,p.n=o,r}};function h(o,n){for(s=o,l=n,t=0;!u&&c&&!a&&t<d.length;t++){var a,i=d[t],h=p.p,m=i[2];o>3?(a=m===n)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=h&&((a=o<2&&h<i[1])?(s=0,p.v=n,p.n=i[1]):h<m&&(a=o<3||i[0]>n||n>m)&&(i[4]=o,i[5]=n,p.n=m,s=0))}if(a||o>1)return r;throw u=!0,n}return function(a,d,m){if(c>1)throw TypeError("Generator is already running");for(u&&1===d&&h(d,m),s=d,l=m;(t=s<2?e:l)||!u;){i||(s?s<3?(s>1&&(p.n=-1),h(s,l)):p.n=l:p.v=l);try{if(c=2,i){if(s||(a="next"),t=i[a]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");
2if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);i=e}else if((t=(u=p.n<0)?l:o.call(n,p))!==r)break}catch(t){i=e,s=1,l=t}finally{c=1}}return{value:t,done:u}}}(o,a,i),!0),c}var r={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var d=[][n]?t(t([][n]())):(tn(t={},n,function(){return this}),t),u=c.prototype=s.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,tn(e,a,"GeneratorFunction")),e.prototype=Object.create(u),e}return l.prototype=c,tn(u,"constructor",c),tn(c,"constructor",l),l.displayName="GeneratorFunction",tn(c,a,"GeneratorFunction"),tn(u),tn(u,a,"Generator"),tn(u,n,function(){return this}),tn(u,"toString",function(){return"[object Generator]"}),(en=function(){return{w:i,m:p}})()}function tn(e,t,o,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}tn=function(e,t,o,n){function i(t,o){tn(e,t,function(e){return this._invoke(t,o,e)})}t?a?a(e,t,{value:o,enumerable:!n,configurable:!n,writable:!n}):e[t]=o:(i("next",0),i("throw",1),i("return",2))},tn(e,t,o,n)}function on(e,t,o,n,a,i,r){try{var s=e[i](r),l=s.value}catch(e){return void o(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function nn(e){return function(){var t=this,o=arguments;return new Promise(function(n,a){var i=e.apply(t,o);function r(e){on(i,n,a,r,s,"next",e)}function s(e){on(i,n,a,r,s,"throw",e)}r(void 0)})}}function an(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,un(n.key),n)}}function rn(e,t,o){return t=ln(t),function(e,t){if(t&&("object"==Yo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,sn()?Reflect.construct(t,o||[],ln(e).constructor):t.apply(e,o))}function sn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(sn=function(){return!!e})()}function ln(e){return ln=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ln(e)}function cn(e,t){return cn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},cn(e,t)}function dn(e,t,o){return(t=un(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function un(e){var t=function(e,t){if("object"!=Yo(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!=Yo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Yo(t)?t:t+""}var pn=function(e){return(0,L.jsx)(p(),{load:Promise.all([o.e(8096),o.e(2076)]).then(o.bind(o,85008)),componentProps:e})},hn=function(e){return(0,L.jsx)(p(),{load:Promise.all([o.e(8096),o.e(2076),o.e(5179),o.e(7133)]).then(o.bind(o,27796)),componentProps:e})},mn=function(e){return(0,L.jsx)(p(),{load:Promise.all([o.e(8096),o.e(2076),o.e(5179),o.e(7133)]).then(o.bind(o,5186)),componentProps:e})},vn=function(e){return(0,L.jsx)(p(),{load:Promise.all([o.e(8096),o.e(2076)]).then(o.bind(o,56066)),componentProps:e})},fn=function(e){return(0,L.jsx)(p(),{load:Promise.all([o.e(8096),o.e(2076)]).then(o.bind(o,85568)),componentProps:e})},bn=function(e){return(0,L.jsx)(p(),{load:Promise.all([o.e(8096),o.e(2076)]).then(o.bind(o,62791)),componentProps:e})},yn=function(e){return(0,L.jsx)(p(),{load:Promise.all([o.e(8096),o.e(2076)]).then(o.bind(o,21237)),componentProps:e})},gn=function(e){return(0,L.jsx)(p(),{load:o.e(5666).then(o.bind(o,37176)),componentProps:e})},wn=function(e){return(0,L.jsx)(p(),{load:Promise.all([o.e(8096),o.e(2076)]).then(o.bind(o,76885)),componentProps:e})},kn=function(e){return(0,L.jsx)(p(),{load:Promise.all([o.e(8096),o.e(2076)]).then(o.bind(o,85789)),componentProps:e})},Sn=function(e){return(0,L.jsx)(p(),{load:Promise.all([o.e(8096),o.e(2076)]).then(o.bind(o,8377)),componentProps:e})},Cn=function(e){return(0,L.jsx)(p(),{load:Promise.all([o.e(8096),o.e(2076)]).then(o.bind(o,5442)),componentProps:e})},In=function(e){return(0,L.jsx)(p(),{load:Promise.all([o.e(8096),o.e(2076)]).then(o.bind(o,447
252)),componentProps:e})},xn=function(e){return(0,L.jsx)(p(),{load:Promise.all([o.e(8096),o.e(2076)]).then(o.bind(o,52337)),componentProps:e})},An=function(e){return(0,L.jsx)(p(),{load:Promise.all([o.e(8096),o.e(2076)]).then(o.bind(o,61309)),componentProps:e})},jn={position:"bottom-left",autoClose:!0,closeButton:!1},Tn=[{target:".add-speardsheet",content:"Click here on the ‘+’ icon to create a new table or importing from a spreadsheet.",title:"Create a new table"},{target:"ul.contex-menu",content:"You can create a new empty table or import .csv file (from spreadsheets or other platforms). Alternatively, you can also paste data from google sheets or excel.",title:"Bring data easily"},{target:".header-cell .panel-head div ul.contex-menu li:first-child",content:"Click here or double click on column name to choose from 25+ unique column types. ",title:"Change your column properties"},{target:".filters #editFieldProperty",placement:"left",content:"Choose from 25 different column types; from text to number to dropdown options to attachments, ratings, formulas and even link between tables.",title:"Build your own table"},{target:".expand",content:"Click on the 'Arrow' button to expand a row. It will show all the columns in detail and add comments, checklists and reminders. Even see all of your row’s revision history.",title:"Expand Row"},{target:"#CollapsableViewSection",content:"You can visualize your data not only in a table. But also add Kanban, Calendar and Gallery layouts. More so, you can create custom forms to share or embed anyw
2here.",title:"Visualize your data"}],On=["Check out our API column type","Connect column to an API to bring information from popular services","Build custom forms and embed on any webpage to collect responses","Share your individual filtered view with any team member","Embed your stack to any webpage and share it with the world","Use Stackby powerups to do more with your data","Schedule your API column type to refresh data automatically"],Dn=On[Math.floor(Math.random()*On.length)],Rn=function(e){var t=e||{},o=t.auth,n=t.table,a=t.accessType,i=t.selectedView,r=((void 0===i?{}:i)||{}).type,s=void 0===r?"grid":r,l=n.lastTableId,c=n.permission,d=void 0===c?[]:c,u=!0,p=!1,h="",m="",v=!0,f="",b=(d=d.filter(function(e){return"Table"==e.type})).find(function(e){return e.tableId==l}),y=b?JSON.parse(b.permissionOption):{createRowsAccess:"editor",deleteRowAccess:"editor",ignoreLockLevelForForm:!1},g=[];if(y.createRowsAccess){try{g=y&&JSON.parse(y.usersWhoCanCreateRows)}catch(e){g=[]}switch(y.createRowsAccess){case"editor":u=!![1,2,3].includes(a),h="You can't create a new row because this table is configured only for editor and above to create new row.";break;case"creator":u=!![1,2].includes(a),h="You can't create a new row because this table is configured only for creator and owner to create new row.";break;case"specificUsers":u=!!g.find(function(e){return e==o.id}),h="You can't create a new row because this table is configured for specific users to create new row.";break;case"none":u=!1,h="You can't create a new row because this table is not configured for anybody to create new row."}["form"].includes(s)&&!["editor"].includes(y.createRowsAccess)?(u=!(!y||!y.ignoreLockLevelForForm),h="Can not accept submissions because not have permission for submit the form"):["update"].includes(s)&&!["editor"].includes(y.createRowsAccess)&&(u=!(!y||!y.ignoreLockLevelForForm),v=!(!y||!y.ignoreLockLevelForUpdateForm),h="Can not accept submissions because not have permission for submit the form",f="Can not update form data because not have permission to update rows.")}if(y.deleteRowAccess){try{g=y&&JSON.parse(y.usersWhoCanDeleteRows)}catch(e){g=[]}switch(y.deleteRowAccess){case"editor":p=!![1,2,3].includes(a),m="You can't delete this row. This table is configured so only creator and owner can delete rows.";break;case"creator":p=!![1,2].includes(a),m="You can't delete this row. This table is configured so only creator and owner can delete rows.";break;case"specificUsers":p=!!g.find(function(e){return e==o.id}),m="You can't delete this row. This table is configured so only specific users can delete the rows.";break;case"none":p=!1,m="You can't delete this row. This table is configured so nobody can delete any rows."}}return{isTablePermissionCreateRow:u,isTablePermissionDeleteRow:p,tablePermissionCreateRowMsg:h,tablePermissionDeleteRowMsg:m,isTablePermissionUpdateForm:v,tablePermissionUpdateFormMsg:f}},Nn=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).find(function(t){return t.columnId===e});return t&&"multipleAttachment"==t.type?t.columnId:"no-cover-image"},En=function(e){function t(e){var o,n,i,r,s,c;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),dn(c=rn(this,t,[e]),"currentTableChangeRequest",null),dn(c,"hanldeOpenAddMoreModal",function(){c.setState({addMoreModal:!0,activeTabIndex:0})}),dn(c,"handleOpenAppsModal",function(){c.setState({buttonClickToOpenAppsModal:!0})}),dn(c,"handleExpandParticularApp",function(e){c.setState({isAppExpanded:e})});var d=Ne.parse(null===(o=c.props)||void 0===o||null===(o=o.location)||void 0===o?void 0:o.search),u=d.isExperimental,p=void 0!==u&&u,h=d.frozonColumn,m=void 0===h?1:h,v=d.copyLinkToCellOrRecordOrigin,f=void 0===v?null:v,b=d.isExpandRecord,y=void 0===b?null:b,g=d.isShareViewMember,w=void 0!==g&&g,k=d.isAddStackMember,S=void 0!==k&&k,C=d.type,I=void 0===C?null:C,x=d.isHideLeftSide,A=void 0===x?"show":x,j=!(null===(n=c.props)||void 0===n||null===(n=n.history)||void 0===n||null===(n=n.location)||void 0===n||!n.state)&&(null===(i=c.props)||void 0===i||null===(i=i.history)||void 0===i||null===(i=i.location)||void 0===i||null===(i=i.state)||void 0===i?void 0:i.takeTour),T=!(null===(r=c.props)||void 0===r||null===(r=r.history)||void 0===r||null===(r=r.location)||void 0===r||!r.state)&&(null===(s=c.props)||void 0===s||null===(s=s.history)||void 0===s||null===(s=s.location)||void 0===s||null===(s=s.state)||void 0===s?void 0:s.festiFlag),O=!!c.props.history.location.state&&c.props.history.location.state.openConversationalAI,D=c.props.history.location.state?c.props.history.location.state.initialPrompt:"",R=!!c.props.history.location.state&&c.props.history.location.state.isCreateFlow,N=c.props.history.location.state?c.props.history.location.state.userSettings:null,E=localStorage.getItem("blockOuterWidth");return c.state={openConversationalAI:O||!1,initialPrompt:D||"",isCreateFlow:R||!1,userSettings:N||null,frozonColumn:m,isExperimental:["development","local","staging","production"].includes("production")?!p:p,cooltip:Dn,isAutomationConfig:!1,isAutomation:!!localStorage.getItem("isAutomationPage")&&JSON.parse(localStorage.getItem("isAutomationPage")),stackId:e.match.params.stackId,stackName:"",searchValue:null,isChangeView:!1,searchArray:[],searchArrayIndex:-1,pasteData:"",fetching:!0,loading:!0,showCustomizedCardsModel:!1,showChangeRowDataSize:!1,visible:!0,open:!1,isNewTable:!1,disableChangeInGrid:!1,responseArrayLength:0,renameViewInput:!1,showHeightModel:!1,viewSelectedColumnId:"",showColumnSelectModel:!1,showColumnNamesInCards:!0,cardCoverImageColumnId:"no-cover-image",cardFooterSelectorColumnId:"no-footer-collaborators",startRange:0,endRange:0,keyBoardShortcutsMenu:!1,notfound:!1,rowData:!1,columnSchema:!1,expandView:[],takeTour:j,run:!1,eventIndex:0,status:"",blockWidth:E&&parseFloat(E)>39?"35%":E||"30%",isAddChart:!1,isAddPivot:!1,isAddSummary:!1,isAddRowlist:!1,isEditingStackname:!1,isBlock:!0,showConfig:!0,selectedBlockId:null,isModal:!1,blockType:null,isShowTutorial:localStorage.getItem("showHistoryPanel"),persent:(document.body.clientWidth-750)/document.body.clientWidth*100,currentBreakpoint:"lg",compactType:"vertical",mounted:!1,cardCoverGalleryImageColumnId:"no-cover-image",searchValueFocusFlag:!1,currentUserDelete:!1,isS
2howCustomDashboard:!!localStorage.getItem("isShowCustomDashboard")&&JSON.parse(localStorage.getItem("isShowCustomDashboard")),typeOptions:e.typeOptions,isLock:!1,isPersonalView:!1,isUserPersonalView:!1,colorCondition:[],colorSelectedColumnId:"",colorType:"",createdAppBlockId:!1,findStackModelOpen:!1,stackSidebarOpen:!1,resumeBlock:!0,onlineUsers:[],isViewKeyboardShortcuts:!1,isOpenTableSwitcher:!1,showPrintView:!1,rowNotFounfModal:!1,addMoreModal:!1,tableId:e.table.lastTableId,viewId:e.table.lastViewId,createNewTableThroughShortcut:!1,showAddMoreButton:!0,connectionserverModal:!navigator.onLine,tablePermissionData:{},newTableList:[],abortApi:e.table.isApiAborted||!1,errorMessage:"Sorry, the page you were looking for was not found.",copyLinkToCellOrRecordOrigin:!y&&f,viewSectionWidth:localStorage.getItem("viewSectionWidth")?localStorage.getItem("viewSectionWidth"):"200px",isHelpSliderOpen:null,HelpSliderData:{},searchedQuickTips:[],searchedTutorials:[],searchedVideos:[],searchedSupportArticles:[],helpSliderLoading:!1,showContactSalesMenu:!1,showReportBugMenu:!1,selectedView:"",importLoading:!1,isAppExpanded:!1,applyChecklistToAllRowsModal:!1,applyLoader:!1,applyChecklistApiError:"",groupingLoader:!0,isOpenShareModel:w||S,type:I,selectedRow:"",buttonClickToOpenAppsModal:!1,selectButtonBlockId:"",selectedBlockType:"",festiFlag:T,lastHandledTableId:null,isHideLeftSide:A,initialRouteResolved:!1},c.talbeListContainer,c._showCustomizedCardsModel=c._showCustomizedCardsModel.bind(c),c.updateMetadata=c.updateMetadata.bind(c),c.handleShowColumnNamesInCards=c.handleShowColumnNamesInCards.bind(c),c.handleshowColumnSelectModel=c.handleshowColumnSelectModel.bind(c),c.setCardCoverImageColumnId=c.setCardCoverImageColumnId.bind(c),c.setCardFooterSelectorColumnId=c.setCardFooterSelectorColumnId.bind(c),c.changeLastTable=c.changeLastTable.bind(c),c.fetchStackData=c.fetchStackData.bind(c),c.handleAutomation=c.handleAutomation.bind(c),c.viewLastUpdate=c.viewLastUpdate.bind(c),c.convertCSV=c.convertCSV.bind(c),c.setParentCompState=c.setParentCompState.bind(c),c.changeFieldType=c.changeFieldType.bind(c),c.handleSearchChange=(0,a.debounce)(c.handleSearchChange.bind(c),500,{leading:!1,trailing:!0}),c.onClickSearchButton=(0,a.debounce)(c.onClickSearchButton.bind(c),300,{leading:!0,trailing:!1}),c.incEndRangeForAddRecordInKanban=c.incEndRangeForAddRecordInKanban.bind(c),c.handleJoyrideCallback=c.handleJoyrideCallback.bind(c),c.takeTour=c.takeTour.bind(c),c.handleTourPermission=c.handleTourPermission.bind(c),c.addRows=c.addRows.bind(c),c.deleteRows=c.deleteRows.bind(c),c.showDashboard=c.showDashboard.bind(c),c.showDashboardForButtonColumnClick=c.showDashboardForButtonColumnClick.bind(c),c.handleExpandDashboard=c.handleExpandDashboard.bind(c),c.setWrapperRef=c.setWrapperRef.bind(c),c.handleClickOutside=c.handleClickOutside.bind(c),c.handleChartClick=c.handleChartClick.bind(c),c.handlePivotClick=c.handlePivotClick.bind(c),c.handleSummaryClick=c.handleSummaryClick.bind(c),c.handleRowlistClick=c.handleRowlistClick.bind(c),c.handleRedirectToaccount=c.handleRedirectToaccount.bind(c),c.onBreakpointChange=c.onBreakpointChange.bind(c),c.updateDimensions=c.updateDimensions.bind(c),c.hideTutorial=c.hideTutorial.bind(c),c._showCustomizedGalleryCardsModel=c._showCustomizedGalleryCardsModel.bind(c),c.setCardCoverGalleryImageColumnId=c.setCardCoverGalleryImageColumnId.bind(c),c.searchInputFocus=l().createRef(),c.searchValueFocusFun=c.searchValueFocusFun.bind(c),c.handleKeyPress=c.handleKeyPress.bind(c),c.removeScollToBody=c.removeScollToBody.bind(c),c.handleStackSidebar=c.handleStackSidebar.bind(c),c.hanldeUrlChange=c.hanldeUrlChange.bind(c),c.handleUpgradeApps=c.handleUpgradeApps.bind(c),c.handleExploreBlock=c.handleExploreBlock.bind(c),c.fetchDashboardList=c.fetchDashboardList.bind(c),c.handleWindowClose=c.handleWindowClose.bind(c),c.showAddMoreButton=c.showAddMoreButton.bind(c),c.handleInactivity=c.handleInactivity.bind(c),c.onlineHandler=c.onlineHandler.bind(c),c.offlineHandler=c.offlineHandler.bind(c),c.openCloseHelpSlider=c.openCloseHelpSlider.bind(c),c.openHelpSlider=c.openHelpSlider.bind(c),c.closeHelpSlider=c.closeHelpSlider.bind(c),c.openGettingStartedSidebar=c.openGettingStartedSidebar.bind(c),c.handleHelpSearchChange=c.handleHelpSearchChange.bind(c),c.getDataAsPerSection=c.getDataAsPerSection.bind(c),c.openKeyboardShortcutsModal=c.openKeyboardShortcutsModal.bind(c),c.handleShowContactSalesMenu=c.handleShowContactSalesMenu.bind(c),c.handleShowReportBugMenu=c.handleShowReportBugMenu.bind(c),c.handleImportLoader=c.handleImportLoader.bind(c),c.openExpandC
2hecklistModal=c.openExpandChecklistModal.bind(c),c}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cn(e,t)}(t,e),o=t,i=[{key:"searchValueFocusFun",value:function(){this.searchInputFocus.current&&this.searchInputFocus.current.focus()}},{key:"hanldeUrlChange",value:function(e){var t;this.setState({rowNotFounfModal:!1}),null===(t=this.props)||void 0===t||null===(t=t.history)||void 0===t||t.replace(e)}},{key:"generateLayout",value:function(){return _.map(_.range(0,2),function(e,t){var o=Math.ceil(4*Math.random())+1;return{x:2*_.random(0,5)%12,y:Math.floor(t/6)*o,w:4,h:o,i:t.toString(),static:Math.random()<.05}})}},{key:"componentDidMount",value:function(){var e,t,o,n,i,r,s,l,c,d,u,p,h,m,v=this;window.addEventListener("onbeforeunload",this.handleWindowClose),window.addEventListener("beforeunload",this.handleWindowClose,!1),window.addEventListener("online",this.onlineHandler),window.addEventListener("offline",this.offlineHandler);var f,b,y=this.state.stackId;!(0,a.isEmpty)(null===(e=this.props)||void 0===e||null===(e=e.table)||void 0===e?void 0:e.allStackList)&&null!==(t=this.props)&&void 0!==t&&null!==(t=t.table)&&void 0!==t&&t.allStackList[y]||null===(f=this.props)||void 0===f||null===(b=f.fetchAllStackList)||void 0===b||b.call(f,y),null===(o=this.props)||void 0===o||null===(n=o.fetchTableList)||void 0===n||n.call(o,y),this.fetchDashboardList(y),this.setState({mounted:!0}),document.addEventListener("mousedown",this.handleClickOutside),document.addEventListener("keydown",this.handleKeyPress),this.removeScollToBody(!0);var g,w,k,S,C=(null===(i=this.props)||void 0===i||null===(i=i.match)||void 0===i?void 0:i.params.tableId)||"";null===(r=this.props)||void 0===r||null===(r=r.match)||void 0===r||r.params.rowId,(null===(s=this.props)||void 0===s||null===(s=s.table)||void 0===s?void 0:s.lastTableId)&&C.startsWith("tb")&&(null===(l=this.props)||void 0===l||null===(l=l.table)||void 0===l?void 0:l.lastTableId)!==C||(null===(c=this.props)||void 0===c||null===(c=c.table)||void 0===c||!c.lastTableId)&&C?this.changeLastTable(C):this.props.fetchTable(null===(g=this.props)||void 0===g||null===(g=g.match)||void 0===g?void 0:g.params.stackId).then(function(e){var t,o,n,a,i,r,s,l,c;null!==(t=v.props)&&void 0!==t&&null!==(t=t.table)&&void 0!==t&&t.lastTableId&&(null===(s=v.props)||void 0===s||null===(s=s.history)||void 0===s||s.replace({pathname:"/stack/".concat(null===(l=v.props)||void 0===l||null===(l=l.match)||void 0===l?void 0:l.params.stackId,"/").concat(null===(c=v.props)||void 0===c||null===(c=c.table)||void 0===c?void 0:c.lastTableId)})),v.setState({loading:!1,fetching:!1,initialRouteResolved:!0}),v.fetchStackData(null===(o=v.props)||void 0===o||null===(o=o.match)||void 0===o?void 0:o.params.stackId),null===(n=v.props)||void 0===n||null===(a=n.addRecentStack)||void 0===a||a.call(n,null===(i=v.props)||void 0===i||null===(i=i.table)||void 0===i?void 0:i.workspaceId,null===(r=v.props)||void 0===r||null===(r=r.match)||void 0===r?void 0:r.params.stackId)}).catch(function(e){qo.log(":: e",e),e.response?v.setState({loading:!1,fetching:!1,notfound:!0}):v.setState({loading:!1,fetching:!1,notfound:!0,abortApi:!0,initialRouteResolved:!0}),"Unauthorized"===e.response.data.error&&v.setState({errorMessage:"This stack is not shared with you. Please ask the owner to invite you on the stack."})}),null!==(d=this.props)&&void 0!==d&&null!==(d=d.socket)&&void 0!==d&&d.socketUpdate&&(null===(w=this.props)||void 0===w||null===(k=w.addToSocketRoom)||void 0===k||k.call(w,null===(S=this.props)||void 0===S||null===(S=S.match)||void 0===S?void 0:S.params.stackId)),null===(u=this.props)||void 0===u||null===(p=u.fetchScheduleAutomation)||void 0===p||p.call(u,null===(h=this.props)||void 0===h||null===(h=h.match)||void 0===h?void 0:h.params.stackId);var I=Ne.parse(null===(m=this.props)||void 0===m||null===(m=m.location)||void 0===m?void 0:m.search),x=I.isShowDashboard,A=void 0!==x&&x,j=I.blockId,T=void 0!==j&&j;A?(this.setState({isShowCustomDashboard:A,createdAppBlockId:T}),window.history.pushState(null,null,window.location.pathname)):this.setState({isShowCustomDashboard:!1,showBlockModal:!1,blockType:null,selectedBlockId:null});var O=document.createElement("script"),D=document.createTextNode("\n      //Feedback Link Feedback Button:\n      ! function(w, d){\n        if (!w || !d) return false\n        w.fbl_2020_Widget_Config = {\n            position: 'bottom',\n            color: 'dark',\n            link: 'https://feedback.link/stackby',\n            brandHex: '#FFFFFF',\n            frequency: 't'\n        };\n        d.addEventListener(\"DOMContentLoaded\", function(event) {\n            var s = d.createElement('script');\n            s.setAttribute('src','https://feedback.link/web_widget/feedbackbutton?id=2ESg2XxMdhzET2NG9RhbSds6XegC4h0XVPzUQ2tLdjmgwL8s31670242362');\n            d.body.appendChild(s);\n        });\n        }(window, document)\n      ");O.appendChild(D),document.head.appendChild(O),this.getHelpSliderData()}},{key:"getHelpSliderData",value:(p=nn(en().m(function e(){var t;return en().w(function(e){for(;;)switch(e.p=e.n){case 0:return this.setState({helpSliderLoading:!0}),e.p=1,e.n=2,n.A.get("/api/v1/segment/allsegment");case 2:t=e.v,this.setState({HelpSliderData:t.data.data,helpSliderLoading:!1}),e.n=4;break;case 3:throw e.p=3,e.v;case 4:return e.a(2)}},e,this,[[1,3]])}
2)),function(){return p.apply(this,arguments)})},{key:"handleUpgradeApps",value:function(){var e,t=(null===(e=this.props)||void 0===e?void 0:e.table).workspaceId;window.open("/account/workspace/"+t)}},{key:"componentWillReceiveProps",value:function(e){var t,o,n,i,r,s,l,c,u,p,h,m,v,f,b,y,g,w,k,S,C,I,x,A,j,T,O=this,D=e.match.params.tableId,R=null===(t=this.props)||void 0===t||null===(t=t.match)||void 0===t?void 0:t.params.tableId,N=this.state,E=N.searchValue,M=N.selectedView,P=N.count,L=void 0===P?0:P,B=N.copyLinkToCellOrRecordOrigin,_=this.props,V=_.auth,F=_.table,U=F.stackUsers,W=void 0===U?[]:U,H=F.workspaceUsers,G=void 0===H?[]:H,z=F.isSeen,J=G.find(function(e){return e.id===V.id})||W.find(function(e){return e.id===V.id})||{},K=J.accessType,q=void 0===K?0:K,Y=(J.isSharingEnable,{});if(F.isSharedView){var Q=(Array.isArray(null==F?void 0:F.viewsData)?null==F?void 0:F.viewsData:[]).find(function(t){var o;return t.viewId===(null===(o=e.table)||void 0===o?void 0:o.lastViewId)}),$=(Q&&Q.viewUsers?Q.viewUsers:[]).find(function(e){return e.id===V.id});$&&(q=$.accessType)}e.dashboard&&e.dashboard.stackWiseBloksCount&&null!==(o=this.props)&&void 0!==o&&o.table&&null!==(n=this.props)&&void 0!==n&&null!==(n=n.table)&&void 0!==n&&n.plan&&null!==(i=this.props)&&void 0!==i&&null!==(i=i.table)&&void 0!==i&&i.plan.noOfBlockCreate&&e.dashboard.stackWiseBloksCount>=1*(null===(r=this.props)||void 0===r||null===(r=r.table)||void 0===r?void 0:r.plan.noOfBlockCreate)?this.setState({blockLimitReachedButton:!0}):this.setState({blockLimitReachedButton:!1}),this.setState({isChangeView:null===(s=e.table)||void 0===s?void 0:s.isChangeView});var X,Z,ee,te,oe,ne,ae={};if(null!==(l=e.table)&&void 0!==l&&l.viewsData&&(ae=(Array.isArray(null===(X=e.table)||void 0===X?void 0:X.viewsData)?null===(Z=e.table)||void 0===Z?void 0:Z.viewsData:[]).find(function(t){var o;return t.viewId===(null===(o=e.table)||void 0===o?void 0:o.lastViewId)})||{}),null!==(c=e.table)&&void 0!==c&&c.lastViewId&&(null===(u=e.table)||void 0===u?void 0:u.lastViewId)!=M.viewId){var ie,re,se=(Array.isArray(null===(ie=e.table)||void 0===ie?void 0:ie.viewsData)?null===(re=e.table)||void 0===re?void 0:re.viewsData:[]).find(function(t){var o;return t.viewId===(null===(o=e.table)||void 0===o?void 0:o.lastViewId)});this.setState({selectedView:se,isLock:0!=se.isLock})}if("STACK_ONLINE_USER"==e.socket.socketResponse.en&&0==L&&this.setState({stackSidebarOpen:0==z,count:L+1}),["ACTIVE_USER","OFFLINE_USER","STACK_ONLINE_USER","STACK_OFFLINE_USER"].includes(e.socket.socketResponse.en)&&!(0,a.isEmpty)(e.socket.socketResponse.data)){var le,ce=e.socket.socketResponse.data[null===(le=this.props)||void 0===le||null===(le=le.match)||void 0===le?void 0:le.params.stackId];ce&&this.setState({onlineUsers:ce.filter(function(e){var t;return e.userId!==(null===(t=O.props)||void 0===t||null===(t=t.auth)||void 0===t?void 0:t.id)})})}if("WS_DELETE_USER"==e.socket.socketResponse.en&&(null===(p=this.props)||void 0===p||null===(p=p.auth)||void 0===p?void 0:p.id)===e.socket.socketResponse.data.userId&&(null===(ee=this.props)||void 0===ee||null===(ee=ee.history)||void 0===ee||ee.push("/dashboard",{redirectMsg:"workspace unshared"})),"ST_DELETE_USER"===e.socket.socketResponse.en&&(null===(h=this.props)||void 0===h||null===(h=h.match)||void 0===h?void 0:h.params.stackId)===e.socket.socketResponse.data.stackId&&(null===(m=this.props)||void 0===m||null===(m=m.auth)||void 0===m?void 0:m.id)===e.socket.socketResponse.data.userId&&this.setState({loading:!1,fetching:!1,notfound:!0,currentUserDelete:!0,errorMessage:"This stack is not shared with you. Please ask the owner to invite you on the stack."}),"VW_DELETE_USER"===e.socket.socketResponse.en&&(null===(v=this.props)||void 0===v||null===(v=v.match)||void 0===v?void 0:v.params.stackId)===e.socket.socketResponse.data.stackId&&(null===(f=this.props)||void 0===f||null===(f=f.auth)||void 0===f?void 0:f.id)===e.socket.socketResponse.data.userId){var de=e.table&&e.table.viewsData?e.table.viewsData:[],ue=de.length>0,pe=e.table.lastViewId&&de.some(function(t){return t.viewId===e.table.lastViewId});ue&&pe?this.setState({loading:!1,fetching:!1,notfound:!1,errorMessage:""}):this.setState({loading:!1,fetching:!1,notfound:!0,errorMessage:"This view is not shared with you. Please ask the owner to invite you on the view."})}if("VW_INVITE"===e.socket.socketResponse.en){var he=e.socket.socketResponse.data||{},me=he.users||he.viewUsers||[],ve=he.email&&this.props.auth&&he.email.toLowerCase()==this.props.auth.email.toLowerCase(),fe=Array.isArray(me)&&me.some(function(e){return e.id==O.props.auth.id});if(ve||fe){var be=he.tableId||he.table_id;be&&be!==e.table.lastTableId&&((e.table.tableList||[]).some(function(e){return e.tableId===be})||this.props.fetchTable(e.match.params.stackId)),(e.table&&e.table.viewsData?e.table.viewsData:[]).length>0&&e.table.lastViewId?this.setState({loading:!1,fetching:!1,notfound:!1,errorMessage:""}):this.props.fetchTable(e.match.params.stackId).then(function(){O.setState({loading:!1,fetching:!1,notfound:!1,errorMessage:""})}).catch(function(){O.setState({loading:!1,fetching:!1})})}var ye=he.viewId||he.ViewsData&&he.ViewsData.viewId;if(ye&&this.state.selectedView&&this.state.selectedView.viewId===ye&&Array.isArray(me)&&me.length>0){var ke=(te=O.state.selectedView.viewUsers||[],oe=[].concat(Xo(te),Xo(me)),ne=new Set,oe.filter(function(e){var t=e.id||e.email;return null!=t&&!ne.has(t)&&(ne.add(t),!0)}));this.setState({selectedView:$o($o({},this.state.selectedView),{},{viewUsers:ke})})}}if((null===(b=this.props)||void 0===b||null===(b=b.match)||void 0===b?void 0:b.params.stackId)!==e.match.params.stackId)return this.setState({stackId:e.match.params.stackId,fetching:!0,run:!1}),void this.props.fetchTable(e.match.params.stackId).then(function(t){var o,n;O.setState({loading:!1,fetching:!1,searchArray:[],searchArrayIndex:-1}),O.fetchStackData(e.match.params.stackId),null===(o=O.props)||void 0===o||null===(n=o.addToSocketRoom)||void 0===n||n.call(o,e.match.params.stackId)}).catch(function(e){return O.setState({loading:!1,fetching:!1,notfound:!0})});D&&R!==D&&D!==this.state.lastHandledTableId&&this.setState({lastHandledTableId:D},function(){O.changeLastTable(D)});var Se,Ce,Ie,xe,Ae,je=e.match.params,Te=je.rowId,Oe=je.columnId,De=je.tableId;if(Te)if(null!==(Se=e.table)&&void 0!==Se&&Se.rowData&&0===(Array.isArray(null===(Ce=e.table)||void 0===Ce?void 0:Ce.rowData)?null===(Ie=e.table)||void 0===Ie?void 0:Ie.rowData:[]).filter(function(e){return e.rowId===Te}).length)this.setState({rowNotFoundModal:!0});else if(null!==(xe=e.table)&&void 0!==xe&&xe.rowData&&!B){var Ne,Ee,Me=Oe&&Oe.indexOf("act")>-1?"activity":"history";null===(Ne=this.props)||void 0===Ne||null===(Ee=Ne.openExpandView)||void 0===Ee||Ee.call(Ne,{open:!0,rowId:Te,isLink:!1,tableId:De,tab:Me})}this.setState({expandView:null===(y=e.table)||void 0===y?void 0:y.expandView}),null!==(g=e.table)&&void 0!==g&&g.columnSchema&&this.setState({columnSchema:null===(Ae=e.table)||void 0===Ae?void 0:Ae.columnSchema});var Pe,Le,Be,_e,Ve,Fe=e.table;if((null===(w=e.table)||void 0===w?void 0:w.lastTableId)===(null===(k=this.props)||void 0===k||null===(k=k.table)||void 0===k?void 0:k.lastTableId)&&(null===(S=e.table)||void 0===S?void 0:S.lastViewId)===(null===(C=this.props)||void 0===C||null===(C=C.table)||void 0===C?void 0:C.lastViewId)||(Fe.columnSchema=null!==(Pe=e.table)&&void 0!==Pe&&Pe.columnSchema?null===(Le=e.table)||void 0===Le?void 0:Le.columnSchema:null===(Be=this.props)||void 0===Be||null===(Be=Be.table)||void 0===Be?void 0:Be.columnSchema),this.state.isExperimental&&Fe.rowData?((Array.isArray(null==Fe?void 0:Fe.rowData)?null==Fe?void 0:Fe.rowData:[]).filter(function(e){return e.visibility}),(0,ge.kT)($o($o({},Fe),{},{currentUserId:null==V?void 0:V.id}),!0).then(function(t){var o,n=!1,i=Re.Fr&&O.state.selectedView&&"grid"===O.state.selectedView.type,r=null!=E&&""!==E&&void 0!==E,s=M&&M.groupLevels&&JSON.parse(M.groupLevels)||!1,l=ae&&ae.groupLevels&&JSON.parse(ae.groupLevels)||!1;if(s=s&&s.groupLevelsSet||[],l=l&&l.groupLevelsSet||[],!i&&ae&&["grid","list"].includes(ae.type)&&M&&(!(0,a.isEqual)(s,l)||M.viewId!==ae.viewId)&&l&&(n=!0),Re.Fr&&O.state.selectedView&&"grid"===O.state.selectedView.type)if(null==E||""==E||null==E)Y.rowData=t;else{var c=Ro(t,Fe.columnSchema,Fe.stackUsers,E).rowData;Y.rowData=c}else if(!i&&M&&["grid","list"].includes(M.type)&&ae.filters!=M.filters&&ae.groupLevels&&(n=!0),r){var u=O.props.table.viewsData.find(function(e){return e.viewId===O.props.table.lastViewId})||{},p=e.table.groupByRowData?[].concat.apply([],e.table.groupByRowData.filter(function(e){return!e.hasChildGroup}).map(function(e){return e.rowIdsPerGroup})).map(function(e){return Fe.rowData[e]}):t;(0,we.A)(p,Fe.columnSchema,Fe.stackUsers,E,u.type).then(function(e){var t=e.searchArray;e.rowData,O.setState({searchArray:t,searchLoading:!1,rowData:p})})}else if(!(0,a.isEqual)(O.state.rowData,null===(o=e.table)||void 0===o?void 0:o.rowData)||!(0,a.isEqual)(O.state.rowData,t)){var h,m,v=!1;try{if(ae.groupLevels){var f=JSON.parse(ae.groupLevels);v=!!(f&&f.groupLevelsSet&&f.groupLevelsSet.length>0)}}catch(e){v=!1}if(!i&&v&&M&&["grid","list"].includes(M.type)&&!(0,a.isEqual)(null===(h=O.props.table)||void 0===h?void 0:h.rowData,null===(m=e.table)||void 0===m?void 0:m.rowData))n=!0;else{var b=e.table.groupByRowData?[].concat.apply([],e.table.groupByRowData.filter(function(e){return!e.hasChildGroup}).map(function(e){return e.rowIdsPerGroup})).map(function(e){return Fe.rowData[e]}):t;Y.rowData=b}}var y=function(){var t=!1;try{t=JSON.parse(ae.sort)||!1}catch(e){t=!1}t&&t.shouldAutoSort&&!ae.groupLevels?(0,ge.Ov)(e.table,ae.sort).then(function(e){var t=[];Y&&Y.rowData&&(t=e.filter(function(e){return Y.rowData.some(function(t){return t.rowId==e.rowId})})),O.setState({rowData:t})}):O.setState(Y)};n&&!r?(0,jo.LF)(e.table,t).then(function(o){var n=o.groupByRowData,i=n?[].concat.apply([],n.filter(function(e){return!e.hasChildGroup}).map(function(e){return e.rowIdsPerGroup})).map(function(e){return Fe.rowData[e]}):t;i=i.filter(function(e){return e}),Y.rowData=i;var r=function(){try{return JSON.parse(ae.sort)||!1}catch(e){return!1}}();r&&r.shouldAutoSort&&!ae.groupLevels?((0,a.isEqual)(o.groupByRowData,e.table.groupByRowData)||(o.filteredRowData=i,O.props.updateGroupByRowData(o||[])),(0,ge.Ov)(e.table,ae.sort).then(function(e){var t=[];Y&&Y.rowData&&(t=e.filter(function(e){return Y.rowData.some(function(t){return t.rowId==e.rowId})})),O.setState({rowData:t})})):d().unstable_batchedUpdates(function(){(0,a.isEqual)(o.groupByRowData,e.table.groupByRowData)||(o.filteredRowData=i,O.props.updateGroupByRowData(o||[])),O.setState(Y)})}).catch(function(e){qo.log("eee",e),y()}):y()}).catch(function(e){})):(0,ge.kT)($o($o({},Fe),{},{currentUserId:null==V?void 0:V.id})).then(function(e){if(Re.Fr&&"grid"===O.state.selectedView.type)if(null==E||""==E||null==E)O.setState({rowData:e});else{var t=Ro(e,Fe.columnSchema,Fe.stackUsers,E).rowData;O.setState({rowData:t})}else null==E||""==E||null==E?O.setState({rowData:e}):(0,we.A)(e,Fe.columnSchema,Fe.stackUsers,E).then(function(t){var o=t.searchArray;t.rowData,O.setState({searchArray:o,searchLoading:!1,rowData:e})})}),null!==(I=e.table)&&void 0!==I&&I.viewsData){var Ue,We,He=(Array.isArray(null===(Ue=e.table)||void 0===Ue?void 0:Ue.viewsData)?null===(We=e.table)||void 0===We?void 0:We.viewsData:[]).find(function(t){var o;return t.viewId===(null===(o=e.table)||void 0===o?void 0:o.lastViewId)})||{},Ge=e.auth,ze=void 0===Ge?{}:Ge,Je=[],Ke="",qe="";He.colorConfig&&(qe=(Je=JSON.parse(He.colorConfig))?Je.type:"",Ke=Je?Je.selectColumnId:"",Je=Je?null==Je.colorDefinitions?[]:Je.colorDefinitions:[]);var Ye=!1,Qe=!1;He&&1==He.isPersonal&&He.createdBy==ze.id?Ye=!0:He&&1==He.isPersonal&&He.createdBy!=ze.id&&(Qe=!0),this.setState({selectedView:He,colorCondition:Je,isLock:0!=He.isLock,isPersonalView:Qe,isUserPersonalView:Ye,colorSelectedColumnId:Ke,colorType:qe})}if((null===(x=e.table)||void 0===x?void 0:x.lastTableId)===this.state.tableId&&(null===(A=e.table)||void 0===A?void 0:A.lastViewId)===this.state.viewId||this.setState({tableId:null===(_e=e.table)||void 0===_e?void 0:_e.lastTableId,viewId:null===(Ve=e.table)||void 0===Ve?void 0:Ve.lastViewId}),(null===(j=e.table)||void 0===j?void 0:j.permission)!==(null===(T=this.props)||void 0===T||null===(T=T.table)||void 0===T?void 0:T.permission)||F.isSharedView){var $e=Rn({accessType:q,table:e.table,auth:V,selectedView:M});this.setState({tablePermissionData:$e})}}},{key:"componentDidUpdate",value:function(e,t){var o,n,i,r,s,l,c,d,u,p=this;window.addEventListener("resize",this.updateDimensions);var h,m,v,f,b=this.state,y=b.rowData;if(b.blockWidth,!e.params.tableId&&null!==(o=this.props)&&void 0!==o&&null!==(o=o.params)&&void 0!==o&&o.tableId&&(this.state.initialRouteResolved||this.setState({initialRouteResolved:!0})),e.socket.socketUpdate!==(null===(n=this.props)||void 0===n||null===(n=n.socket)||void 0===n?void 0:n.socketUpdate)&&null!==(h=this.props)&&void 0!==h&&null!==(h=h.socket)&&void 0!==h&&h.socketUpdate&&(null===(m=this.props)||void 0===m||null===(v=m.addToSocketRoom)||void 0===v||v.call(m,null===(f=this.props)||void 0===f||null===(f=f.match)||void 0===f?void 0:f.params.stackId)),!(0,a.isEmpty)(null===(i=this.props)||void 0===i||null===(i=i.socket)||void 0===i?void 0:i.socketResponse)&&e.socket.socketResponse!==(null===(r=this.props)||void 0===r||null===(r=r.socket)||void 0===r?void 0:r.socketResponse)){var g=this.props,w=g.socket.socketResponse,k=g.auth,S=g.table,C=w.data,I=C.tableId,x=C.viewId,A=C.userId,j=this.state,T=j.stackId,O=(j.blocks,!0);if(["COLUMN_CREATE","COLUMN_MOVE","COLUMN_RENAME","COLUMN_VISIBILITY","COLUMN_DESCRIPTION","COLUMN_DELETE","COLUMN_UPDATE_CONFIG","ROW_CREATE","ROW_UPDATE_HEIGHT","ROW_ADD_COMMENT","ROW_DELETE_COMMENT","ROW_DELETE","CELL_UPDATE","PASTE_CELL_UPDATE"].includes(w.en)?O=I===S.lastTableId:["ROW_MOVE","VIEW_UPDATE_FILTER","VIEW_UPDATE_SORT","VIEW_UPDATE_GROUP","VIEW_METADATA_UPDATE"].includes(w.en)?O=I===S.lastTableId&&x===S.lastViewId:["VIEW_LAST_UPDATE"].includes(w.en)?O=A===k.id:["SWITCH_TABLE"].includes(w.en)&&this.changeLastTable(w.data.tableId),O)switch(w.en){case"WS_DELETE":w.data.workspaceId===S.workspaceId&&this.setState({loading:!1,fetching:!1,notfound:!0,errorMessage:"This stack is no longer available as the owner deleted the workspace."});break;case"ST_DELETE":w.data.workspaceId===S.workspaceId&&w.data.stackId===T&&this.setState({loading:!1,fetching:!1,notfound:!0,errorMessage:"This stack is no longer available as the owner deleted the stack."});break;case"TABLE_CREATE":case"TABLE_REVERT":break;case"VIEW_LAST_UPDATE":this.viewLastUpdate(w);break;case"VIEW_DELETE":if(w.data&&w.data.tableId&&w.data.tableId!==S.lastTableId){var D=w.data.users||[],R=D.includes(""+this.props.auth.id)||D.includes(this.props.auth.id),N=1==w.data.previousIsVisible;(R||N)&&this.props.fetchTable(T);break}var E=e.table&&e.table.lastViewId,M=S&&S.viewsData||[],P=!!E&&!M.some(function(e){return e.viewId===E});w.data&&w.data.ownerId==this.props.auth.id||!P?w.data.users&&w.data.users.includes(""+this.props.auth.id)&&this.viewLastUpdate(w):M.length>0&&S.lastViewId?(this.setState({loading:!1,fetching:!1,notfound:!1,errorMessage:""}),this.viewLastUpdate({data:{lastViewId:S.lastViewId}})):this.setState({loading:!1,fetching:!1,notfound:!0,errorMessage:"This view is not shared with you. Please ask the owner to invite you on the view."});break;case"VW_DELETE_USER":if(!w.data||w.data.userId!=this.props.auth.id)break;var L=S&&S.viewsData?S.viewsData:[];S.lastViewId&&L.some(function(e){return e.viewId===S.lastViewId})?(this.setState({loading:!1,fetching:!1,notfound:!1,errorMessage:""}),this.viewLastUpdate({data:{lastViewId:S.lastViewId}})):this.setState({loading:!1,fetching:!1,notfound:!0,errorMessage:"This view is not shared with you. Please ask the owner to invite you on the view."});break;case"VIEW_RENAME":case"VIEW_UPDATE_FILTER":case"VIEW_UPDATE_SORT":case"VIEW_UPDATE_GROUP":var B=(0,a.findIndex)((null==S?void 0:S.viewsData)||[],{viewId:w.data.viewsData.viewId}),_=w.data.viewsData.groupLevels,V={};switch((null==S||null===(s=S.viewsData)||void 0===s?void 0:s[B])&&(null==S||null===(l=S.viewsData)||void 0===l||null===(l=l[B])||void 0===l?void 0:l.type)){case"kanban":var F=((_=_&&JSON.parse(_))&&_[0]?_[0]:{}).columnId,U=_&&_[1]?_
2[1]:{},W=U.rowStartRange,H=void 0===W?this.state.startRange:W,G=U.rowEndRange,z=void 0===G?y.length>100?this.state.endRange:y.length:G;(0,a.indexOf)(["VIEW_UPDATE_FILTER","VIEW_UPDATE_SORT","VIEW_UPDATE_GROUP"],w.en)>-1&&(V={searchArray:[],searchArrayIndex:-1,searchValue:""}),this.setState((0,a.extend)({renameViewInput:!1,viewSelectedColumnId:F,startRange:H,endRange:z},V));break;case"calendar":var J=(_=_&&JSON.parse(_))&&_[1]?_[1]:{},K=J.rowStartRange,q=void 0===K?this.state.startRange:K,Y=J.rowEndRange,Q=void 0===Y?y.length>100?this.state.endRange:y.length:Y,$=_&&_[0]?_[0]:{},X=$.startRangeColumnId,Z=$.endRangeColumnId;(0,a.indexOf)(["VIEW_UPDATE_FILTER","VIEW_UPDATE_SORT","VIEW_UPDATE_GROUP"],w.en)>-1&&(V={searchArray:[],searchArrayIndex:-1,searchValue:""}),this.setState({renameViewInput:!1,startRangeColumnId:X,endRangeColumnId:Z,startRange:q,endRange:Q})}break;case"VIEW_METADATA_UPDATE":try{var ee=w.data.viewsData.metadata&&JSON.parse(w.data.viewsData.metadata),te=ee.coverImageGalleryColumnId,oe=void 0===te?"no-cover-image":te,ne=ee.coverImageColumnId,ae=void 0===ne?"no-cover-image":ne,ie=ee.footerSelectorColumnId,re=void 0===ie?"no-footer-collaborators":ie,se=ee.showColumnNamesInCards,le=void 0===se||se;this.setState({cardCoverImageColumnId:ae,cardFooterSelectorColumnId:re,showColumnNamesInCards:le,cardCoverGalleryImageColumnId:Nn(oe,S.columnSchema||[])})}catch(e){qo.error(e)}break;case"COLUMN_UPDATE_CONFIG":var ce,de,ue,pe,he=this.state.selectedView,me=void 0===he?{}:he,ve=((_=me.groupLevels||null)?JSON.parse(_):{}||{}).groupLevelsSet,fe=void 0===ve?[]:ve;if(fe.length>0)["multilineText"].includes(w.data.columnData.type)&&w.data.columnData.typeOptions&&1==w.data.columnData.typeOptions.selectRichOption&&(null===(ce=this.props)||void 0===ce||null===(de=ce.applyGroupBy)||void 0===de||de.call(ce,T,{groupLevels:null,tableId:me.tableId,viewId:me.viewId})),jo.$L.includes(w.data.columnData.type)&&fe[0].columnId==w.data.columnData.columnId?null===(ue=this.props)||void 0===ue||null===(pe=ue.applyGroupBy)||void 0===pe||pe.call(ue,T,{groupLevels:null,tableId:me.tableId,viewId:me.viewId}):w.data.previousColumnData.type==w.data.columnData.type&&w.data.previousColumnData.defaultValue==w.data.columnData.defaultValue&&(0,a.isEqual)(JSON.parse(w.data.previousColumnData.typeOptions),w.data.columnData.typeOptions)||fe[0].columnId==w.data.previousColumnData.columnId&&setTimeout(function(){var e;(0,jo.LF)(null===(e=p.props)||void 0===e?void 0:e.table,p.state.rowData).then(function(e){var t,o,n,a,i=[].concat.apply([],(Array.isArray(null===(t=p.props)||void 0===t||null===(t=t.table)||void 0===t?void 0:t.groupByRowData)?null===(o=p.props)||void 0===o||null===(o=o.table)||void 0===o?void 0:o.groupByRowData:[]).map(function(e){return e.rowIdsPerGroup})).map(function(e){var t;return null===(t=p.props)||void 0===t||null===(t=t.table)||void 0===t?void 0:t.rowData[e]});e.filteredRowData=i.filter(function(e){return e}),null===(n=p.props)||void 0===n||null===(a=n.updateGroupByRowData)||void 0===a||a.call(n,e||[])}).catch(function(e){qo.log("eee",e)})},500);break;case"ROW_VISIBILITY_CHANGE":null!==(c=this.props)&&void 0!==c&&c.table&&I==(null===(d=this.props)||void 0===d||null===(d=d.table)||void 0===d?void 0:d.lastTableId)&&null!==(u=this.props)&&void 0!==u&&null!==(u=u.table)&&void 0!==u&&u.groupByRowData&&setTimeout(function(){var e;(0,jo.LF)(null===(e=p.props)||void 0===e?void 0:e.table,p.state.rowData).then(function(e){var t,o,n=e.groupByRowData,a=n?[].concat.apply([],(Array.isArray(n)?n:[]).map(function(e){return e.rowIdsPerGroup})).map(function(e){return p.state.rowData[e]}):p.state.rowData;p.setState({rowData:(Array.isArray(a)?a:[]).filter(function(e){return e})}),e.filteredRowData=(Array.isArray(a)?a:[]).filter(function(e){return e}),null===(t=p.props)||void 0===t||null===(o=t.updateGroupByRowData)||void 0===o||o.call(t,e||[])}).catch(function(e){qo.log("eee",e)})},1500)}}}},{key:"componentWillMount",value:function(){localStorage.removeItem("resumeBlock"),localStorage.removeItem("lastActvity"),"undefined"!=typeof window&&window.Produktly&&"function"==typeof window.Produktly.openNpsWidget&&window.Produktly.openNpsWidget({id:355})}},{key:"componentWillUnmount",value:function(){var e,t,o,n,a;window.removeEventListener("onbeforeunload",this.handleWindowClose),window.removeEventListener("beforeunload",this.handleWindowClose,!1),window.removeEventListener("online",this.onlineHandler),window.removeEventListener("offline",this.offlineHandler),null===(e=this.props)||void 0===e||null===(t=e.leaveToSocketRoom)||void 0===t||t.call(e,null===(o=this.props)||void 0===o||null===(o=o.match)||void 0===o?void 0:o.params.stackId),document.removeEventListener("mousedown",this.handleClickOutside),window.removeEventListener("resize",this.updateDimensions),document.removeEventListener("keydown",this.handleKeyPress),this.removeScollToBody(!1),null===(n=this.props)||void 0===n||null===(a=n.abortApiStatus)||void 0===a||a.call(n,!1)}},{key:"removeScollToBody",value:function(e){document.body.style.overflow=e?"hidden":"auto"}},{key:"handleKeyPress",value:function(e){var t=-1!==navigator.appVersion.indexOf("Mac")?e.metaKey:e.ctrlKey;!t||e.shiftKey||"f"!=e.key&&"F"!=e.key?!t||e.shiftKey||"k"!=e.key&&"K"!=e.key?t&&"/"==e.key?(this.setState({isViewKeyboardShortcuts:!this.state.isViewKeyboardShortcuts}),e.preventDefault()):!t||"m"!=e.key&&"M"!=e.key?t&&e.shiftKey&&(220==e.keyCode||"\\"===e.key||"|"===e.key)?(this.showDashboard(),this.showDashboardForButtonColumnClick(),e.preventDefault()):!t||"p"!=e.key&&"P"!=e.key||(this.setState({showPrintView:!this.state.showPrintView}),e.preventDefault()):(this.setState({isOpenTableSwitcher:!this.state.isOpenTableSwitcher}),e.preventDefault()):(this.setState({findStackModelOpen:!this.state.findStackModelOpen}),e.preventDefault()):(this.searchValueFocusFun(),this.setState({searchValueFocusFlag:!0}),e.preventDefault())}},{key:"updateDimensions",value:function(){var e=(document.body.clientWidth-750)/document.body.clientWidth*100;this.setState({persent:e})}},{key:"viewLastUpdate",value:function(e){var t=this.props.table,o=(0,a.find)((null==t?void 0:t.viewsData)||[],{viewId:e.data.lastViewId}),n=o?(0,a.find)((0,y.viewList)(),{key:o.type}).icon:"grid-layout";switch(o&&o.type){case"kanban":var i=o.metadata?JSON.parse(o.metadata):{},r=i.coverImageColumnId,s=void 0===r?"no-cover-image":r,l=i.footerSelectorColumnId,c=void 0===l?"no-footer-collaborators":l,d=i.showColumnNamesInCards,u=void 0===d||d,p=(o.groupLevels&&JSON.parse(o.groupLevels)[0]?JSON.parse(o.groupLevels)[0]:{}
2).columnId,h=o.groupLevels&&JSON.parse(o.groupLevels)[1]?JSON.parse(o.groupLevels)[1]:{},m=h.rowStartRange,v=void 0===m?0:m,f=h.rowEndRange,b=void 0===f?t.rowData.length>100?100:t.rowData.length:f;this.setState({viewSelectedColumnId:p,cardCoverImageColumnId:s,cardFooterSelectorColumnId:c,showColumnNamesInCards:u,startRange:v,endRange:b,selectedViewName:o.name,selectedViewIcon:n});break;case"calendar":var g=o.groupLevels&&JSON.parse(o.groupLevels)[0]?JSON.parse(o.groupLevels)[0]:{},w=g.startRangeColumnId,k=g.endRangeColumnId,S=o.groupLevels&&JSON.parse(o.groupLevels)[1]?JSON.parse(o.groupLevels)[1]:{},C=S.rowStartRange,I=void 0===C?0:C,x=S.rowEndRange,A=void 0===x?t.rowData.length>100?100:t.rowData.length:x;this.setState({startRangeColumnId:w,endRangeColumnId:k,startRange:I,endRange:A});break;case"gallery":var j=o.metadata?JSON.parse(o.metadata):{},T=j.coverImageGalleryColumnId,O=void 0===T?"no-cover-image":T,D=j.showColumnNamesInCards;this.setState({cardCoverGalleryImageColumnId:Nn(O,t.columnSchema||[]),showColumnNamesInCards:D})}}},{key:"setParentCompState",value:function(e){this.setState(e)}},{key:"convertCSV",value:function(){var e=this.props.table,t=e.columnSchema,o=e.stackUsers,n=e.tableList,a=e.viewsData,i=e.lastTableId,r=e.lastViewId,s=this.state.rowData;(0,ye.t)(s,t,o,n,a,i,r)}},{key:"changeLastTable",value:function(e){var t,o,n=this,a=Date.now();this.currentTableChangeRequest=a;var i=this.state.stackId;this.setState({fetching:!0,searchArray:[],searchArrayIndex:-1,tableRenameOpen:!1}),this.props.changeLastTable(i,e,null===(t=this.props)||void 0===t||null===(t=t.table)||void 0===t?void 0:t.workspaceId,null===(o=this.props)||void 0===o||null===(o=o.auth)||void 0===o?void 0:o.id).then(function(t){var o,r,s,l,c;if(n.currentTableChangeRequest===a){var d,u,p;if(null!==(o=n.props)&&void 0!==o&&null!==(o=o.match)&&void 0!==o&&o.params.rowId&&null!==(r=n.props)&&void 0!==r&&null!==(r=r.match)&&void 0!==r&&r.params.columnId)d="/stack/".concat(i,"/").concat(e,"/").concat(null===(u=n.props)||void 0===u||null===(u=u.match)||void 0===u?void 0:u.params.rowId,"/").concat(null===(p=n.props)||void 0===p||null===(p=p.match)||void 0===p?void 0:p.params.columnId);else if(null!==(s=n.props)&&void 0!==s&&null!==(s=s.match)&&void 0!==s&&s.params.rowId){var h;d="/stack/".concat(i,"/").concat(e,"/").concat(null===(h=n.props)||void 0===h||null===(h=h.match)||void 0===h?void 0:h.params.rowId)}else d="/stack/".concat(i,"/").concat(e);null===(l=n.props)||void 0===l||null===(l=l.history)||void 0===l||l.replace({pathname:d});var m=null!==(c=n.props)&&void 0!==c&&null!==(c=c.table)&&void 0!==c&&c.lastTableId?null:"table";n.props.fetchTable(i,e,"",m).then(function(e){n.fetchStackData(i),n.setState({loading:!1,fetching:!1})}).catch(function(e){qo.log(":: 0 e",e),n.setState({loading:!1,fetching:!1,notfound:!0})})}}).catch(function(e){qo.log(":: 2 e",e),n.setState({loading:!1,fetching:!1,notfound:!0}),m.oR.error("Error changing table",jn)})}},{key:"changeFieldType",value:function(e,t,o,n,a){var i,r,s,l,c,d,u,p,h=this.props,m=h.table,v=(h.auth,m||{}),f=v.viewsData,b=v.lastViewId,y=(f&&f.find(function(e){return e.viewId===b}),(Array.isArray(null===(i=this.props)||void 0===i||null===(i=i.table)||void 0===i?void 0:i.columnSchema)?null===(r=this.props)||void 0===r||null===(r=r.table)||void 0===r?void 0:r.columnSchema:[]).find(function(e){return e.columnId===t}));!["text","select","date","link","apiDataDate","multiCollaborator","ai","multiSelect","email","rating","multilineText"].includes(y.type)&&!["text","select","date","link","apiDataDate","multiCollaborator","ai","multiSelect","email","rating","multilineText"].includes(e)||["rollup"].includes(e)?null===(s=this.props)||void 0===s||null===(l=s.updateColumnConfig)||void 0===l||l.call(s,this.state.stackId,e,t,o,n,a,null===(c=this.props)||void 0===c?void 0:c.table):null===(d=this.props)||void 0===d||null===(u=d.modifyColumnConfig)||void 0===u||u.call(d,this.state.stackId,e,t,o,n,a,null===(p=this.props)||void 0===p?void 0:p.table)}},{key:"rowHeightUpdate",value:function(e){var t,o;this.setState({showHeightModel:!1});var n={height:e,viewId:this.props.table.lastViewId};null===(t=this.props)||void 0===t||null===(o=t.updateRowHeight)||void 0===o||o.call(t,this.state.stackId,n).catch(function(e){m.oR.error("Error Updating Row Height",jn)})}},{key:"fetchStackData",value:(u=nn(en().m(function e(t){var o,n,a,i,r,s,l,c,d,u,p,h,m,v,f,b,y,g,w,S,C,I,x,A,j,T,O,D,R,N,E,M,P,L,B,_,V,F,U,W,H,G,z,J,K,q,Y,Q,$,X,Z,ee,te=this;return en().w(function(e){for(;;)switch(e.n){case 0:o=this.props,n=o.table,a=o.auth,r=(i=n||{}).rowData,s=void 0===r?[]:r,l=i.viewsData,c=i.lastViewId,d=i.isSeen,u=void 0===d?1:d,p=i.trialPeriodExpire,h=i.stackUsers,m=void 0===h?[]:h,v=i.workspaceUsers,f=void 0===v?[]:v,i.workspaceId,b=i.plan,y=i.stackName,g=i.columnSchema,w=void 0===g?[]:g,this.state.rowHeightList,S=(b||{}
2).name,C=void 0===S?"":S;try{x=l&&l.find(function(e){return e.viewId===c}),A=(x||{}).groupLevels,j=void 0===A?null:A,T="",D="",R=this.state.startRange,N=s.length>100?100:s.length,(0,k.Io)(a,"User are on stack page",{$first_name:a.firstName,$last_name:a.lastName,StackID:null===(I=this.props)||void 0===I||null===(I=I.match)||void 0===I?void 0:I.params.stackId,StackName:y,PlanType:C}),j&&["grid","list"].includes(x.type)&&(0,ge.kT)($o($o({},null===(E=this.props)||void 0===E?void 0:E.table),{},{currentUserId:null==a?void 0:a.id}),!0).then(function(e){var t;return(0,jo.LF)(null===(t=te.props)||void 0===t?void 0:t.table,(e||[]).filter(function(e){return e}))}).then(function(e){var t,o,n,a,i,r=e.groupByRowData;if(!r||!r.length)return te.setState({rowData:[]}),void(null===(a=te.props)||void 0===a||null===(i=a.updateGroupByRowData)||void 0===i||i.call(a,{groupByRowData:r||[],filteredRowData:[],viewId:c}));var s=(t=[]).concat.apply(t,Xo((Array.isArray(r)?r:[]).map(function(e){return e.rowIdsPerGroup}))).map(function(e){var t;return null===(t=te.props)||void 0===t||null===(t=t.table)||void 0===t?void 0:t.rowData[e]});te.setState({rowData:s.filter(function(e){return e})}),e.filteredRowData=s.filter(function(e){return e}),e.viewId=c,null===(o=te.props)||void 0===o||null===(n=o.updateGroupByRowData)||void 0===n||n.call(o,e||[])}).catch(function(e){qo.log("eee",e)}),j&&(M=JSON.parse(j)[0]||{},P=M.columnId,T=void 0===P?"":P,L=JSON.parse(j)[0]||{},B=L.startRangeColumnId,_=void 0===B?"":B,V=L.endRangeColumnId,O=_,D=void 0===V?"":V,(F=JSON.parse(j)[1])&&(R=F.rowStartRange,N=F.rowEndRange)),U=f.find(function(e){return e.id===a.id})||m.find(function(e){return e.id===a.id})||{},W=U.accessType,H=void 0===W?0:W,U.isSharingEnable,p&&(H=0);try{x&&(G=x.viewUsers.find(function(e){return e.id===a.id}))&&(H=G.accessType)}catch(e){}z=x&&x.metadata?JSON.parse(x.metadata):{},J=z.coverImageGalleryColumnId,K=void 0===J?"no-cover-image":J,q=z.coverImageColumnId,Y=void 0===q?"no-cover-image":q,Q=z.footerSelectorColumnId,$=void 0===Q?"no-footer-collaborators":Q,X=z.showColumnNamesInCards,Z=void 0===X||X,ee=Rn({accessType:H,table:n,auth:a,selectedView:x}),0==u&&this.setState({stackSidebarOpen:!0}),this.setState({viewSelectedColumnId:T,startRangeColumnId:O,endRangeColumnId:D,showColumnNamesInCards:Z,cardCoverImageColumnId:Y,cardCoverGalleryImageColumnId:Nn(K,w),cardFooterSelectorColumnId:$,startRange:R,endRange:N,searchArray:[],searchArrayIndex:-1,searchValue:"",tablePermissionData:ee})}catch(e){qo.log(e,"e"),this.setState({searchArray:[],searchArrayIndex:0,searchValue:""})}case 1:return e.a(2)}},e,this)})),function(e){return u.apply(this,arguments)})},{key:"updateMetadata",value:function(e,t,o){var n,a,i=this.props.table,r=i.viewsData,s=void 0===r?[]:r,l=i.lastViewId,c=i.lastTableId,d=this.state,u=d.showColumnNamesInCards,p=d.cardCoverImageColumnId,h=d.cardFooterSelectorColumnId,m=d.cardCoverGalleryImageColumnId,v=s.find(function(e){return e.viewId===l}),f=v.type,b=v.metadata,y={tableId:c,viewId:l};if("grid"===f){var g=b&&JSON.parse(b);g&&g.grid?"update"===o?Object.assign(g.grid.summaryBarConfigsByColumnId,dn({},e,{aggregationFunction:t})):"delete"===o&&delete g.grid.summaryBarConfigsByColumnId[e]:g?g.grid={summaryBarConfigsByColumnId:dn({},e,{aggregationFunction:t})}:g={grid:{summaryBarConfigsByColumnId:dn({},e,{aggregationFunction:t})}},g=JSON.stringify(g),y.metadata=g}else"kanban"===f?y.metadata=JSON.stringify({showColumnNamesInCards:u,coverImageColumnId:p||"no-cover-image",footerSelectorColumnId:h||"no-footer-collaborators"}):"gallery"===f&&(y.metadata=JSON.stringify({showColumnNamesInCards:u,coverImageGalleryColumnId:m||"no-cover-image"}));null===(n=this.props)||void 0===n||null===(a=n.viewMetadataUpdate)||void 0===a||a.call(n,this.state.stackId,y)}},{key:"handleShowColumnNamesInCards",value:function(e,t){var o=this;this.setState({showColumnNamesInCards:!this.state.showColumnNamesInCards},function(){return o.updateMetadata()})}},{key:"handleshowColumnSelectModel",value:function(){this.setState({showColumnSelectModel:!1,searchArray:[],searchArrayIndex:-1,searchValue:""})}},{key:"setCardCoverImageColumnId",value:function(e,t){var o=this;this.setState({cardCoverImageColumnId:t.value},function(){return o.updateMetadata()})}},{key:"setCardCoverGalleryImageColumnId",value:function(e,t){var o=this;this.setState({cardCoverGalleryImageColumnId:t.value},function(){return o.updateMetadata()})}},{key:"setCardFooterSelectorColumnId",value:function(e,t){var o=this;this.setState({cardFooterSelectorColumnId:t.value},function(){return o.updateMetadata()})}},{key:"updateGroupLevel",value:function(e,t){var o=this.props.table,a=(Array.isArray(null==o?void 0:o.viewsData)?null==o?void 0:o.viewsData:[]).find(function(e){return e.viewId===o.lastViewId}).groupLevels,i=void 0===a?"[{}]":a,r={rowStartRange:e,rowEndRange:t};(i=JSON.parse(i))[1]=r;var s={tableId:o.lastTableId,viewId:o.lastViewId,groupLevels:JSON.stringify(i)};n.A.post("/api/v1/viewaction/"+this.state.stackId+"/updategroup",s).then(function(e){}).catch(function(e){m.oR.error("Error updating FieldType",{position:"bottom-left",autoClose:!0,closeButton:!1})})}},{key:"setKanbanRowRange",value:function(e,t){var o=this;this.setState({startRange:e,endRange:t,showChangeRowDataSize:!1},function(){o.updateGroupLevel(e,t)})}},{key:"_showCustomizedCardsModel",value:function(e){var t=this.props,o=t.table,n=t.auth,i=this.state,r=i.viewSelectedColumnId,s=i.showColumnNamesInCards,l=i.cardCoverImageColumnId,c=i.cardFooterSelectorColumnId,d=i.isLock,u=i.isPersonalView,p=(0,a.find)((null==o?void 0:o.viewsData)||[],{viewId:o.lastViewId});return(0,L.jsx)(be.A,{viewData:p,columnSchema:o.columnSchema,stackId:this.state.stackId,viewSelectedColumnId:r,showColumnNamesInCards:s,cardCoverImageColumnId:l,cardFooterSelectorColumnId:c,handleShowColumnNamesInCards:this.handleShowColumnNamesInCards,setCardCoverImageColumnId:this.setCardCoverImageColumnId,setCardFooterSelectorColumnId:this.setCardFooterSelectorColumnId,isLock:d,accessType:e,isPersonalView:u,auth:n})}},{key:"_showCustomizedGalleryCardsModel",value:function(e){var t=this.props.table,o=this.state,n=o.viewSelectedColumnId,i=o.showColumnNamesInCards,r=o.cardCoverGalleryImageColumnId,s=o.cardFooterSelectorColumnId,l=o.isLock,c=o.isPersonalView,d=(0,a.find)((null==t?void 0:t.viewsData)||[],{viewId:t.lastViewId});return(0,L.jsx)(Mt,{viewData:d,columnSchema:t.columnSchema,stackId:this.state.stackId,viewSelectedColumnId:n,showColumnNamesInCards:i,cardCoverGalleryImageColumnId:r,cardFooterSelectorColumnId:s,handleShowColumnNamesInCards:this.handleShowColumnNamesInCards,setCardCoverGalleryImageColumnId:this.setCardCoverGalleryImageColumnId,setCardFooterSelectorColumnId:this.setCardFooterSelectorColumnId,isLock:l,accessType:e,isPersonalView:c})}},{key:"handleSearchChange",value:function(e,t){var o=this,n=this.props.table,a=n.columnSchema,i=n.stackUsers;if(this.setState({searchLoading:!0,searchValue:t}),Re.Fr&&"grid"===this.state.selectedView.type)if(null==t||""==t||null==t){var r;this.setState({rowData:null===(r=this.props)||void 0===r||null===(r=r.table)||void 0===r?void 0:r.rowData})}else{var s,l=Ro(null===(s=this.props)||void 0===s||null===(s=s.table)||void 0===s?void 0:s.rowData,a,i,t).rowData;this.setState({rowData:l})}else(0,we.A)(e,a,i,t,this.state.selectedView.type).then(function(e){var t=e.searchArray;o.setState({searchArray:t,searchArrayIndex:-1,searchLoading:!1}),t.length>0&&o.onClickSearchButton("down")})}},{key:"onClickSearchButton",value:function(e){var t=this.state,o=t.searchArrayIndex,n=t.searchArray.length-1;"up"==e?o-=1:o+=1,o>n?o=0:-1==o&&(o=n),this.setState({searchArrayIndex:o})}},{key:"incEndRangeForAddRecordInKanban",value:function(){var e=this,t=this.state,o=t.startRange,n=t.endRange,a=0;n-o<100&&(a=Number(n)+1,this.setState({endRange:a},function(){return e.setKanbanRowRange(o,a)}))}},{key:"handleJoyrideCallback",value:function(e){this.props.joyride,this.state.eventIndex;var t=e.type,o=e.action,n=e.index,a=e.lifecycle;e.status,t===I.qY.TOUR_END&&this.state.run&&this.setState({run:!1}),"complete"===a&&"next"===o?this.setState({eventIndex:n+1,status:a}):"complete"===a&&"prev"===o&&this.setState({eventIndex:n-1})}},{key:"takeTour",value:function(){this.setState({run:!0})}},{key:"handleTourPermission",value:function(){var e=this;return(0,L.jsx)("div",{className:"model-wrapper tour-wrapper",children:(0,L.jsxs)("div",{className:"model tourModal",ref:this.setWrapperRef,children:[(0,L.jsx)("h2",{children:"Continue the tour"}),(0,L.jsx)("div",{className:"field-box",children:(0,L.jsx)("p",{children:"Please click on Go Ahead to learn how to navigate inside your stack."})}),(0,L.jsxs)("div",{className:"tourModal-footer",children:[(0,L.jsx)(v.A,{size:"mini",className:"btn-blue continue-tour",onClick:function(){e.setState({takeTour:!1,run:!0})},children:"Go Ahead"}),(0,L.jsx)(v.A,{size:"mini",className:"continue-tour cancel",onClick:function(){return e.setState({takeTour:!1,run:!1})},children:"Cancel"})]})]})})}},{key:"addRows",value:function(e){var t,o,n,i,r,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal",l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=this.props,d=c.table,u=d.columnSchema,p=void 0===u?[]:u,h=d.workspaceUsers,m=void 0===h?[]:h,v=d.stackUsers,f=c.auth,b=m.find(function(e){return e.id===f.id})||v.find(function(e){return e.id===f.id})||{},y=b.accessType,g=void 0===y?0:y,w=(b.isSharingEnable,this.state.rowData),S=[];if(l){var C=w[e-1];C=(0,a.omit)(C,["id","rowId","commentId","createdAt","isVisible","isConfigure","rowActionId","sequence","updatedAt","totalItems","completedItems","dueDateTimestamp","checklistId","remainderId","favourite","visibility"]),S.push(C)}else S=(Array.isArray(p)?p:[]).map(function(e){return e.defaultValue?dn({},e.columnId,e.defaultValue):"autoNumber"===e.type?dn({},e.columnId,Number(w[w.length-1][e.columnId])+1):null});[1,2].includes(g)&&(null===(n=this.props)||void 0===n||null===(i=n.createRow)||void 0===i||i.call(n,this.state.stackId,S,e,null===(r=this.props)||void 0===r?void 0:r.table,s)),(0,k.Io)(null===(t=this.props)||void 0===t?void 0:t.auth,"User row action",{action_type:l?"Row Duplicated":"New row added",table_id:null===(o=this.props)||void 0===o||null===(o=o.table)||void 0===o?void 0:o.lastTableId,stack_id:this.state.stackId})}},{key:"deleteRows",value:function(e,t){var o=this,n=this.state.stackId;this.props.deleteRow(n,e,t).then(function(){var e,a,i,r;x.N.identify(null===(e=o.props)||void 0===e||null===(e=e.auth)||void 0===e?void 0:e.id),x.N.track("Row deleted by user"),x.N.people.set({$first_name:null===(a=o.props)||void 0===a||null===(a=a.auth)||void 0===a?void 0:a.firstName,$last_name:null===(i=o.props)||void 0===i||null===(i=i.auth)||void 0===i?void 0:i.lastName}),(0,k.Io)(null===(r=o.props)||void 0===r?void 0:r.auth,"User row action",{action_type:"row removed",table_id:t,stack_id:n})}).catch(function(e){m.oR.error("Error deleting row",jn)})}},{key:"showDashboard",value:function(){this.props.dashboard,this.state.stackId,localStorage.setItem("isShowCustomDashboard",!this.state.isShowCustomDashboard),this.setState({isShowCustomDashboard:!this.state.isShowCustomDashboard,resumeBlock:!1,showBlockModal:!1,blockType:null,selectedBlockId:null})}},{key:"showDashboardForButtonColumnClick",value:function(e,t,o,n){var a,i;localStorage.setItem("isShowCustomDashboard",!0),this.setState({isShowCustomDashboard:!0,resumeBlock:!1,showBlockModal:!1,blockType:null,selectedBlockId:null,
2selectedRow:e,selectButtonBlockId:t,selectedBlockType:o}),""!==o&&(this.handleBlockModal(o,"expand",t),null===(a=this.props)||void 0===a||null===(i=a.showViewSectionAction)||void 0===i||i.call(a,!1))}},{key:"handleStackSidebar",value:function(){var e=this.state.stackSidebarOpen;this.setState({stackSidebarOpen:!e})}},{key:"openGettingStartedSidebar",value:function(){var e=this,t=this.state.stackSidebarOpen;this.setState({stackSidebarOpen:!t,isHelpSliderOpen:!1},function(){setTimeout(function(){e.setState({isHelpSliderOpen:null})},500)})}},{key:"handleHelpSearchChange",value:function(e){var t=[],o=[],n=[],a=[];if(e.trim().toLowerCase())for(var i in this.state.HelpSliderData){var r,s,l,c,d,u,p,h;(Array.isArray(null===(r=this.state)||void 0===r||null===(r=r.HelpSliderData)||void 0===r||null===(r=r[i])||void 0===r?void 0:r.quickTips)?null===(s=this.state)||void 0===s||null===(s=s.HelpSliderData)||void 0===s||null===(s=s[i])||void 0===s?void 0:s.quickTips:[]).map(function(o){var n=!1;o.imageUrl.toLowerCase().includes(e.toLowerCase())&&(n=!0),o.name.toLowerCase().includes(e.toLowerCase())&&(n=!0),n&&t.push(o)}),(Array.isArray(null===(l=this.state)||void 0===l||null===(l=l.HelpSliderData)||void 0===l||null===(l=l[i])||void 0===l?void 0:l.tutorials)?null===(c=this.state)||void 0===c||null===(c=c.HelpSliderData)||void 0===c||null===(c=c[i])||void 0===c?void 0:c.tutorials:[]).map(function(t){var n=!1;t.imageUrl.toLowerCase().includes(e.toLowerCase())&&(n=!0),t.name.toLowerCase().includes(e.toLowerCase())&&(n=!0),n&&o.push(t)}),(Array.isArray(null===(d=this.state)||void 0===d||null===(d=d.HelpSliderData)||void 0===d||null===(d=d[i])||void 0===d?void 0:d.videos)?null===(u=this.state)||void 0===u||null===(u=u.HelpSliderData)||void 0===u||null===(u=u[i])||void 0===u?void 0:u.videos:[]).map(function(t){var o=!1;t.imageUrl.toLowerCase().includes(e.toLowerCase())&&(o=!0),t.name.toLowerCase().includes(e.toLowerCase())&&(o=!0),o&&n.push(t)}),(Array.isArray(null===(p=this.state)||void 0===p||null===(p=p.HelpSliderData)||void 0===p||null===(p=p[i])||void 0===p?void 0:p.supportArticles)?null===(h=this.state)||void 0===h||null===(h=h.HelpSliderData)||void 0===h||null===(h=h[i])||void 0===h?void 0:h.supportArticles:[]).map(function(t){var o=!1;t.url.toLowerCase().includes(e.toLowerCase())&&(o=!0),t.name.toLowerCase().includes(e.toLowerCase())&&(o=!0),o&&a.push(t)})}this.setState({searchedQuickTips:t,searchedTutorials:o,searchedVideos:n,searchedSupportArticles:a})}},{key:"getDataAsPerSection",value:function(e){this.setState({quickTips:this.state.HelpSliderData[e].quickTips,tutorials:this.state.HelpSliderData[e].tutorials,videos:this.state.HelpSliderData[e].videos,supportArticles:this.state.HelpSliderData[e].supportArticles})}},{key:"openKeyboardShortcutsModal",value:function(){this.setState({isViewKeyboardShortcuts:!this.state.isViewKeyboardShortcuts})}},{key:"handleShowContactSalesMenu",value:function(){this.setState({showContactSalesMenu:!0})}},{key:"handleShowReportBugMenu",value:function(){this.setState({showReportBugMenu:!0})}},{key:"handleExpandDashboard",value:function(e){var t=localStorage.getItem("blockOuterWidth"),o=e?this.state.blockWidth:t&&parseFloat(t)>39?"35%":t||"25%";this.setState({IsExpandedDashboard:e,blockWidth:o})}},{key:"setWrapperRef",value:function(e){this.wrapperRef=e}},{key:"handleClickOutside",value:function(e){this.wrapperRef&&!this.wrapperRef.contains(e.target)&&this.setState({showDashboardList:!1,searchValueFocusFlag:!1,showColumnSelectModel:!1,showContactSalesMenu:!1}),this.setState({searchValueFocusFlag:!1})}},{key:"handleChartClick",value:function(e){var t=e||null;this.setState({isAddChart:!this.state.isAddChart,selectedBlockId:t})}},{key:"handlePivotClick",value:function(e){var t=e||null;this.setState({isAddPivot:!this.state.isAddPivot,selectedBlockId:t})}},{key:"handleSummaryClick",value:function(e){var t=e||null;this.setState({isAddSummary:!this.state.isAddSummary,selectedBlockId:t})}},{key:"handleRowlistClick",value:function(e){var t=e||null;this.setState({isAddRowlist:!this.state.isAddRowlist,selectedBlockId:t})}},{key:"handleRedirectToaccount",value:function(){var e,t=this.props.table.workspaceId;null===(e=this.props)||void 0===e||null===(e=e.history)||void 0===e||e.push("/account/workspace/"+t)}},{key:"onBreakpointChange",value:function(e){this.setState({currentBreakpoint:e})}},{key:"hideTutorial",value:function(){this.setState({isShowTutorial:!1})}},{key:"_renderFindStackModel",value:function(){var e,t=this;return(0,L.jsx)("div",{children:(0,L.jsx)(Qt,{history:null===(e=this.props)||void 0===e?void 0:e.history,close:function(){return t.setState({findStackModelOpen:!t.state.findStackModelOpen})}
2,style:{top:"5%",width:"45%",left:"50vh"}})})}},{key:"fetchDashboardList",value:function(e){var t=this,o=this.props.fetchDashboardList;this.setState({dashboardLoading:!0}),o(e).then(function(e){setTimeout(function(){var e,o,n,a,i;null!==(e=t.props)&&void 0!==e&&e.table&&null!==(o=t.props)&&void 0!==o&&null!==(o=o.table)&&void 0!==o&&o.plan&&null!==(n=t.props)&&void 0!==n&&null!==(n=n.table)&&void 0!==n&&n.plan.noOfBlockCreate&&(null===(a=t.props)||void 0===a||null===(a=a.dashboard)||void 0===a?void 0:a.blocks.length)>=1*(null===(i=t.props)||void 0===i||null===(i=i.table)||void 0===i?void 0:i.plan.noOfBlockCreate)&&t.setState({blockLimitReachedButton:!0})},500)}).catch(function(e){return qo.log(e)})}},{key:"handleBlockModal",value:function(e,t,o){var a=this.props,i=(a.fetchTableForDashboard,a.table.tableList,this.props.dashboard,this.state),r=(i.blocks,i.isModal,i.stackId,i.showConfig),s=o||null,l=e||null;if(s){var c={showConfig:!r,action:"showConfig"};if("settings"===t)this.setState({expandBlock:"expand-block",showConfig:!r});else if("expand"===t)this.setState({expandBlock:"expand-block",showConfig:!0,selectedBlockId:s,blockType:l,isShowCustomDashboard:!0,showBlockModal:!0}),c={isOpen:!0,action:"blockStatus",blockid:s};else if("close"===t){isFlag=!1,c={isOpen:!1,action:"blockStatus",blockid:s};var d={action:"SETTING_OPEN",flag:"false",blockId:s};n.A.post("https://stackby.com/api/v1/blockactivity/"+s,d),this.setState({expandBlock:"expand-block",showConfig:!1,selectedBlockId:r?null:s})}document.getElementById(s)&&document.getElementById(s).contentWindow.postMessage(JSON.stringify(c),"*")}}},{key:"handleSaveBlock",value:function(e,t){var o,n=this,a=this.props,i=a.dashboard,s=a.createBlock,l=(a.updateBlock,a.auth,this.state),c=l.stackId,d=l.isModal,u=l.blocks,p=null===(o=this.props)||void 0===o||null===(o=o.dashboard)||void 0===o?void 0:o.lastDashboard,h=t||"Block-".concat(i.blocks.length+1),v="bl"+r().generate(16),f=(u&&u.length?u.length:0)%3,b=2*f,y=6*f,g={i:"".concat(v),x:0,y:u&&u.length?u.length:0,w:1,h:3,minH:1,minW:1,moved:!1,static:!1},w={i:"".concat(v),x:b,y,w:2,h:4,minH:1,minW:1},k={stackId:c,dashboardId:p,name:h,blockFields:JSON.stringify(e),gridLayout:JSON.stringify(w),linearLayout:JSON.stringify(g),type:t};s(v,k).then(function(e){n.setState({selectedBlockId:v}),n.handleBlockModal(t,"expand",v)}).catch(function(e){503===e.response.status&&m.oR.error("Limit exceeded for creating Block reached",jn),qo.log(e.response)}),d&&this.setState({isModal:!1})}},{key:"createDashboard",value:(c=nn(en().m(function e(t){var o,n,a,i,r,s;return en().w(function(e){for(;;)switch(e.n){case 0:return o=this.props,n=o.dashboard,a=o.createDashboard,i=o.auth,r="Dashboard ".concat(n.dashboardList.length+1),s={stackId:t,name:r},e.n=1,a(s).then(function(e){return(0,k.Io)(i,"User perform create dashboard"),e}).catch(function(e){return 503===e.response.status&&m.oR.error("Limit exceeded for creating Dashboard reached",jn),e});case 1:return e.a(2)}},e,this)})),function(e){return c.apply(this,arguments)})},{key:"handleExploreBlock",value:function(e){var t,o,n,a=this,i=this.state,r=i.stackId,s=(i.showUpgradeButton,i.tableId),l=i.viewId;(null===(t=this.props)||void 0===t?void 0:t.table).workspaceId,null!==(o=this.props)&&void 0!==o&&o.dashboard&&0===(null===(n=this.props)||void 0===n||null===(n=n.dashboard)||void 0===n?void 0:n.dashboardList.length)?this.createDashboard(r).then(function(){a.setState({addMoreModal:!1,buttonClickToOpenAppsModal:!1,isShowCustomDashboard:!0}),a.handleSaveBlock({tableId:s,viewId:l},e)}):(this.setState({addMoreModal:!1,buttonClickToOpenAppsModal:!1,isShowCustomDashboard:!0}),this.handleSaveBlock({tableId:s,viewId:l},e))}},{key:"openRespectiveMenu",value:function(e){switch(e.key){case"Create new table":this.setState({createNewTableThroughShortcut:!0,addMoreModal:!1});break;case"Import from CSV":this.setState({addMoreModal:!1,openImportSpreadsheetModel:!0,openRespectiveModalText:"importCsv"});break;case"Import from Google Sheet":this.setState({addMoreModal:!1,openImportSpreadsheetModel:!0,openRespectiveModalText:"acountSelection"});break;case"Import from Excel":this.setState({addMoreModal:!1,openImportSpreadsheetModel:!0,openRespectiveModalText:"importExcel"});break;case"Paste Table Data":this.setState({addMoreModal:!1,openImportSpreadsheetModel:!0,openRespectiveModalText:"importPasteData"})}}},{key:"handleWindowClose",value:function(e){var t,o,n;null===(t=this.props)||void 0===t||null===(o=t.leaveToSocketRoom)||void 0===o||o.call(t,null===(n=this.props)||void 0===n||null===(n=n.match)||void 0===n?void 0:n.params.stackId)}},{key:"showAddMoreButton",value:function(e){this.setState({showAddMoreButton:e})}},{key:"handleInactivity",value:function(){var e=this,t=setInterval(function(){var o=localStorage.getItem("lastActvity"),n=o?Math.abs(new Date(o)-new Date):0,a=o?Math.floor(n/1e3):0;15==(o?Math.floor(a/60):0)&&(e.setState({connectionserverModal:!0}),qo.log(":: No activity from last 15 minutes..."),clearInterval(t))},1e3)}},{key:"onlineHandler",value:function(){this.setState({connectionserverModal:!1})}},{key:"offlineHandler",value:function(){this.setState({connectionserverModal:!0},function(){localStorage.removeItem("userIPAddress")})}},{key:"openCloseHelpSlider",value:function(){var e=this;this.setState({isHelpSliderOpen:!this.state.isHelpSliderOpen},function(){0==e.state.isHelpSliderOpen&&setTimeout(function(){e.setState({isHelpSliderOpen:null})},500)})}},{key:"openHelpSlider",value:function(){this.setState({isHelpSliderOpen:!0})}},{key:"closeHelpSlider",value:function(){var e=this;!0===this.state.isHelpSliderOpen&&this.setState({isHelpSliderOpen:!1},function(){setTimeout(function(){e.setState({isHelpSliderOpen:null})},500)})}},{key:"handleImportLoader",value:function(e){this.setState({importLoading:e})}},{key:"handleAutomation",value:function(e){this.setState({isAutomation:e})}},{key:"applyChecklistToAllRows",value:function(e,t){var o=this,n=this.state,a=n.stackId,i=(n.rowId,n.tableId);this.setState({loading:!0,applyChecklistApiError:"",applyLoader:!0}),this.props.applyChecklistToAllRows(a,i,e,t).then(function(e){var t=e.data;qo.log(t),t?o.setState({applyChecklistToAllRowsModal:!1,loading:!1,applyLoader:!1},function(){m.oR.success("Checklist Successfully applied to all rows",{position:"bottom-left",autoClose:!0,closeButton:!1})}):o.setState({applyChecklistApiError:"Something went wrong! Please try again",loading:!1,applyLoader:!1})}).catch(function(e){return o.setState({applyChecklistApiError:"Something went wrong",loading:!1,applyLoader:!1})})}}
2,{key:"openExpandChecklistModal",value:function(){}},{key:"render",value:function(){var e,t,o,n,i,r,s,l,c,d,u,p,h,v,w,k,A=this,j=this.props,T=j.auth,O=j.table,D=j.dashboard,R=O.color,N=!1,E=O.stackUsers,M=void 0===E?[]:E,P=O.workspaceUsers,B=void 0===P?[]:P,_=O.trialPeriodExpire,V=O.plan,F=O.stackName,U=O.addInviteMemberModelData,W=void 0===U?null:U,H=O.addUserByEmailModelData,G=void 0===H?null:H,z=O.allStackList,J=O.isShowViewSection,K=O.totalStackRowCount,q=void 0===K?0:K,Y=O.extraRows,Q=void 0===Y?0:Y,$=this.state,X=$.cooltip,Z=$.stackId,ee=$.tableId,te=($.loading,$.importLoading),oe=$.fetching,ne=$.showChangeRowDataSize,ae=$.showCustomizedCardsModel,ie=$.searchArray,re=$.searchArrayIndex,se=$.showColumnSelectModel,le=$.showColumnNamesInCards,ce=$.cardCoverImageColumnId,de=$.cardFooterSelectorColumnId,ue=$.searchValue,pe=$.startRange,he=$.endRange,me=$.viewSelectedColumnId,ve=$.rowData,be=$.columnSchema,ye=$.expandView,ge=$.run,we=$.eventIndex,Ie=$.status,xe=$.takeTour,Ae=$.blockWidth,je=$.selectedView,Te=$.IsExpandedDashboard,Oe=$.searchLoading,De=void 0!==Oe&&Oe,Ne=$.isShowCustomDashboard,Ee=($.persent,$.isShowTutorial,$.cardCoverGalleryImageColumnId),Me=$.searchValueFocusFlag,Pe=$.isAutomationConfig,Le=$.isLock,Be=$.colorCondition,_e=$.createdAppBlockId,Ve=($.frozonColumn,$.isPersonalView),Fe=$.isUserPersonalView,Ue=$.findStackModelOpen,We=$.stackSidebarOpen,He=$.onlineUsers,Ge=$.isViewKeyboardShortcuts,ze=$.isOpenTableSwitcher,Je=$.showPrintView,Ke=$.rowNotFounfModal,Ye=$.addMoreModal,Qe=$.showAddMoreButton,$e=$.connectionserverModal,Xe=$.tablePermissionData,Ze=$.errorMessage,et=$.showContactSalesMenu,tt=$.showReportBugMenu,ot=$.copyLinkToCellOrRecordOrigin,nt=$.viewSectionWidth,at=$.applyChecklistToAllRowsModal,it=$.applyLoader,rt=$.applyChecklistApiError,st=$.isAutomation,lt=$.type,ct=$.isOpenShareModel,dt=$.colorSelectedColumnId,ht=$.colorType,mt=$.selectedRow,vt=$.buttonClickToOpenAppsModal,ft=$.selectButtonBlockId,bt=($.isAppExpanded,$.selectedBlockType,$.festiFlag),yt=$.isHideLeftSide,gt=M.find(function(e){return e.id===T.id})||B.find(function(e){return e.id===T.id})||{},wt=gt.accessType,kt=void 0===wt?0:wt,St=gt.isSharingEnable,Ct=void 0===St?1:St;_&&(kt=0);var It=!1;try{if(je){var xt=je.viewUsers.find(function(e){return e.id===T.id});xt&&(kt=xt.accessType,It=!0)}}catch(e){}document.title=F?F+" - Stackby":"Stackby";var At=this.state.isExperimental;V&&Number(V.noOfRowCreate)+Number(Q)<=q&&(kt=5,N=!0);var jt=z&&z[Z]&&z[Z].color,Tt=jt&&y.paidColorStack.includes(jt)?"black":"white";return null!==(e=this.props)&&void 0!==e&&null!==(e=e.params)&&void 0!==e&&e.tableId||this.state.initialRouteResolved?(0,L.jsx)(C.A,{userInitial:(null==T||null===(t=T.user)||void 0===t||null===(t=t.name)||void 0===t||null===(t=t.charAt(0))||void 0===t?void 0:t.toUpperCase())||"M",stackId:Z,workspaceId:null===(o=this.props.table)||void 0===o?void 0:o.workspaceId,tableId:null===(n=this.props.match)||void 0===n||null===(n=n.params)||void 0===n?void 0:n.tableId,viewId:null===(i=this.state.selectedView)||void 0===i?void 0:i.viewId,onTableChange:function(e){return A.changeLastTable(e)},isHelpSliderOpen:!0===this.state.isHelpSliderOpen,onOpenHelpSlider:this.openHelpSlider,onCloseHelpSlider:this.closeHelpSlider,tableColor:jt,openConversationalAI:this.state.openConversationalAI,initialPrompt:this.state.initialPrompt,isCreateFlow:this.state.isCreateFlow,userSettings:this.state.userSettings,userEmail:null==T?void 0:T.email,children:(0,L.jsxs)("div",{children:[z&&z[Z]&&(0,L.jsx)("div",{id:"head",className:"colored-background","data-color":"white",children:(0,L.jsx)(pn,{isViewUser:It,isViewKeyboardShortcuts:Ge,accessType:kt,isSharingEnable:Ct,Mixpanel:x.N,history:null===(r=this.props)||void 0===r?void 0:r.history,takeTour:this.takeTour,showDashboard:this.showDashboard,stackId:Z,onlineUsers:He,openStackSidebar:this.handleStackSidebar,rowData:ve,stackDetail:z&&z[Z],connectionserverModal:$e,openCloseHelpSlider:this.openCloseHelpSlider,showContactSalesMenu:et,handleShowContactSalesMenu:function(){return A.setState({showContactSalesMenu:!1})},showReportBugMenu:tt,dashboard:D,hideReportBugMenu:function(){return A.
2setState({showReportBugMenu:!1})},isAutomation:st,handleAutomation:this.handleAutomation,isAddStackViewModelOpen:ct,type:lt})}),!0===st&&(0,L.jsx)(mn,{stackId:Z,history:null===(s=this.props)||void 0===s?void 0:s.history,accessType:kt}),!1===st&&z&&z[Z]&&(0,L.jsx)(hn,{isOpenTableSwitcher:ze,isViewUser:It,openAutomation:function(){return A.setState({isAutomationConfig:!0})},stackId:Z,tableIdInUrlPath:null===(l=this.props)||void 0===l||null===(l=l.match)||void 0===l?void 0:l.params.tableId,accessType:kt,changeLastTable:this.changeLastTable,Mixpanel:x.N,eventIndex:we,status:Ie,history:null===(c=this.props)||void 0===c?void 0:c.history,isShowCustomDashboardOpen:function(){A.setState({isShowCustomDashboard:!Ne,IsExpandedDashboard:!1,showBlockModal:!1,blockType:null,selectedBlockId:null}),A.showDashboard()},createNewTableThroughShortcut:this.state.createNewTableThroughShortcut,createNewTableThroughShortcutClose:function(){return A.setState({createNewTableThroughShortcut:!1})},openImportSpreadsheetModel:this.state.openImportSpreadsheetModel,openRespectiveModalText:this.state.openRespectiveModalText,resetImportSpreadsheet:function(){return A.setState({openImportSpreadsheetModel:!1,openRespectiveModalText:"default"})},backToParent:function(){return A.setState({addMoreModal:!0,activeTabIndex:1,openImportSpreadsheetModel:!1,openRespectiveModalText:"default"})},connectionserverModal:$e,handleImportLoader:this.handleImportLoader,isAccessTypeChangeDueToExceedPlanLimit:N,isAppExpanded:this.state.isAppExpanded,isShowCustomDashboard:Ne,IsExpandedDashboard:Te,blockOuterWidth:this.state.blockWidth,changeFieldType:this.changeFieldType}),!1===st&&te||!ve?(0,L.jsxs)("div",{style:{display:"flex",alignItems:"center",height:"100vh",justifyContent:"center",flexDirection:"column"},children:[(0,L.jsx)("img",{src:Se,width:"50px"}),(0,L.jsxs)("p",{style:{marginTop:"5px",fontSize:"14px",color:"black",display:"inline-block",overflow:"hidden",whiteSpace:"nowrap"},children:["Cool Tip: ",X," "]})]}):!1===st&&!this.state.notfound&&(0,L.jsxs)("div",{id:"dashboard",className:"flex align-center ".concat($e?"connection-model":""),children:[(0,L.jsx)(I.Ay,{continuous:!0,scrollToFirstStep:!0,showProgress:!0,showSkipButton:!0,disableOverlayClose:!0,run:ge,steps:Tn,stepIndex:we,styles:{options:{zIndex:1e4,textAlign:"left"}},callback:this.handleJoyrideCallback}),(0,L.jsx)("div",{style:{width:"100%"},children:(0,L.jsxs)("div",{style:{display:"flex",position:"relative"},children:[(0,L.jsxs)("div",{className:"".concat(Te&&Ne&&We?"gridwidthdashbord":"").concat(We&&Te&&!Ne?"exapndnotshowdashboard":""," ").concat(We&&Ne?"griddashboardwidth":""),id:"visibledGridWidth",style:{width:Ne?"calc(100% - "+Ae+")":"100%"},children:[!(0,a.isEmpty)(je)&&(0,L.jsx)(vn,{rowData:ve,viewData:je,stackId:Z,accessType:kt,isSharingEnable:Ct,startRange:pe,endRange:he,isViewUser:It,startRangeColumnId:this.state.startRangeColumnId,endRangeColumnId:this.state.endRangeColumnId,searchValue:ue,searchArray:ie,fetching:oe,isView:!1,showColumnSelectModel:se,viewSelectedColumnId:me,searchArrayIndex:re,showChangeRowDataSize:ne,showCustomizedCardsModel:ae,_showCustomizedCardsModel:this._showCustomizedCardsModel,_showCustomizedGalleryCardsModel:this._showCustomizedGalleryCardsModel,handleSearchChange:this.handleSearchChange,searchLoading:De,onClickSearchButton:this.onClickSearchButton,setParentCompState:this.setParentCompState,Mixpanel:x.N,eventIndex:we,status:Ie,searchInputFocus:this.searchInputFocus,searchValueFocusFlag:Me,blockWidth:Ne?Number(Ae.replace(/(\d+%)/,"")):0,isLock:Le,isPersonalView:Ve,isUserPersonalView:Fe,showPrintView:Je,history:null===(d=this.props)||void 0===d?void 0:d.history,viewSectionWidth:nt,isEmbed:!1,isShowViewSection:J,applyChecklsitToAllRows:function(){return A.setState({applyChecklistToAllRowsModal:!0})},isAppExpanded:this.state.isAppExpanded,isShowCustomDashboard:Ne}),at&&(0,L.jsx)(Ce.A,{stackId:Z,tableId:ee,closeCopyFromTemplateModal:function(){return A.setState({applyChecklistToAllRowsModal:!1,applyLoader:!1})},checklistId:"none",applyLoader:it,applyChecklistApiError:rt,applyChecklistToAllRowsModal:at,a
2pplyChecklistToAllRows:function(e,t){return A.applyChecklistToAllRows(e,t)}}),!(0,a.isEmpty)(je)&&(oe||this.state.isChangeView)&&(0,L.jsx)(Go.A,{}),J&&(0,L.jsx)("div",{style:{width:nt,position:"fixed",zIndex:5,backgroundColor:"white"},children:(0,L.jsx)(b.p,{id:"viewSectionId",className:"blocks appPortion ".concat(" max-width-change"),disableDragging:!0,enableResizing:{right:!0,left:!1},minWidth:"216",maxWidth:"350",style:{backgroundColor:"white",borderRight:"1px solid #C5C5C5"},size:{width:nt,height:"calc(100vh - 89px )",transform:"none",left:"unset"},onResize:function(e,t,o,n,a){A.setState({viewSectionWidth:o.style.width},function(){localStorage.setItem("viewSectionWidth",o.style.width)})},children:(0,L.jsx)(g.A,{className:"block-drag-icon",icon:"ios-more",fontSize:"24px",color:Tt})})}),oe||this.state.isChangeView?"":function(e,t,o,n,a,i,r,s,l,c,d,u){switch(je&&je.type){case"grid":var p,h,m,v;if(Re.Fr)return(0,L.jsx)(An,{stackId:Z,viewData:je,rowData:ve,changeFieldType:A.changeFieldType,updateMetadata:A.updateMetadata,accessType:kt,urlPath:null===(p=A.props)||void 0===p||null===(p=p.location)||void 0===p?void 0:p.pathname,hanldeUrlChange:A.hanldeUrlChange});if(At)return(0,L.jsx)(Cn,{frozonColumn:"string"==typeof je.frozenColumnCount?parseInt(je.frozenColumnCount):je.frozenColumnCount,isShowCustomDashboard:Ne,colorCondition:Be,rowData:(Array.isArray(ve)?ve:[]).filter(function(e){return e}),viewData:je,changeFieldType:A.changeFieldType,table:null===(h=A.props)||void 0===h?void 0:h.table,updateMetadata:A.updateMetadata,stackId:Z,searchArray:ie,searchArrayIndex:re,urlPath:null===(m=A.props)||void 0===m||null===(m=m.location)||void 0===m?void 0:m.pathname,copyLinkToCellOrRecordOrigin:ot,selectedRowId:null===(v=A.props)||void 0===v||null===(v=v.match)||void 0===v?void 0:v.params.rowId,hanldeUrlChange:A.hanldeUrlChange,eventIndex:we,status:Ie,accessType:kt,searchValueFocusFun:A.searchValueFocusFun,isLock:Le,blockWidth:Ne?Number(Ae.replace(/(\d+%)/,"")):0,isPersonalView:Ve,openAddMoreModal:function(){return A.setState({addMoreModal:!0,activeTabIndex:0})},addNewRow:function(){return qo.log("::clicke")},showAddMoreButton:Qe,tablePermissionData:Xe,viewSectionWidth:nt,isAccessTypeChangeDueToExceedPlanLimit:N,openExpandChecklistModal:A.openExpandChecklistModal,colorSelectedColumnId:dt,colorType:ht,isViewUser:It,handleExpandParticularApp:function(e){return A.setState({isAppExpanded:e})},showDashboardForButtonColumnClick:A.showDashboardForButtonColumnClick,openAppsModal:function(){A.setState({buttonClickToOpenAppsModal:!0})},handleExploreBlock:A.handleExploreBlock,handleUpgradeApps:A.handleUpgradeApps,showUpgradeButton:A.state.blockLimitReachedButton,selectButtonBlockId:ft,isAppExpanded:A.state.isAppExpanded,selectedRow:mt,expandView:ye,isHideLeftSide:yt});break;case"kanban":return(0,L.jsx)(yn,{colorCondition:Be,isShowCustomDashboard:Ne,stackId:Z,rowData:ve,startRange:A.state.startRange,endRange:A.state.endRange,incEndRangeForAddRecordInKanban:A.incEndRangeForAddRecordInKanban,viewData:je,showColumnSelectModel:se,showColumnNamesInCards:le,handleshowColumnSelectModel:A.handleshowColumnSelectModel,cardCoverImageColumnId:ce,cardFooterSelectorColumnId:de,changeFieldType:A.changeFieldType,accessType:kt,isLock:Le,isPersonalView:Ve,tablePermissionData:Xe,connectionserverModal:$e,searchArray:ie,searchArrayIndex:re,urlPath:null===(e=A.props)||void 0===e||null===(e=e.location)||void 0===e?void 0:e.pathname,copyLinkToCellOrRecordOrigin:ot,selectedRowId:null===(t=A.props)||void 0===t||null===(t=t.match)||void 0===t?void 0:t.params.rowId,hanldeUrlChange:A.hanldeUrlChange,eventIndex:we,status:Ie,isAccessTypeChangeDueToExceedPlanLimit:N,searchValueFocusFun:A.searchValueFocusFun,viewSectionWidth:nt,viewSelectedColumnId:me,colorSelectedColumnId:dt,colorType:ht,setKanbanWrapperRef:A.setWrapperRef});case"calendar":return(0,L.jsx)(kn,{isShowCustomDashboard:Ne,colorCondition:Be,stackId:Z,rowData:ve,typeOptions:A.state.typeOptions,startRange:A.state.startRange,endRange:A.state.endRange,viewData:je,showColumnSelectModel:se,changeFieldType:A.changeFieldType,handleshowColumnSelectModel:A.handleshowColumnSelectModel,isLock:Le,isPersonalView:Ve,blockWidth:Ne?Number(Ae.replace(/(\d+%)/,"")):0,tablePermissionData:Xe,connectionserverModal:$e,viewSectionWidth:nt,colorSelectedColumnId:dt,colorType:ht,urlPath:null===(o=A.props)||void 0===o||null===(o=o.location)||void 0===o?void 0:o.pathname,hanldeUrlChange:A.hanldeUrlChange});case"task":return(0,L.jsx)(gn,{stackId:Z,viewData:je,rowData:ve,changeFieldType:A.changeFieldType,accessType:kt,connectionserverModal:$e,viewSectionWidth:nt,urlPath:null===(n=A.props)||void 0===n||null===(n=n.location)||void 0===n?void 0:n.pathname,hanldeUrlChange:A.hanldeUrlChange});case"form":return(0,L.jsx)(fn,{stackId:Z,viewData:je,rowData:ve,changeFieldType:A.changeFieldType,accessType:kt,isLock:Le,isPersonalView:Ve,blockWidth:Ne?Number(Ae.replace(/(\d+%)/,"")):0,tablePermissionData:Xe,viewSectionWidth:nt,
2stackSidebarOpen:We,urlPath:null===(a=A.props)||void 0===a||null===(a=a.location)||void 0===a?void 0:a.pathname,hanldeUrlChange:A.hanldeUrlChange});case"update":return(0,L.jsx)(bn,{stackId:Z,viewData:je,rowData:ve,changeFieldType:A.changeFieldType,accessType:kt,isLock:Le,isPersonalView:Ve,blockWidth:Ne?Number(Ae.replace(/(\d+%)/,"")):0,tablePermissionData:Xe,viewSectionWidth:nt,stackSidebarOpen:We,urlPath:null===(i=A.props)||void 0===i||null===(i=i.location)||void 0===i?void 0:i.pathname,hanldeUrlChange:A.hanldeUrlChange});case"card":return(0,L.jsx)(An,{stackId:Z,viewData:je,rowData:ve,changeFieldType:A.changeFieldType,updateMetadata:A.updateMetadata,accessType:kt,viewSectionWidth:nt,urlPath:null===(r=A.props)||void 0===r||null===(r=r.location)||void 0===r?void 0:r.pathname,hanldeUrlChange:A.hanldeUrlChange});case"gallery":return(0,L.jsx)(Sn,{isShowCustomDashboard:Ne,colorCondition:Be,stackId:Z,rowData:ve,startRange:A.state.startRange,endRange:A.state.endRange,incEndRangeForAddRecordInKanban:A.incEndRangeForAddRecordInKanban,viewData:je,showColumnSelectModel:se,showColumnNamesInCards:le,handleshowColumnSelectModel:A.handleshowColumnSelectModel,cardCoverGalleryImageColumnId:Ee,cardFooterSelectorColumnId:de,changeFieldType:A.changeFieldType,accessType:kt,stackColor:R,blockWidth:Ne?Number(Ae.replace(/(\d+%)/,"")):0,tablePermissionData:Xe,searchArray:ie,searchArrayIndex:re,viewSectionWidth:nt,colorSelectedColumnId:dt,colorType:ht,urlPath:null===(s=A.props)||void 0===s||null===(s=s.location)||void 0===s?void 0:s.pathname,hanldeUrlChange:A.hanldeUrlChange});case"list":return(0,L.jsx)(In,{frozonColumn:"string"==typeof je.frozenColumnCount?parseInt(je.frozenColumnCount):je.frozenColumnCount,isShowCustomDashboard:Ne,colorCondition:Be,rowData:(Array.isArray(ve)?ve:[]).filter(function(e){return e}),viewData:je,changeFieldType:A.changeFieldType,table:null===(l=A.props)||void 0===l?void 0:l.table,updateMetadata:A.updateMetadata,stackId:Z,searchArray:ie,searchArrayIndex:re,urlPath:null===(c=A.props)||void 0===c||null===(c=c.location)||void 0===c?void 0:c.pathname,copyLinkToCellOrRecordOrigin:ot,selectedRowId:null===(d=A.props)||void 0===d||null===(d=d.match)||void 0===d?void 0:d.params.rowId,hanldeUrlChange:A.hanldeUrlChange,eventIndex:we,status:Ie,accessType:kt,searchValueFocusFun:A.searchValueFocusFun,isLock:Le,blockWidth:Ne?Number(Ae.replace(/(\d+%)/,"")):0,isPersonalView:Ve,openAddMoreModal:function(){return A.setState({addMoreModal:!0,activeTabIndex:0})},addNewRow:function(){return qo.log("::clicke")},showAddMoreButton:Qe,tablePermissionData:Xe,viewSectionWidth:nt,isAccessTypeChangeDueToExceedPlanLimit:N,openExpandChecklistModal:A.openExpandChecklistModal,colorSelectedColumnId:dt,colorType:ht,isViewUser:It,handleExpandParticularApp:function(e){return A.setState({isAppExpanded:e})},showDashboardForButtonColumnClick:A.showDashboardForButtonColumnClick,openAppsModal:function(){A.setState({buttonClickToOpenAppsModal:!0})},handleExploreBlock:A.handleExploreBlock,handleUpgradeApps:A.handleUpgradeApps,showUpgradeButton:A.state.blockLimitReachedButton,selectButtonBlockId:ft,isAppExpanded:A.state.isAppExpanded,selectedRow:mt,expandView:ye,startRange:A.state.startRange,endRange:A.state.endRange,incEndRangeForAddRecordInKanban:A.incEndRangeForAddRecordInKanban,showColumnSelectModel:se,showColumnNamesInCards:le,handleshowColumnSelectModel:A.handleshowColumnSelectModel,cardCoverGalleryImageColumnId:Ee,cardFooterSelectorColumnId:de,stackColor:R});case"timeline":return(0,L.jsx)(xn,{rowData:ve,stackId:Z,viewData:je,colorType:ht,colorCondition:Be,colorSelectedColumnId:dt,viewSectionWidth:nt,accessType:kt,tablePermissionData:Xe,searchArray:ie,searchArrayIndex:re,urlPath:null===(u=A.props)||void 0===u||null===(u=u.location)||void 0===u?void 0:u.pathname,hanldeUrlChange:A.hanldeUrlChange})}}()]}),Ne&&(0,L.jsxs)(b.p,{id:"blockdiv",className:"blocks appPortion ".concat(We?"blocks-modal":""," ").concat(Te?" max-width-change":"","  ").concat(!0===Ne&&1==this.state.isAppExpanded?"dashboardModalOpen":""),style:{background:"#fff",position:Te&&!We?"absolute":"relative",height:"calc(99vh - 81px)",right:0,transform:"none",width:"100%",zIndex:this.state.isAppExpanded?"":"6"},disableDragging:!0,enableResizing:{right:!1,left:!0},resizeHandleStyles:{left:{cursor:"ew-resize"}},minWidth:"25%",maxWidth:"40%",size:{width:Ae,height:"calc(100vh - 89px )",transform:"none",left:"unset"},onResize:function(e,t,o,n,a){A.setState({blockWidth:o.style.width},function(){localStorage.setItem("blockOuterWidth",o.style.width)})},children:[(0,L.jsx)(ke.A,{close:function(){A.setState({isShowCustomDashboard:!1,showBlockModal:!1,blockType:null,selectedBlockId:null,
2showAddMoreButton:!0})},rowData:ve,IsExpandedDashboard:Te,columnSchema:be,handleRedirectToaccount:this.handleRedirectToaccount,handleExpandDashboard:this.handleExpandDashboard,showDashboard:this.showDashboard,containerWidth:Ae,accessType:kt,trialPeriodExpire:_,showAddMoreButton:this.showAddMoreButton,plan:V,createdAppBlockId:_e,isEmbed:!1,resumeBlock:this.state.resumeBlock,selectedView:je,selectedBlockId:this.state.selectedBlockId,blockType:this.state.blockType,showBlockModal:this.state.showBlockModal,viewSectionWidth:nt,isAppExpanded:this.state.isAppExpanded,handleExpandParticularApp:function(e){return A.setState({isAppExpanded:e})},showDashboardForButtonColumnClick:this.showDashboardForButtonColumnClick,selectedRow:mt,selectButtonBlockId:ft,history:null===(u=this.props)||void 0===u?void 0:u.history}),(0,L.jsx)(g.A,{className:"block-drag-icon",icon:"ios-more",fontSize:"24px",color:"#1d1f2559"})]}),!oe&&We&&(0,L.jsx)(Ao,{style:{right:Ae+"%"},stackId:Z,history:null===(p=this.props)||void 0===p?void 0:p.history,close:function(){return A.setState({stackSidebarOpen:!1})}})]})})]}),null!=this.state.isHelpSliderOpen&&!this.state.helpSliderLoading&&(0,L.jsx)(S.A,{HelpSliderData:this.state.HelpSliderData?this.state.HelpSliderData:{},openCloseHelpSlider:this.openCloseHelpSlider,isHelpSliderOpen:this.state.isHelpSliderOpen,backgroundColor:"#ffffff",neutralTheme:!0,openCloseGettingStartedSidebar:this.openGettingStartedSidebar,handleHelpSearchChange:this.handleHelpSearchChange,quickTips:this.state.quickTips,tutorials:this.state.tutorials,videos:this.state.videos,supportArticles:this.state.supportArticles,searchedQuickTips:this.state.searchedQuickTips,searchedTutorials:this.state.searchedTutorials,searchedVideos:this.state.searchedVideos,searchedSupportArticles:this.state.searchedSupportArticles,getDataAsPerSection:this.getDataAsPerSection,openKeyboardShortcutsModal:this.openKeyboardShortcutsModal,handleShowContactSalesMenu:this.handleShowContactSalesMenu,handleShowReportBugMenu:this.handleShowReportBugMenu,auth:null===(h=this.props)||void 0===h?void 0:h.auth,workspaceData:null===(v=this.props)||void 0===v?void 0:v.workspace}),Pe&&!oe&&(0,L.jsx)(fe,{onClose:function(){return A.setState({isAutomationConfig:!1})}}),this.state.abortApi?(0,L.jsx)(zo,{}):"",this.state.notfound&&!this.state.abortApi?(0,L.jsx)("div",{className:"model-wrapper",children:(0,L.jsxs)("div",{className:"model",style:{width:"auto"},ref:this.setWrapperRef,children:[this.state.currentUserDelete?(0,L.jsx)("h3",{className:"modalApiError-msg",children:"You no longer have access to this stack. Please reach out to this Stack Owner to get the access."}):(0,L.jsx)("h3",{className:"modalApiError-msg",children:Ze}),(0,L.jsx)("div",{className:"buttons",children:(0,L.jsx)("button",{className:"action_button",onClick:function(){var e;return null===(e=A.props)||void 0===e||null===(e=e.history)||void 0===e?void 0:e.push("/")},children:"Return home"})})]})}):"",O.rowData&&Array.isArray(ye)&&ye.length>0&&ye.map(function(e,t){var o;return(0,L.jsx)(wn,{openLinkExpandView:A.openLinkExpandView,openLinkPopup:A.openLinkPopup,accessType:kt,viewData:je,filterRowData:ve,commentId:(null===(o=A.props)||void 0===o||null===(o=o.location)||void 0===o?void 0:o.pathname.split("/")[5])||"",childId:t,isEmbed:!1,expandView:e,addRow:A.addRows,deleteRow:A.deleteRows,stackId:Z,rowData:ve,changeFieldType:A.changeFieldType,updateMetadata:A.updateMetadata,isLock:Le,isPersonalView:Ve,tablePermissionData:Xe,connectionserverModal:$e,isViewUser:It,showDashboardForButtonColumnClick:A.showDashboardForButtonColumnClick,openAppsModal:function(){A.setState({buttonClickToOpenAppsModal:!0})},handleExploreBlock:A.handleExploreBlock,handleUpgradeApps:A.handleUpgradeApps,showUpgradeButton:A.state.blockLimitReachedButton,showAddMoreButton:A.showAddMoreButton,handleExpandParticularApp:function(e){return A.setState({isAppExpanded:e})},isAppExpanded:A.state.isAppExpanded,isShowCustomDashboard:Ne,selectedRow:mt,selectButtonBlockId:ft},t)}),(0,L.jsx)(f.A,{size:"tiny",open:Ke,style:{borderRadius:"6px",border:"2px solid rgb(221, 221, 221)",backgroundColor:"rgb(255,255,255)"}
2,closeIcon:!0,onClose:function(){return A.setState({rowNotFounfModal:!1})},children:(0,L.jsx)(f.A.Header,{style:{fontSize:"1.71428571rem",fontWeight:"400"},children:"Row you are looking is not found!"})}),W&&W.open&&(0,L.jsx)(qe,{}),G&&G.open&&(0,L.jsx)(Ho,{}),Ye&&(0,L.jsx)(ut,{createApps:function(e,t){A.setState({isShowCustomDashboard:!0,showBlockModal:!1,blockType:null,selectedBlockId:null})},history:null===(w=this.props)||void 0===w?void 0:w.history,close:function(){return A.setState({addMoreModal:!1})},handleExploreBlock:this.handleExploreBlock,handleUpgradeApps:this.handleUpgradeApps,showUpgradeButton:this.state.blockLimitReachedButton,openRespectiveMenu:function(e){return A.openRespectiveMenu(e)},activeTabIndex:this.state.activeTabIndex,closeAddMoreModal:function(){return A.setState({addMoreModal:!1})}}),xe&&this.handleTourPermission(),(0,L.jsx)(m.N9,{autoClose:4e3,className:"custom-notification",hideProgressBar:!0,icon:!1}),Ue&&this._renderFindStackModel(),$e&&(0,L.jsx)(pt.A,{top:"190px"}),vt&&(0,L.jsx)(Ko.A,{history:null===(k=this.props)||void 0===k?void 0:k.history,close:function(){return A.setState({buttonClickToOpenAppsModal:!1})},handleExploreBlock:this.handleExploreBlock,handleUpgradeApps:this.handleUpgradeApps,showUpgradeButton:this.state.blockLimitReachedButton}),bt&&(0,L.jsx)(Jo,{})]})}):null}}],i&&an(o.prototype,i),s&&an(o,s),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,i,s,c,u,p}(l().Component),Mn={fetchTable:De.GQ,addToSocketRoom:De.n4,changeLastTable:De.j8,createColumn:De.HA,renameColumn:De.ZK,updateColumnDesc:De.dl,deleteColumn:De.gR,createRow:De.Rv,deleteRow:De.aR,updateRowHeight:De.rO,updateCellValue:De.xU,updateColumnConfig:De.Q5,openExpandView:De.Mh,closeExpandView:De.se,fetchDashboardList:Ie.lq,createDashboard:Ie.n6,updateDashboard:Ie.mQ,createBlock:Ie.Wv,updateBlock:Ie.Tx,fetchBlock:Ie.K,fetchScheduleAutomation:function(e){return function(){var t,o=(t=Ae().m(function t(o){var a,i;return Ae().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,o({type:xe.Dh,payload:!0}),t.n=1,n.A.post("/api/v1/stackaction/"+e+"/automationlist");case 1:return a=t.v,i=a.data,o({type:xe.Dx,payload:i.data}),t.a(2,i);case 2:t.p=2,t.v,m.oR.error("Something went wrong",Oe);case 3:return t.a(2)}},t,null,[[0,2]])}),function(){var e=this,o=arguments;return new Promise(function(n,a){var i=t.apply(e,o);function r(e){Te(i,n,a,r,s,"next",e)}function s(e){Te(i,n,a,r,s,"throw",e)}r(void 0)})});return function(e){return o.apply(this,arguments)}}()},leaveToSocketRoom:De.Zn,addRecentStack:Ee.RC,fetchTableList:De.BS,abortApiStatus:De.nt,fetchAllStackList:De.qX,viewMetadataUpdate:De.yc,applyChecklistToAllRows:Ee.GR,updateGroupByRowData:De.iJ,updateFiltredRowData:De.W,applyGroupBy:De.xp,modifyColumnConfig:De.v6,showViewSectionAction:De.e5,fetchTableForDashboard:Ie.WI};const Pn=(0,h.Ng)(function(e){var t=e.socket,o=e.table,n=e.dashboard,a=e.auth,i=e.action,r=e.scheduleautomation,s=e.cache,l=e.workspace;return{socket:t,table:o,dashboard:n,auth:a,toolbarAction:i.toolbar,scheduleautomation:r,cache:s,workspace:l}},Mn)((0,w.A)(En))}}]);

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.