File: /disk001/machen/public_html/sonne/static/js/main.b89854e0.chunk.js
/*!
=========================================================
* Material Dashboard PRO React - v1.8.0
=========================================================
* Product Page: https://www.creative-tim.com/product/material-dashboard-pro-react
* Copyright 2019 Creative Tim (http://www.creative-tim.com)
* Coded by Creative Tim
=========================================================
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*/
/*! For license information please see main.b89854e0.chunk.js.LICENSE.txt */
(this.webpackJsonpmachen=this.webpackJsonpmachen||[]).push([[0],{1009:function(e,t,r){e.exports=r.p+"static/media/notification.d7241ff2.mp3"},105:function(e,t,r){var n=r(51);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(0)),o=(0,n(r(100)).default)(a.default.createElement(a.default.Fragment,null,a.default.createElement("path",{fill:"none",d:"M5.9,12.6C5.9,12.6,5.8,12.6,5.9,12.6l-0.1-0.1c0,0,0,0,0,0l0,0c0,0-0.1,0-0.1,0H3.1c0,0-0.1,0-0.1,0l-0.1,0\n\t\t\tc0,0,0,0,0,0l0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0.1c0,0,0,0,0,0l0,0c0,0,0,0,0,0l0,0c0,0,0,0.1,0,0.1\n\t\t\tc0,0,0,0.1,0,0.1l0,0.1c0,0,0,0,0,0l0,0c0,0,0,0,0.1,0.1l8.8,8.8v-1.2l-7.4-7.4h1.3l6.1,6.1v-1.2L5.9,12.6L5.9,12.6z M2.9,12.7\n\t\t\tL2.9,12.7L2.9,12.7L2.9,12.7z M2.8,13L2.8,13L2.8,13L2.8,13z M2.9,13.1L2.9,13.1L2.9,13.1L2.9,13.1z"}),a.default.createElement("path",{d:"M5.9,12.6C5.9,12.6,5.8,12.6,5.9,12.6l-0.1-0.1c0,0,0,0,0,0l0,0c0,0-0.1,0-0.1,0H3.1c0,0-0.1,0-0.1,0l-0.1,0\n\t\t\tc0,0,0,0,0,0l0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0.1c0,0,0,0,0,0l0,0c0,0,0,0,0,0l0,0c0,0,0,0.1,0,0.1\n\t\t\tc0,0,0,0.1,0,0.1l0,0.1c0,0,0,0,0,0l0,0c0,0,0,0,0.1,0.1l8.8,8.8v-1.2l-7.4-7.4h1.3l6.1,6.1v-1.2L5.9,12.6L5.9,12.6z M2.9,12.7\n\t\t\tL2.9,12.7L2.9,12.7L2.9,12.7z M2.8,13L2.8,13L2.8,13L2.8,13z M2.9,13.1L2.9,13.1L2.9,13.1L2.9,13.1z"}),a.default.createElement("path",{d:"M18.9,13C18.9,13,18.9,13,18.9,13c0-0.1,0-0.1,0-0.2l-0.1-0.2c0,0,0,0,0,0v0l-0.1,0c0,0,0,0-0.1-0.1l0,0\n\t\t\tc0,0,0,0,0,0l0,0c0,0-0.1,0-0.1,0H16c0,0-0.1,0-0.1,0l0,0c0,0,0,0,0,0l-0.1,0c0,0,0,0,0,0l-3.2,3.2l0,0v1.2l3.7-3.7h1.2l-4.8,4.8\n\t\t\tl0,0v1.2l6.2-6.2l0,0v0c0,0,0,0,0,0l0,0l-0.1-0.1L18.9,13L18.9,13z M18.7,12.8L18.7,12.8L18.7,12.8L18.7,12.8z"}),a.default.createElement("path",{d:"M18.1,11.3L18.1,11.3c0.1,0,0.1,0.1,0.1,0.1l0,0c0,0,0,0,0,0l0,0c0,0,0.1,0,0.1,0h2.5c0,0,0.1,0,0.1,0\n\t\t\tl0.2-0.1c0,0,0,0,0.1,0l0,0c0,0,0,0,0-0.1l0.1-0.2c0,0,0-0.1,0-0.1c0,0,0-0.1,0-0.1l0-0.1c0,0,0,0,0-0.1c0,0,0,0,0-0.1L12.5,2v1.2\n\t\t\tl7.4,7.4h-1.3l-6.1-6.1v1.2L18.1,11.3L18.1,11.3z M18.3,11.3L18.3,11.3L18.3,11.3L18.3,11.3z"}),a.default.createElement("path",{d:"M12.9,11.5H16c0,0,0.1,0,0.1,0l0.1-0.1c0,0,0,0,0,0l0.1,0v0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0l0,0\n\t\t\tc0,0,0-0.1,0-0.1c0,0,0-0.1,0-0.1l0-0.1c0,0,0,0,0,0l0,0c0,0,0,0,0,0l-3.8-3.9l0,4.1C12.5,11.3,12.7,11.5,12.9,11.5z"}),a.default.createElement("path",{d:"M5.2,10.8C5.2,10.8,5.2,10.8,5.2,10.8C5.2,10.8,5.2,10.9,5.2,10.8l-0.1,0.2L5.3,11l-0.2,0c0,0,0,0.1,0,0.1\n\t\t\tc0,0,0,0.1,0,0.1l0,0.1c0,0,0,0,0,0l0,0c0,0,0,0,0.1,0.1l0,0c0,0,0,0,0,0l0.1-0.1h0l0,0.1l0.1-0.1l0,0.1c0,0,0,0,0.1,0\n\t\t\tc0,0,0.1,0,0.1,0H8c0,0,0.1,0,0.1,0l0,0c0,0,0,0,0,0l0.1,0c0,0,0,0,0,0l3.2-3.2V6.9l-3.7,3.7H6.6l4.9-4.9V4.5L5.2,10.8L5.2,10.8z\n\t\t\t M5.3,11.1L5.3,11.1L5.3,11.1L5.3,11.1z"}),a.default.createElement("path",{d:"M11.1,12.5H8c0,0-0.1,0-0.1,0l-0.1,0c0,0,0,0,0,0l0,0c0,0,0,0-0.1,0.1c0,0,0,0-0.1,0.1l0,0.1l0.1,0.1l-0.2,0\n\t\t\tl0,0c0,0,0,0.1,0,0.1c0,0,0,0.1,0,0.1l0.1,0.1c0,0,0,0,0.1,0.1l3.8,3.8v-4.1C11.5,12.7,11.3,12.5,11.1,12.5z M7.8,12.8\n\t\t\tC7.8,12.8,7.8,12.8,7.8,12.8L7.8,12.8L7.8,12.8z M7.7,12.9L7.7,12.9L7.7,12.9L7.7,12.9z"}),a.default.createElement("path",{d:"M21.3,12.6L21.3,12.6c-0.2-0.2-0.4-0.2-0.6,0l-8.1,8.1l0,0V22l8.8-8.8c0.1-0.1,0.1-0.2,0.1-0.3\n\t\t\tC21.4,12.8,21.3,12.7,21.3,12.6z"}),a.default.createElement("path",{d:"M2.7,11.4L2.7,11.4c0.1,0.1,0.2,0.1,0.3,0.1c0.1,0,0.2,0,0.3-0.1l8.2-8.2V2l-8.8,8.8\n\t\t\tC2.6,10.9,2.6,11.2,2.7,11.4z"})),"Matrix");t.default=o},1060:function(e,t,r){e.exports=r(1684)},1069:function(e,t){},1118:function(e,t){},1119:function(e,t){},1120:function(e,t){},1121:function(e,t){},1122:function(e,t){},1326:function(e,t){},1328:function(e,t){},1338:function(e,t){},1340:function(e,t){},1365:function(e,t){},1367:function(e,t){},1368:function(e,t){},1373:function(e,t){},1375:function(e,t){},1381:function(e,t){},1383:function(e,t){},1402:function(e,t){},1414:function(e,t){},1417:function(e,t){},1448:function(e,t,r){},1500:function(e,t,r){},1501:function(e,t,r){},1510:function(e,t,r){},1683:function(e,t,r){},1684:function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"reduxFunction",(function(){return Mt}));var a,o=r(0),i=r.n(o),c=r(29),l=r(207),s=Object(l.a)(),u=r(8),d=r(1016),p=r(964),f=r(25),h=r(1),m={notifications:[]},g={copy:[],selected:[],action:null},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,t=arguments.length>1?arguments[1]:void 0;return"SET_CARD"===t.action&&t.value?Object(h.a)(Object(h.a)({},e),t.value):"CLEAR_CARD"===t.action?Object(h.a)({},g):e},y={open:!1,nodeId:null,activeChats:[],activeModule:"users",groups:{},notifications:!0},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y,t=arguments.length>1?arguments[1]:void 0;return"SET_CHAT"===t.action&&t.value?Object(h.a)(Object(h.a)({},e),t.value):"CLOSE_CHAT"===t.action?Object(h.a)({},y):e},x={timelines:{},unreadeds:{},drafts:{}},_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x,t=arguments.length>1?arguments[1]:void 0;return"SET_CHATS"===t.action&&t.value?Object(h.a)(Object(h.a)({},e),t.value):"CLEAR_CHATS"===t.action?Object(h.a)({},x):e},w={sideModuleWindow:!1,period:"$__last7Days",users:{},showDeleted:!1,hidePrivate:!1,lockPrivate:!1,unlockedPrivates:0,board:null},E=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w,t=arguments.length>1?arguments[1]:void 0;return"SET_CONTROL"===t.action&&t.value?Object(h.a)(Object(h.a)({},e),t.value):"RESET_CONTROLS"===t.action?Object(h.a)({},e):e},O=r(4),j=r(700),S=r.n(j),k=r(701),L=r.n(k),C=r(702),I=r.n(C),F=r(703),T=r.n(F),N=r(965),P=r.n(N),D=r(966),A=r.n(D),$=r(967),z=r.n($),M=r(968),B=r.n(M),Y=r(105),G=r.n(Y),R=r(969),H=r.n(R),W=r(97),U=r.n(W),V=r(506),q={version:V.version,swot:[{value:"strength",label:"$__strength",icon:"arrow_upward"},{value:"weakness",label:"$__weakness",icon:"arrow_downward"},{value:"opportunity",label:"$__opportunity",icon:"trending_up"},{value:"threat",label:"$__threat",icon:"trending_down"}],languages:[{value:"pt-BR",label:"$__pt-BR"},{value:"en-US",label:"$__en-US"},{value:"es-ES",label:"$__es-ES"}],status:[{value:"notStarted",label:"$__notStarted",icon:"query_builder",color:"#929497"},{value:"inProgress",label:"$__inProgress",icon:"play_circle_outline",color:"#011E41"},{value:"awaitAction",label:"$__await",icon:"hourglass_top",color:"pink"},{value:"paused",label:"$__paused",icon:"pause_presentation",color:"#EBA900"},{value:"completed",label:"$__completed",icon:"verified",color:"#5A7F71",props:{periodFilter:!0}}],currency:[{value:"BRL",label:"$__currencyBRL",symbol:"R$"},{value:"USD",label:"$__currencyUSD",symbol:"$"},{value:"EUR",label:"$__currencyEUR",symbol:"\u20ac"}],expiresIn:[{value:"12h",label:"$__12hours"},{value:null,label:"$__6hours"},{value:"3h",label:"$__3hours"},{value:"1h",label:"$__1hour"}],passwordExpire:[{value:"30",label:"$__30days"},{value:"60",label:"$__60days"},{value:"90",label:"$__90days"}],plans:[{value:"p0",label:"$__saasPlanName0",settings:Object(O.a)({space:5368709120,admins:1,price:0,onBoarding:!1,brightAndConnected:{feed:!1,feedDays:!1,radarLimit:25,insight:!1},plan:{activeLimit:2,planClient:!1,clientAdmin:!1,machenPlan:!1,templates:!1,guidelineLimit:2,feedLimit:4,radarLimit:25,insightLimit:25},task:{activeLimit:25,filter:!1,kpi:!1,timeSheet:!1,recurrence:!1},files:{uploadLimit:26214400},chat:{groupUsersLimit:7},support:{email:!0,priority:0,chat:!1},mobile:{},addOn:{learneng:!1,denkenDiscount:0}},"onBoarding",{technician:!1,custom:!1})},{value:"p1",label:"$__saasPlanName1",settings:Object(O.a)({space:26843545600,admins:1,price:149,onBoarding:0,whiteLabel:!1,brightAndConnected:{feed:!0,feedDays:15,radarLimit:0,insight:!0},plan:{planLimit:0,planClient:!0,clientAdmin:1,machenPlan:!0,templates:!0,guidelineLimit:0,feedLimit:0,radarLimit:0,insightLimit:0},task:{activeLimit:0,filter:!0,kpi:!0,timeSheet:!0,recurrence:!0},files:{uploadLimit:104857600},chat:{groupLimit:0},support:{email:!0,priority:0,chat:!0},mobile:{},addOn:{learneng:!0,denkenDiscount:5}},"onBoarding",{technician:1e3,custom:4990})},{value:"p2",label:"$__saasPlanName2",settings:Object(O.a)({space:53687091200,admins:9,price:890,onBoarding:4990,brightAndConnected:{feed:!0,feedDays:0,radarLimit:0,insight:!0},plan:{planLimit:0,planClient:!0,clientAdmin:2,machenPlan:!0,templates:!0,guidelineLimit:0,feedLimit:0,radarLimit:0,insightLimit:0},task:{activeLimit:0,filter:!0,kpi:!0,timeSheet:!0,recurrence:!0},files:{uploadLimit:314572800},chat:{groupLimit:0},support:{email:!0,priority:0,chat:!0},mobile:{},addOn:{learneng:!0,denkenDiscount:0,whiteLabel:!1}},"onBoarding",{technician:1e3,custom:4990})},{value:"p3",label:"$__saasPlanName3",settings:Object(O.a)({space:107374182400,admins:19,price:1790,onBoarding:6990,brightAndConnected:{feed:!0,feedDays:0,radarLimit:0,insight:!0},plan:{planLimit:0,planClient:!0,clientAdmin:3,machenPlan:!0,templates:!0,guidelineLimit:0,feedLimit:0,radarLimit:0,insightLimit:0},task:{activeLimit:0,filter:!0,kpi:!0,timeSheet:!0,recurrence:!0},files:{uploadLimit:314572800},chat:{groupLimit:0},support:{email:!0,priority:0,chat:!0},mobile:{},addOn:{learneng:!0,denkenDiscount:0,whiteLabel:!1}},"onBoarding",{technician:1e3,custom:4990})},{value:"p4",label:"$__saasPlanName4",settings:Object(O.a)({space:214748364800,admins:49,price:3990,onBoarding:10990,brightAndConnected:{feed:!0,feedDays:0,radarLimit:0,insight:!0},plan:{planLimit:0,planClient:!0,clientAdmin:3,machenPlan:!0,templates:!0,guidelineLimit:0,feedLimit:0,radarLimit:0,insightLimit:0},task:{activeLimit:0,filter:!0,kpi:!0,timeSheet:!0,recurrence:!0},files:{uploadLimit:314572800},chat:{groupLimit:0},support:{email:!0,priority:0,chat:!0},mobile:{},addOn:{learneng:!0,denkenDiscount:0,whiteLabel:!1}},"onBoarding",{technician:1e3,custom:4990})},{value:"p5",label:"$__saasPlanName5",settings:Object(O.a)({space:0,admins:0,price:0,onBoarding:0,brightAndConnected:{feed:!0,feedDays:0,radarLimit:0,insight:!0},plan:{planLimit:0,planClient:!0,clientAdmin:3,machenPlan:!0,templates:!0,guidelineLimit:0,feedLimit:0,radarLimit:0,insightLimit:0},task:{activeLimit:0,filter:!0,kpi:!0,timeSheet:!0,recurrence:!0},files:{uploadLimit:314572800},chat:{groupLimit:0},support:{email:!0,priority:0,chat:!0},mobile:{},addOn:{learneng:!0,denkenDiscount:0,whiteLabel:!1}},"onBoarding",{technician:!0,custom:4990})}],type:[{value:"plan",label:"$__plan",icon:"view_comfy",color:null,calendar:!1},{value:"strength",label:"$__strength",icon:"arrow_upward",color:null,calendar:!1},{value:"weakness",label:"$__weakness",icon:"arrow_downward",color:null,calendar:!1},{value:"opportunity",label:"$__opportunity",icon:"trending_up",color:null,calendar:!1},{value:"threat",label:"$__threat",icon:"trending_down",color:null,calendar:!1},{value:"guideline",label:"$__guideline",icon:G.a,color:null,calendar:!0},{value:"guidelineD",label:"$__guidelineD",icon:S.a,color:null,calendar:!0},{value:"guidelineR",label:"$__guidelineR",icon:I.a,color:null,calendar:!0},{value:"guidelineC",label:"$__guidelineC",icon:L.a,color:null,calendar:!0},{value:"guidelineE",label:"$__guidelineE",icon:T.a,color:null,calendar:!0},{value:"objective",label:"$__objective",icon:"gps_fixed",color:null,calendar:!0},{value:"goal",label:"$__goal",icon:"flag",color:null,calendar:!0},{value:"iniciative",label:"$__iniciative",icon:"play_arrow",color:null,calendar:!0},{value:"task",label:"$__task",icon:"fact_check",color:null,calendar:!0},{value:"meeting",label:"$__meeting",icon:"meeting_room",color:null,calendar:!0},{value:"myTask",label:"$__myTask",icon:"person_pin",color:null,calendar:!0},{value:"link",label:"$__radar",icon:"public",color:null,calendar:!0},{value:"insight",label:"$__insight",icon:U.a,color:null,calendar:!0}],dateStatus:[{value:"notStarted",label:"$__notStarted",icon:"query_builder"},{value:"inProgress",label:"$__inProgress",icon:"play_circle_outline"}],priority:[{value:null,label:"$__none",color:"#c6c6c6"},{value:"normal",label:"$__normal",color:"#c6c6c6"},{value:"low",label:"$__low",color:"#faba00"},{value:"medium",label:"$__medium",color:"#ff7c32"},{value:"high",label:"$__high",color:"#ff0000"}],automation:[{value:"doNotChange",label:"$__doNotChange"},{value:"replace",label:"$__replaceWith"},{value:"add",label:"$__add"},{value:"remove",label:"$__remove"}],fileExtensions:[{ext:["jpg","jpeg","jpe","jfif","gif","png","webp","svg","eps"],icon:!1,title:"image",viewer:"img"},{ext:["txt"],icon:"description",title:"Text",viewer:"text"},{ext:["doc","docx","dot","doc","dotx"],icon:P.a,title:"Microsoft Word",viewer:"microsoft"},{ext:["xls","xlt","ooxml","xlsx"],icon:A.a,title:"Microsoft Excel",viewer:"microsoft"},{ext:["ppt","pptx","ppsx","sldx"],icon:z.a,title:"Microsoft PowerPoint",viewer:"microsoft"},{ext:["pdf"],icon:H.a,title:"PDF",viewer:"pdf"},{ext:["aac","wav","ts","smf","ogg","mp3","3gp","caf","m4a"],icon:"audiotrack",title:"audioFile",viewer:"audio"},{ext:["avi","mov","mp4","3gpp"],icon:"movie",title:"movieFile",viewer:"movie"}],access:[{name:"$__admin",permissions:{create:!0,read:!0,run:!0,update:!0,delete:!0,moderate:!0,levels:0}},{name:"$__manager",permissions:{create:!0,read:!0,run:!0,update:!0,delete:!0,moderate:!0,levels:0}},{name:"$__user",permissions:{create:!0,read:!0,run:!0,update:!1,delete:!1,moderate:!1,levels:0}},{name:"$__guest",permissions:{create:!1,read:!0,run:!0,update:!1,delete:!1,moderate:!1,levels:1}}],tag:[],userGroup:[],dataType:[{name:"user",icon:"contact_page",module:"user",reqId:!1,view:{c:{pages:["users"],access:["userAdmin","userModerate","master"]}},hash:null,db:"users",iniModule:"userEdit",modules:["resumeUser","userEdit","access","twoFactor","cards","mobile","settings","delete"],requireFields:["name","email"],hideFields:["independentAccount"],disabledFields:[],data:{type:"user"},sharedIn:{attach:[],copy:[],shared:["plan","objective","goal","iniciative","task","meeting","chatGroup","strength","weakness","opportunity","threat","guideline","guidelineD","guidelineR","guidelineE","guidelineC","myTask","user"]}},{name:"user",icon:"contact_page",module:"user",reqId:!1,view:{c:{pages:["units"],access:["userAdmin","userModerate","master"]}},hash:!0,db:"users",iniModule:"userEdit",modules:["resumeUser","userEdit","access","twoFactor","cards","mobile","settings","delete"],requireFields:["name","email"],hideFields:["independentAccount"],disabledFields:[],data:{type:"user"},sharedIn:{attach:[],copy:[],shared:["plan","objective","goal","iniciative","task","meeting","chatGroup","strength","weakness","opportunity","threat","guideline","guidelineD","guidelineR","guidelineE","guidelineC","myTask","user"]}},{name:"group",icon:"groups",module:"user",reqId:!1,view:{c:{pages:["units"],access:["userAdmin","userModerate"],noId:!0}},hash:null,db:"cards",iniModule:"userEdit",modules:["userEdit","delete","settings"],requireFields:["name"],disabledFields:["email"],hideFields:["independentAccount"],data:{type:"group"}},{name:"client",icon:"business",module:"user",reqId:!1,view:{c:{pages:["units"],access:["userAdmin","userModerate"],noId:!0}},hash:null,db:"cards",iniModule:"userEdit",modules:["userEdit","delete","settings"],requireFields:["name"],disabledFields:["email"],hideFields:[],data:{type:"client"}},{name:"unity",icon:"badge",module:"user",reqId:!1,view:{c:{pages:["units"],access:["master"],noId:!0}},hash:null,db:"users",iniModule:"userEdit",modules:["userEdit","delete","settings"],requireFields:["name"],disabledFields:["email"],data:{type:"client"}},{name:"step",icon:"123",module:"step",reqId:!0,db:"cards",iniModule:"columnEdit",modules:["columnEdit","users","flow","delete","log"],requireFields:["name"],disabledFields:[],fieldsTitle:{name:"$__columnName",placeholder:"$__columnPlaceholder"},sharedIn:{attach:[],copy:[],shared:[]}},{name:"chatGroup",icon:"group_work",module:"chat",reqId:!0,db:"cards",iniModule:"cardEdit",modules:["cardEdit","users","files","delete","log"],hideFields:["image","progress","status","tags","deadline","priority","recurrence","plan"],requireFields:["name"],disabledFields:[],fieldsTitle:{name:"$__groupName",placeholder:"$__groupNamePlaceholder"},sharedIn:{attach:[],copy:[],shared:["plan","objective","goal","iniciative","task","meeting","chatGroup","strength","weakness","opportunity","threat","guideline","guidelineD","guidelineR","guidelineE","guidelineC","myTask","user"]}},{name:"feed",icon:"rss_feed",module:"feeds",reqId:!1,view:{"bright-and-connected":{pages:["feeds"]},sp:{pages:["bright-and-connected"]}},db:"feeds",iniModule:"feedEdit",modules:["resumeFeed","feedEdit"],disabledFields:[],data:{status:"notStarted"},sharedIn:{attach:[],copy:["plan","client"],shared:[]}},{name:"link",icon:"public",module:"insights",reqId:!0,view:{"bright-and-connected":{pages:["radar"]},sp:{pages:["radar"]}},hash:null,db:"cards",iniModule:"link",modules:["resumeLink","cardEdit","checklist","steps","timeline","sendTo","log","users","files","timeLog","settings","delete","myDay"],hideFields:["image","status","client","recurrence"],disabledFields:["url"],data:{status:"notStarted"},sharedIn:{attach:["plan","client"],copy:["plan","client"],shared:["plan","objective","goal","iniciative","task","meeting","chatGroup","strength","weakness","opportunity","threat","guideline","guidelineD","guidelineR","guidelineE","guidelineC","myTask","user"]}},{name:"insight",icon:U.a,module:"insights",reqId:!0,view:{"bright-and-connected":{pages:["insight-boards"]},sp:{pages:["insight-boards"]}},hash:null,db:"cards",iniModule:"cardEdit",modules:["resumeLink","cardEdit","checklist","timeline","sendTo","log","users","files","timeLog","settings","delete","myDay"],hideFields:["image","status","client","recurrence"],data:{status:"notStarted"},sharedIn:{attach:["plan","client"],copy:["plan","client"],shared:["plan","objective","goal","iniciative","task","meeting","chatGroup","strength","weakness","opportunity","threat","guideline","guidelineD","guidelineR","guidelineE","guidelineC","myTask","user"]}},{name:"plan",icon:"view_comfy",module:"plan",reqId:!1,view:{sp:{pages:["StrategyAndPlans","home"]}},db:"cards",iniModule:"cardEdit",modules:["resume","cardEdit","steps","timeline","users","sendTo","log","files","timeLog","delete","settings"],hideFields:["image","recurrence"],requireFields:["name"],disabledFields:[],data:{status:"notStarted"},loadChildrens:!0,sharedIn:{attach:[],copy:["client"],shared:[]},fieldsTitle:{name:"$__planName",placeholder:"$__setPlanName"}},{name:"plan",icon:"tips_and_updates",module:"plan",reqId:!1,view:{sp:{pages:["templates"]}},db:"cards",iniModule:"cardEdit",modules:["resume","cardEdit","steps","templateOptions","steps","timeline","files","delete"],hideFields:["image","recurrence"],requireFields:["name"],disabledFields:[],data:{status:"notStarted"},fieldsTitle:{name:"$__planName",placeholder:"$__setPlanName"}},{name:"objective",icon:"gps_fixed",module:"planning",myTasks:!0,reqId:!0,view:{sp:{pages:["objectives"]}},db:"cards",iniModule:"cardEdit",modules:["resume","cardEdit","checklist","steps","recurrence","timeline","kpi","users","budget","myDay","sendTo","log","files","timeLog","settings","delete"],hideFields:["image","client"],requireFields:["name"],disabledFields:[],sendTo:!0,data:{status:"notStarted"},loadChildrens:!0,sharedIn:{attach:["plan","guideline","guidelineD","guidelineR","guidelineE","guidelineC"],copy:["plan","guideline","guidelineD","guidelineR","guidelineE","guidelineC"],shared:["plan","guideline","guidelineD","guidelineR","guidelineE","guidelineC"]}},{name:"goal",icon:"flag",module:"planning",myTasks:!0,reqId:!0,view:{sp:{pages:["goals"]}},db:"cards",iniModule:"cardEdit",modules:["resume","cardEdit","checklist","steps","recurrence","timeline","kpi","users","budget","myDay","sendTo","log","files","timeLog","settings","delete"],hideFields:["image","client"],requireFields:["name"],disabledFields:[],sendTo:!0,data:{status:"notStarted"},loadChildrens:!0,sharedIn:{attach:["plan","objective"],copy:["plan","objective"],shared:["plan","objective"]}},{name:"iniciative",icon:"play_arrow",module:"agile",myTasks:!0,reqId:!0,view:{sp:{pages:["agile","actions","dashboard"]},t:{pages:["myDay","ourDay","allTasks","unlinkedCards","myTasks"]}},db:"cards",iniModule:"cardEdit",modules:["resume","cardEdit","checklist","steps","recurrence","timeline","kpi","users","budget","myDay","sendTo","log","files","timeLog","settings","delete"],hideFields:["image","client"],requireFields:["name"],disabledFields:[],sendTo:!0,data:{status:"notStarted"},sharedIn:{attach:["plan","goal","iniciative","task","meeting","myTask"],copy:["plan","goal","iniciative","task","meeting","myTask"],shared:["plan","objective","goal","iniciative","task","meeting","chatGroup","strength","weakness","opportunity","threat","guideline","guidelineD","guidelineR","guidelineE","guidelineC","myTask","user"]}},{name:"myTask",alias:"task",icon:"person_pin",module:"myTasks",reqId:!0,db:"cards",iniModule:"cardEdit",modules:["resume","cardEdit","checklist","steps","recurrence","timeline","kpi","users","sendTo","myDay","client","log","files","timeLog","settings","delete"],hideFields:["image"],disabledFields:[],sendTo:!0,myTasks:!0,data:{status:"notStarted"},sharedIn:{attach:["plan","objective","goal","iniciative","task","meeting","chatGroup","strength","weakness","opportunity","threat","guideline","guidelineD","guidelineR","guidelineE","guidelineC","myTask","user"],copy:["plan","objective","goal","iniciative","task","meeting","chatGroup","strength","weakness","opportunity","threat","guideline","guidelineD","guidelineR","guidelineE","guidelineC","myTask","user"],shared:["plan","objective","goal","iniciative","task","meeting","chatGroup","strength","weakness","opportunity","threat","guideline","guidelineD","guidelineR","guidelineE","guidelineC","myTask","user"]}},{name:"task",icon:"fact_check",module:"agile",myTasks:!0,reqId:!0,view:{sp:{pages:["agile","actions","dashboard"]},t:{pages:["myDay","ourDay","allTasks","unlinkedCards","myTasks"]}},db:"cards",iniModule:"cardEdit",modules:["resume","cardEdit","checklist","steps","recurrence","timeline","kpi","users","budget","myDay","sendTo","log","files","timeLog","settings","delete"],hideFields:["image","client"],requireFields:["name"],disabledFields:[],sendTo:!0,data:{status:"notStarted"},sharedIn:{attach:["plan","goal","iniciative","task","meeting","myTask"],copy:["plan","goal","iniciative","task","meeting","myTask"],shared:["plan","objective","goal","iniciative","task","meeting","chatGroup","strength","weakness","opportunity","threat","guideline","guidelineD","guidelineR","guidelineE","guidelineC","myTask","user"]}},{name:"meeting",icon:"meeting_room",module:"agile",myTasks:!0,reqId:!0,view:{sp:{pages:["agile","actions","dashboard"]},t:{pages:["myDay","ourDay","allTasks","unlinkedCards","myTasks"]}},db:"cards",iniModule:"cardEdit",modules:["resume","cardEdit","checklist","steps","recurrence","timeline","kpi","users","myDay","budget","sendTo","log","files","timeLog","settings","delete"],hideFields:["image","client"],requireFields:["name","startDate"],disabledFields:[],sendTo:!0,data:{status:"notStarted"},sharedIn:{attach:["plan","goal","iniciative","task","meeting","myTask"],copy:["plan","goal","iniciative","task","meeting","myTask"],shared:["plan","objective","goal","iniciative","task","meeting","chatGroup","strength","weakness","opportunity","threat","guideline","guidelineD","guidelineR","guidelineE","guidelineC","myTask","user"]}},{name:"strength",icon:"arrow_upward",module:"swot",reqId:!0,db:"cards",iniModule:"cardEdit",modules:["resume","cardEdit","timeline","log","files","timeLog","delete"],hideFields:["image","imageUpload","deadline","progress","priority","status","client","private"],disabledFields:[],sendTo:!0,data:{status:"notStarted"},sharedIn:{attach:["plan"],copy:["plan"],shared:["plan","objective","goal","iniciative","task","meeting","chatGroup","strength","weakness","opportunity","threat","guideline","guidelineD","guidelineR","guidelineE","guidelineC","myTask","user"]}},{name:"weakness",icon:"arrow_downward",module:"swot",reqId:!0,db:"cards",iniModule:"cardEdit",modules:["resume","cardEdit","timeline","log","files","timeLog","delete"],hideFields:["image","imageUpload","deadline","progress","priority","status","client","private"],disabledFields:[],sendTo:!0,data:{status:"notStarted"},sharedIn:{attach:["plan"],copy:["plan"],shared:["plan","objective","goal","iniciative","task","meeting","chatGroup","strength","weakness","opportunity","threat","guideline","guidelineD","guidelineR","guidelineE","guidelineC","myTask","user"]}},{name:"opportunity",icon:"trending_up",module:"swot",reqId:!0,db:"cards",iniModule:"cardEdit",modules:["resume","cardEdit","timeline","log","files","timeLog","delete"],hideFields:["image","imageUpload","deadline","progress","priority","status","client","private"],disabledFields:[],sendTo:!0,data:{status:"notStarted"},sharedIn:{attach:["plan"],copy:["plan"],shared:["plan","objective","goal","iniciative","task","meeting","chatGroup","strength","weakness","opportunity","threat","guideline","guidelineD","guidelineR","guidelineE","guidelineC","myTask","user"]}},{name:"threat",icon:"trending_down",module:"swot",reqId:!0,db:"cards",iniModule:"cardEdit",modules:["resume","cardEdit","timeline","log","files","timeLog","delete"],hideFields:["image","imageUpload","deadline","progress","priority","status","client","private"],disabledFields:[],sendTo:!0,data:{status:"notStarted"},sharedIn:{attach:["plan"],copy:["plan"],shared:["plan","objective","goal","iniciative","task","meeting","chatGroup","strength","weakness","opportunity","threat","guideline","guidelineD","guidelineR","guidelineE","guidelineC","myTask","user"]}},{name:"guideline",icon:G.a,module:"matrix",reqId:!0,db:"cards",iniModule:"cardEdit",modules:["resume","cardEdit","checklist","steps","recurrence","timeline","kpi","users","myDay","sendTo","log","files","timeLog","settings","delete"],hideFields:["client"],disabledFields:[],sendTo:!0,view:{sp:{pages:["guidelines","matrix"]}},data:{status:"notStarted"},sharedIn:{attach:["plan"],copy:["plan"],shared:["plan","objective","goal","iniciative","task","meeting","chatGroup","strength","weakness","opportunity","threat","guideline","guidelineD","guidelineR","guidelineE","guidelineC","myTask","user"]}},{name:"guidelineD",icon:S.a,module:"matrix",reqId:!0,db:"cards",iniModule:"cardEdit",modules:["resume","cardEdit","checklist","steps","timeline","kpi","users","myDay","sendTo","log","files","timeLog","settings","delete"],hideFields:["image","imageUpload","client","recurrence"],disabledFields:[],sendTo:!0,myTasks:!0,view:{sp:{pages:["matrix","guidelines"]}},data:{status:"notStarted"},sharedIn:{attach:["plan"],copy:["plan"],shared:["plan","objective","goal","iniciative","task","meeting","chatGroup","strength","weakness","opportunity","threat","guideline","guidelineD","guidelineR","guidelineE","guidelineC","myTask","user"]}},{name:"guidelineR",icon:I.a,module:"matrix",reqId:!0,db:"cards",iniModule:"cardEdit",modules:["resume","cardEdit","checklist","steps","recurrence","timeline","kpi","users","myDay","sendTo","log","files","timeLog","settings","delete"],hideFields:["image","imageUpload","client","recurrence"],disabledFields:[],sendTo:!0,myTasks:!0,view:{sp:{pages:["matrix","guidelines"]}},data:{status:"notStarted"},sharedIn:{attach:["plan"],copy:["plan"],shared:["plan","objective","goal","iniciative","task","meeting","chatGroup","strength","weakness","opportunity","threat","guideline","guidelineD","guidelineR","guidelineE","guidelineC","myTask","user"]}},{name:"guidelineE",icon:T.a,module:"matrix",reqId:!0,db:"cards",iniModule:"cardEdit",modules:["resume","cardEdit","checklist","steps","recurrence","timeline","kpi","users","myDay","sendTo","log","files","timeLog","settings","delete"],hideFields:["image","imageUpload","client","recurrence"],disabledFields:[],sendTo:!0,myTasks:!0,view:{sp:{pages:["matrix","guidelines"]}},data:{status:"notStarted"},sharedIn:{attach:["plan"],copy:["plan"],shared:["plan","objective","goal","iniciative","task","meeting","chatGroup","strength","weakness","opportunity","threat","guideline","guidelineD","guidelineR","guidelineE","guidelineC","myTask","user"]}},{name:"guidelineC",icon:L.a,module:"matrix",reqId:!0,db:"cards",iniModule:"cardEdit",modules:["resume","cardEdit","checklist","steps","recurrence","timeline","kpi","users","myDay","sendTo","log","files","timeLog","settings","delete"],hideFields:["image","imageUpload","client","recurrence"],disabledFields:[],sendTo:!0,myTasks:!0,view:{sp:{pages:["matrix","guidelines"]}},data:{status:"notStarted"},sharedIn:{attach:["plan"],copy:["plan"],shared:["plan","objective","goal","iniciative","task","meeting","chatGroup","strength","weakness","opportunity","threat","guideline","guidelineD","guidelineR","guidelineE","guidelineC","myTask","user"]}},{name:"swot",icon:B.a,db:"cards",hash:["matrix"]},{name:"matrix",icon:G.a,db:"cards",hash:["matrix"]}],cards:{},users:{},feeds:{},notifications:{},loaded:!1,viewList:!1,myTasksMenuExpanded:!1,adminView:!1,adminViewLoader:!1,orderByTitle:!0,orderByTitlePosition:"ASC",groupByColor:!1},X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:q,t=arguments.length>1?arguments[1]:void 0;return"SET_DB"===t.action&&t.value?Object(h.a)(Object(h.a)({},e),t.value):e},J={},K=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J,t=arguments.length>1?arguments[1]:void 0;return"SET_FUNCTIONS"===t.action&&t.value?Object(h.a)(Object(h.a)({},e),t.value):e},Z={},Q=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Z,t=arguments.length>1?arguments[1]:void 0;return"SET_LANGUAGE"===t.action&&t.value?t.value:e},ee={open:!1,miro:!1,files:[],file:0},te=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ee,t=arguments.length>1?arguments[1]:void 0;return"LIGHTBOX"===t.action&&t.value?Object(h.a)(Object(h.a)({},e),t.value):"LIGHTBOX_CLOSE"===t.action?Object(h.a)({},ee):e},re={total:0,lastNotification:0,firstNotification:0},ne=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:re,t=arguments.length>1?arguments[1]:void 0;return"SET_NOTIFICATIONS"===t.action&&t.value?Object(h.a)(Object(h.a)({},e),t.value):e},ae={fullScreen:!0,visible:!0,callBack:null,autoSave:!1,cards:!0},oe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ae,t=arguments.length>1?arguments[1]:void 0;return"preLoader"===t.action&&t.value?Object(h.a)(Object(h.a)({},e),t.value):e},ie={tags:[],userGroups:[],users:{userGroup:[],selected:{}},units:{userGroup:[],selected:{}},clients:{userGroup:[],selected:{}},groups:{userGroup:[],selected:{}},plans:{userGroup:[],selected:{}},sideModuleWindow:!1,clearFilter:!1,text:"",cards:(a={iniDate:null,endDate:null,dateStatus:[],status:{all:!0,notStarted:!0,awaitAction:!0,paused:!0,inProgress:!0,completed:!0},priority:{all:!0,null:!0,normal:!0,low:!0,medium:!0,high:!0}},Object(O.a)(a,"priority",{all:!0,null:!0,normal:!0,low:!0,medium:!0,high:!0}),Object(O.a)(a,"risk",{all:!0,null:!0,normal:!0,low:!0,medium:!0,high:!0}),Object(O.a)(a,"complexity",{all:!0,null:!0,normal:!0,low:!0,medium:!0,high:!0}),Object(O.a)(a,"impact",{all:!0,null:!0,normal:!0,low:!0,medium:!0,high:!0}),Object(O.a)(a,"kpiType",[]),Object(O.a)(a,"iniKpiValue",null),Object(O.a)(a,"endKpiValue",null),a)},ce=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ie,t=arguments.length>1?arguments[1]:void 0;return"SEARCH"===t.action&&t.value?Object(h.a)(Object(h.a)({},e),t.value):"SEARCH_CLEAR"===t.action?ie:e},le=r(328),se=r.n(le),ue=r(685),de=r.n(ue),pe={custom:{ColumnTitleColor:"linear-gradient(90deg, rgba(67,18,102,1) 0%, rgba(90,35,130,1) 100%)",customLogo:se.a,loginBackground:de.a,linearProgress:"linear-gradient(90deg, rgba(90,35,130,0) 0%, rgba(67,18,102,1) 30%, rgba(67,18,102,1) 70%, rgba(90,35,130,0) 100%)",AvatarBackground:"radial-gradient(rgba(114,47,162,1) 0%, rgba(67,18,102,1) 100%)",AvatarIconColor:"#FFFFFF",active:"rgb(192,178,131)",color:"rgb(192,178,131)",colorText:"rgb(192,178,131)",dark:"rgb(8,27,49)",darkText:"rgb(8,27,49)",disabled:"rgb(200,200,200)",fieldRadius:"3px",fieldVariant:"standard",light:"#FFFFFF",lightText:"#FFFFFF",line:"rgb(192,178,131)",locale:"pt-BR",subMenuColor:"linear-gradient(90deg, rgba(233,233,233,1) 0%, rgba(237,237,237,1) 100%)",subMenuTextColor:"rgb(125,125,125)",subMenuTextColorActive:"rgb(192,178,131)",medium:"rgb(125,125,125)",mediumText:"rgb(150,150,150)",menu:"rgb(67,18,102)",menuColor:"linear-gradient(90deg, rgba(67,18,102,1) 0%, rgba(90,35,130,1) 100%)",menuButtonColor:"rgb(192,178,131)",timelineMyMessage:"#ebe3f1"},cards:{load:[],adminViewLoader:!1,adminView:!1,loaded:!1,expanded:!1,hide:{image:!1,description:!1,dates:!1,kpi:!1,kpiChart:!1,kpiChange:!1}},timeline:{load:[]},sideModuleWindow:!1,dashboard:{period:"$__last7Days"},period:"$__last7Days",users:{},showDeleted:!1,showPrivate:!1},fe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pe,t=arguments.length>1?arguments[1]:void 0;return"SET_SESSION"===t.action&&t.value?Object(h.a)(Object(h.a)({},e),t.value):"CLEAR_SESSION"===t.action?Object(h.a)({},e):e},he={cards:{load:{}},timeline:{load:{}}},me=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:he,t=arguments.length>1?arguments[1]:void 0;return"SET_SESSION_LOADS"===t.action&&t.value?Object(h.a)(Object(h.a)({},e),t.value):"CLEAR_SESSION_LOADS"===t.action?Object(h.a)({},e):e},ge={module:null,activeModule:"cardEdit",reqSave:!1,window:!1,id:null,data:{}},ve=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ge,t=arguments.length>1?arguments[1]:void 0;return"SET_MODULE"===t.action&&t.value?Object(h.a)(Object(h.a)({},e),t.value):"CLEAR_MODULE"===t.action?Object(h.a)({},ge):e},ye={},be=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ye,t=arguments.length>1?arguments[1]:void 0;return"SET_TIMELINE"===t.action&&t.value?Object(h.a)(Object(h.a)({},e),t.value):e},xe={cards:{},timeline:{}},_e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xe,t=arguments.length>1?arguments[1]:void 0;return"TO_LOAD"===t.action&&t.value?Object(h.a)(Object(h.a)({},e),t.value):e},we={users:{}},Ee=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:we,t=arguments.length>1?arguments[1]:void 0;return"SET_USERS_STATUS"===t.action&&t.value?Object(h.a)(Object(h.a)({},e),t.value):"CLEAR_USERS_STATUS"===t.action?Object(h.a)({},e):e},Oe={typing:{}},je=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Oe,t=arguments.length>1?arguments[1]:void 0;return"SET_TYPING"===t.action&&t.value?Object(h.a)(Object(h.a)({},e),t.value):"RESET_TYPING"===t.action?Object(h.a)({},Oe):e},Se=r(362);function ke(){ke=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Le=ke().mark(Fe),Ce=ke().mark(Te);function Ie(e){return e.next&&e.next(),!0}function Fe(e){return ke().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(Se.c)({type:e.action,value:e.value});case 2:return t.next=4,Object(Se.b)(Ie,e);case 4:case"end":return t.stop()}}),Le)}function Te(){return ke().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Se.a)([Object(Se.e)("ASYNC",Fe),Object(Se.d)("IMMEDIATE",Fe)]);case 2:case"end":return e.stop()}}),Ce)}var Ne=Object(d.a)(),Pe=Object(u.f)(Object(u.c)({alert:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"NEW_ALERT":return Object(h.a)(Object(h.a)({},e),{},{notifications:[].concat(Object(f.a)(e.notifications),[Object(h.a)({key:t.value.options.key},t.value)])});case"CLOSE_ALERT":return Object(h.a)(Object(h.a)({},e),{},{notifications:e.notifications.map((function(e){return t.dismissAll||e.key===t.value?Object(h.a)(Object(h.a)({},e),{},{dismissed:!0}):Object(h.a)({},e)}))});case"REMOVE_ALERT":return Object(h.a)(Object(h.a)({},e),{},{notifications:e.notifications.filter((function(e){return e.key!==t.value}))});default:return e}},card:v,chat:b,chatTyping:je,chats:_,controls:E,db:X,functions:K,languages:Q,lightBox:te,notifications:ne,preLoader:oe,search:ce,session:fe,sessionLoads:me,sideModule:ve,timeline:be,toLoad:_e,usersStatus:Ee}),Object(u.a)(Ne,Object(p.routerMiddleware)(s)));Ne.run(Te);var De=Pe,Ae=r(1813),$e=r(9),ze=r(54),Me=r(5),Be=r(3),Ye=r(507),Ge=r(95),Re=r.n(Ge),He=r(38),We=r.n(He),Ue=r(7),Ve=r.n(Ue),qe=r(123),Xe=(r(1687),r(1073),r(39)),Je=r(1698),Ke=r(1784),Ze=r(16),Qe=r(1783),et=Object(Ze.a)((function(e){return{tooltip:{backgroundColor:"#f5f5f9",color:"rgba(0, 0, 0, 0.87)",maxWidth:220,fontSize:e.typography.pxToRem(12),border:"1px solid #dadde9",borderRadius:"7px",boxShadow:"0 0 3px 3px rgba(0,0,0,0.03)",display:"flex",alignItems:"center",justifyContent:"center"}}}))(Qe.a),tt=r(288),rt=r.n(tt);function nt(){nt=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var at=rt.a.create("true"===String("true")?{baseURL:"https://ws.machen.ai"}:{baseURL:"http://localhost:3001"});rt.a.defaults.withCredentials=!0,at.interceptors.request.use(function(){var e=Object(Me.a)(nt().mark((function e(t){var r;return nt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=localStorage.getItem("TOKEN"))&&(t.headers.Authorization="Bearer ".concat(r),t.headers.Accept="application/json;charset=UTF-8;application/x-www-form-urlencoded"),e.abrupt("return",t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),at.interceptors.response.use(function(){var e=Object(Me.a)(nt().mark((function e(t){return nt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve(t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),(function(e){var t=Promise.reject(e.response);return e&&e.response&&e.response.status&&401===e.response.status&&"/login"!==window.location.pathname&&"/register"!==window.location.pathname&&"/activate"!==window.location.pathname&&(localStorage.setItem("TOKEN",null),localStorage.clear(),window.open("/login","_self")),t}));var ot=at;function it(){it=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}r(168).config();var ct=window.location.hostname.indexOf("localhost")>-1&&"true"===String("true"),lt=function(e,t){if(e){var r=De.getState().languages||{},n=De.getState().session,a=n&&n.language?n.language:"pt-BR",o=e;if(!(e&&e.indexOf("$__")>-1))return e;e.split(" ").map((function(e,t){if(e&&e.indexOf("$__")>-1){var n=e.replace("$__","").trim().toLowerCase();ct&&!r[n]&&ot.post("language/add",{name:n}),r[n]&&r[n].locales.filter((function(e){return e.locale===a})).length>0&&r[n].locales.filter((function(e){return e.locale===a}))[0].name&&(o=o.replace("".concat(e),"".concat(t>0?" ":"").concat(r[n].locales.filter((function(e){return e.locale===a}))[0].name)))}}));var i=o;if(!i)return"";if(!t)return i;if("*"===t)return i.toUpperCase();if(1===t)return i.substring(0,1).toUpperCase().concat(i.substring(1))}};function st(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"<br/>",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"<br>";if("undefined"===typeof e||null===e)return"";var a=t||"undefined"===typeof t?r:n;return(e+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1"+a+"$2")}function ut(e,t){if(/^#([0-9a-f]{3}|[0-9a-f]{6})$/gi.test(e)){var r=e.substr(1);r=3==r.length?r.replace(/(.)/g,"$1$1"):r;var n=parseInt(r,16);return"rgba(".concat([n>>16&255,n>>8&255,255&n],", ").concat(t||1,")")}return t&&e&&e.indexOf("rgb")>-1&&-1===e.indexOf("rgba")?e.replace(")",", ".concat(t,")")).replace("rgb(","rgba("):e}function dt(e,t){if(De)return ut(De.getState().session.custom[e],t)||e}function pt(e){return!!/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i.test(e)}function ft(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Re()(JSON.stringify(e)).toString(),r=e.content?e.content:e.message;e.confirm&&(r=i.a.createElement("div",{style:{minWidth:"300px"}},r,i.a.createElement("div",{style:{display:"flex",width:"100%",marginTop:15,justifyContent:"center"}},i.a.createElement(At,{shadow:!0,title:lt("$__confirm"),text:lt("$__confirm"),color:"green",icon:"check",size:"25px",onClick:function(){e.confirm(),qe.b.dismiss(t)}}),i.a.createElement(At,{shadow:!0,title:lt("$__cancel"),text:lt("$__cancel"),color:"red",icon:"close",size:"25px",onClick:function(){qe.b.dismiss(t)},style:{marginLeft:15}})))),e.buttons&&e.buttons.length>0&&(r=i.a.createElement("div",{style:{minWidth:"300px"}},r,i.a.createElement("div",{style:{width:"100%",marginTop:15,justifyContent:"center"}},e.buttons.map((function(r,n){return i.a.createElement(At,Object.assign({key:n},r,{style:Object(h.a)(Object(h.a)({},e&&e.style?e.style:{}),{},{marginBottom:10}),onClick:function(){r.onClick&&r.onClick(),qe.b.dismiss(t)}}))})))));var n=Object(h.a)(Object(h.a)(Object(h.a)({toastId:t,position:qe.b.POSITION.BOTTOM_RIGHT},e.options?e.options:{}),e.persist?{}:{autoClose:e.autoClose?e.autoClose:2e3}),{},{style:{minWidth:"300px"}});return"left"===e.horizontal&&(n=Object(h.a)(Object(h.a)({},n),{},{position:qe.b.POSITION.BOTTOM_LEFT})),"right"===e.horizontal&&(n=Object(h.a)(Object(h.a)({},n),{},{position:qe.b.POSITION.BOTTOM_RIGHT})),"center"===e.horizontal&&(n=Object(h.a)(Object(h.a)({},n),{},{position:qe.b.POSITION.BOTTOM_CENTER})),qe.b.isActive(t)||("info"!==e.variant&&e.variant||qe.b.info(r,n),"success"===e.variant&&qe.b.success(r,n),"warning"===e.variant&&qe.b.warn(r,n),"error"===e.variant&&qe.b.error(r,n)),!0}var ht=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!e)return"";var r=e.replace(/\D/g,"");if((r.match(/./g)||[]).length>1){var n=(r=e.replace(",",".")).split(".");if(1===n.length)return parseFloat(r);r=r.replaceAll(".".concat(n[n.length-1]),""),r=String(r).replaceAll(".","");var a=n[n.length-1].substring(0,t);r="".concat(r,".").concat(a)}return r},mt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"decimal",r=arguments.length>2?arguments[2]:void 0;if(!e)return"";var n=De.getState(),a=n.session,o=String(e).replace(",","."),i=t;if("number"===i||"time"===i||"decimal"===i)i="decimal";else{if("percent"===i)return"".concat(o,"%");if("currency"!==i)return String(e)}var c=new Intl.NumberFormat(a.custom.locale,{style:i,currency:r||(a.custom.currency?a.custom.currency:"BRL")});return c.setMaximumFractionDigits="number"===t?0:2,c.format(o)},gt=function(){var e=Object(Me.a)(it().mark((function e(t,r,n){var a,o,i,c=arguments;return it().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c.length>3&&void 0!==c[3]&&c[3],a=De.getState(),o=a.db,i="cards",o.cards[r._id]?i="cards":o.users[r._id]&&(i="users"),t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},Object(O.a)({},i,Object(h.a)(Object(h.a)({},De.getState().db[i]),{},Object(O.a)({},r._id,Object(h.a)(Object(h.a)({},De.getState().db[i][r._id]),{},{deleted:!0}))))));case 5:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),vt=function(e){for(var t="\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\u0154\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff\u0155",r="",n=0;n<e.length;n++){for(var a=!1,o=0;o<t.length;o++)if(e.substr(n,1)==t.substr(o,1)){r+="AAAAAAACEEEEIIIIDNOOOOOOUUUUYRsBaaaaaaaceeeeiiiionoooooouuuuybyr".substr(o,1),a=!0;break}0==a&&(r+=e.substr(n,1))}return r},yt=function(e,t,r){if(!t||t&&!t.trim())return i.a.createElement("span",{style:{wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:st(e)}});var n=st(e).split(new RegExp("(".concat(t.replace("*.","."),")"),"gi"));return i.a.createElement("span",null," ",n.map((function(e,n){return i.a.createElement("span",{key:n,style:e.toLowerCase()===t.toLowerCase()?{fontWeight:"bold",paddingTop:"3px",paddingBottom:"3px",backgroundColor:"#ffff00b3",color:r?"#000000 !important":""}:{},dangerouslySetInnerHTML:{__html:st(e)}})}))," ")},bt=function(e){var t=st(e).split("\n"),r="";return t.map((function(e){e.split(" ").map((function(e){var t=e.split("\n");if(t.length>0)t.map((function(e){if(e.indexOf(".youtube.com/watch?")>-1){var t=e.split("?")[1].split("v=")[1].split("&")[0];t&&(r+='<iframe width="560" height="315" style="width:100%; max-width:500px" src="https://www.youtube.com/embed/'.concat(t,'" title="YouTube video player" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'))}else if(e.indexOf("//youtu.be/")>-1){var n=e.split(".be/")[1];n&&(r+='<iframe width="560" height="315" style="width:100%; max-width:500px" src="https://www.youtube.com/embed/'.concat(n,'" title="YouTube video player" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'))}else e.indexOf("http://")>-1||e.indexOf("https://")>-1?r+='<a style="word-break:break-all" href="'.concat(e.replace("<br/>",""),'" target="_blank">').concat(e,"</a>"):r+=e})),r+=" ";else if(t[0].indexOf(".youtube.com/watch?")>-1&&t[0].split("?").length>1&&t[0].split("?")[1].split("v=").length>1){var n=t[0].split("?")[1].split("v=")[1].split("&")[0];n&&(r+='<iframe width="560" height="315" style="width:100%; max-width:500px" src="https://www.youtube.com/embed/'.concat(n,'" title="YouTube video player" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'))}else t[0].indexOf("http://")>-1||t[0].indexOf("https://")>-1?r+='<a href="'.concat(t[0].replace("<br/>",""),'" target="_blank">').concat(t[0]," </a>"):r+="".concat(e," ")})),r+=""})),r},xt=function(){var e=De.getState().session,t={};return e&&e._access&&(t=e._access),t},_t=function(){var e=Object(Me.a)(it().mark((function e(t,r){var n,a,o=arguments;return it().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=o.length>2&&void 0!==o[2]&&o[2],a=De.getState(),a.db,n){e.next=14;break}return e.prev=3,e.next=6,ot.put("/node/favorite",{_id:r});case 6:e.sent,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(3),console.log(e.t0);case 12:e.next=23;break;case 14:return e.prev=14,e.next=17,ot.delete("/node/favorite/".concat(r));case 17:e.sent,e.next=23;break;case 20:e.prev=20,e.t1=e.catch(14),console.log(e.t1);case 23:case"end":return e.stop()}}),e,null,[[3,9],[14,20]])})));return function(t,r){return e.apply(this,arguments)}}(),wt=function(e){for(var t=e;1===t.length;)t="0"+t;return t},Et=function(e,t){var r,n,a,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#FFFFFF",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#000000",c=e;if(c.indexOf("rgba")>-1){var l=(c=c.replace("rgba(","")).split(",");r=l[0],n=l[1],a=l[2]}else{if(0===c.indexOf("#")&&(c=c.slice(1)),3===c.length&&(c=c[0]+c[0]+c[1]+c[1]+c[2]+c[2]),6!==c.length)throw new Error("Invalid HEX color.");r=parseInt(c.slice(0,2),16),n=parseInt(c.slice(2,4),16),a=parseInt(c.slice(4,6),16)}return t?.299*r+.587*n+.114*a>186?i:o:(r=(255-r).toString(16),n=(255-n).toString(16),a=(255-a).toString(16),"#"+wt(r)+wt(n)+wt(a))},Ot=function(e){var t=0;return t=e.low?parseInt(e.low):parseInt(e),Ve()(new Date).tz("America/Sao_Paulo").format("DD/MM/YYYY")===Ve()(1e3*t).tz("America/Sao_Paulo").format("DD/MM/YYYY")?Ve()(1e3*t).tz("America/Sao_Paulo").format("H:mm"):Ve()(new Date).tz("America/Sao_Paulo").format("YYYY")===Ve()(1e3*t).tz("America/Sao_Paulo").format("YYYY")?Ve()(1e3*t).tz("America/Sao_Paulo").format("DD/MM H:mm"):Ve()(1e3*t).tz("America/Sao_Paulo").format("DD/MM/YYYY H:mm")};function jt(e){return e>=1073741824?e=(e/1073741824).toFixed(2)+" GB":e>=1048576?e=(e/1048576).toFixed(2)+" MB":e>=1024?e=(e/1024).toFixed(2)+" KB":e>1?e+=" bytes":1==e?e+=" byte":e="0 bytes",e}function St(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(0===e)return"0 Bytes";var r=1024,n=t<0?0:t,a=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],o=Math.floor(Math.log(e)/Math.log(r));return parseFloat((e/Math.pow(r,o)).toFixed(n))+" "+a[o]}function kt(e){return i.a.createElement(et,{title:e.title?lt(e.title,1):""},"string"===typeof e.icon||"string"===typeof e.children?i.a.createElement(Ke.a,{className:e.className?e.className:"",style:Object(h.a)({position:"".concat(e.static?"static":""),display:"flex",justifyContent:"center",alignItems:"center",height:e.size||"22px",width:e.size||"22px",fontSize:e.size||"22px",color:e.color||dt("medium"),opacity:e.disabled?"0.5":"1",cursor:e.onClick?"pointer":""},e.style),onClick:e.onClick?function(t){e.onClick(),t.preventDefault(),t.stopPropagation()}:null},e.icon||e.children):i.a.createElement(e.icon,{className:e.className?e.className:"",style:Object(h.a)({width:e.size||"22px",height:e.size||"22px",fontSize:e.size||"22px",color:e.color||dt("medium"),opacity:e.disabled?"0.5":"1",cursor:e.onClick?"pointer":"",margin:"auto"},e.style),onClick:e.onClick?function(t){e.onClick(),t.preventDefault(),t.stopPropagation()}:null}))}var Lt=r(1785),Ct=r(1786),It=Object(Lt.a)((function(e){return{root:{position:"relative"},bottom:{color:e.palette.grey["light"===e.palette.type?200:700],position:"absolute",left:0},top:{color:dt("ColumnTitleColor"),animationDuration:"550ms",position:"absolute",left:0},circle:{strokeLinecap:"round"}}}));var Ft=function(e){var t=It();return i.a.createElement("div",{className:t.root,style:{width:e.size?e.size:"25px",height:e.size?e.size:"25px"}},i.a.createElement(Ct.a,Object.assign({variant:"determinate",className:t.bottom,size:e.size?e.size:25,thickness:4},e,{value:100})),i.a.createElement(Ct.a,Object.assign({variant:"indeterminate",disableShrink:!0,className:t.top,classes:{circle:t.circle},size:e.size?e.size:25,thickness:4},e)))},Tt=r(1018),Nt=r(1697),Pt=r(1787),Dt=Object(Lt.a)((function(e){return{root:{"& .MuiIconButton-root":{padding:"3px",fontSize:"none !important"}},iconButtonStyleTransaparent:{padding:"3px",margin:0,"&:hover":{backgroundColor:"rgba(250,250,250,0.2)"}},iconButtonStyleWhite:{padding:"3px !important",margin:0,backgroundColor:"#FFFFFF","&:hover":{backgroundColor:"rgba(250,250,250,0.9)"}},shadow:{boxShadow:"0 0px 5px rgb(0 0 0 / 20%)"},iconText:{display:"flex",alignItens:"center"},iconText_Text:{marginLeft:"15px"},badge:{fontSize:"11px",whiteSpace:"nowrap"}}}));var At=function(e,t){var r=Dt();return i.a.createElement("div",{className:r.root,style:Object(h.a)({},e.style?e.style:{})},i.a.createElement(et,{title:e.title?e.title:"INSERT_BUTTON_TITLE"},i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},e.text&&i.a.createElement(Nt.a,Object.assign({disabled:!!e.load||!!e.disabled,onClick:e.onClick?function(t){t.preventDefault(),t.stopPropagation(),e.onClick()}:null},e.shadow?{className:"".concat(e.transparent?r.iconButtonStyleTransaparent:r.iconButtonStyleWhite)+" "+r.shadow}:{className:"".concat(e.transparent?r.iconButtonStyleTransaparent:r.iconButtonStyleWhite)},e.buttonStyle?{style:e.buttonStyle}:{}),i.a.createElement("div",{className:r.iconText},e.load?i.a.createElement("div",null,i.a.createElement(Ft,{size:25,style:{margin:"auto",display:"flex"}}),i.a.createElement("span",{style:{marginLeft:"15px",color:"lightgray"}},e.loadText?e.loadText:lt("$__saving"))):i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},e.icon?i.a.createElement(Pt.a,{overlap:"rectangular",badgeContent:e.badgeContent,classes:{badge:r.badge},color:"secondary"},i.a.createElement(kt,{usePropagation:!!e.usePropagation,size:e.size?e.size:"22px",color:e.color?e.color:dt("menu"),icon:e.icon?e.icon:"help_outline"})):i.a.createElement(i.a.Fragment,null),i.a.createElement("span",{style:Object(h.a)(Object(h.a)({},e.textSize?{fontSize:e.textSize}:{}),{},{marginLeft:"5px",color:e.textColor?e.textColor:e.color?e.color:dt("menu")})},e.text)))),!e.text&&i.a.createElement(Tt.a,{onClick:e.onClick?function(t){e.onClick(),t.preventDefault(),t.stopPropagation()}:null,className:e.transparent?r.iconButtonStyleTransaparent:r.iconButtonStyleWhite},i.a.createElement(Pt.a,{badgeContent:e.badgeContent,color:"secondary",classes:{badge:r.badge},overlap:"rectangular"},i.a.createElement(kt,{usePropagation:!!e.usePropagation,size:e.size?e.size:"22px",color:e.color?e.color:dt("menu"),icon:e.icon?e.icon:"help_outline"}))))))};function $t(){$t=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}function zt(e){var t=i.a.useState(!!De.getState().session.consent),r=Object(Be.a)(t,2),n=r[0],a=(r[1],i.a.useState(!1)),o=Object(Be.a)(a,2),c=o[0],l=o[1],s=i.a.useState(!1),u=Object(Be.a)(s,2),d=u[0],p=u[1],f=i.a.useState(!0),m=Object(Be.a)(f,2),g=m[0],v=m[1];i.a.useEffect((function(){setTimeout((function(){v(!1)}),6e3)}),[c]);var y=function(){var e=Object(Me.a)($t().mark((function e(){var t;return $t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:v(!0),p(!0),t={accepted_at:"".concat(Ve()().unix("X")),privacy:"Data de cria\xe7\xe3o: 31 de dezembro de 2021, \xdaltima atualiza\xe7\xe3o: 06 de janeiro de 2022",terms:"Data de cria\xe7\xe3o: 31 de dezembro de 2021, \xdaltima atualiza\xe7\xe3o: 06 de janeiro de 2022"},De.getState().functions.socket.emit("data",{module:"user",method:"post",action:"consent"},{version:JSON.stringify(t)});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return d?i.a.createElement(i.a.Fragment,null):i.a.createElement("div",{id:"policyAndTermsConsent"},i.a.createElement(Je.a,{style:{zIndex:3e4,backdropFilter:"blur(7px) sepia(90%)",display:"flex",alignItems:"center",justifyContent:"center"},open:!n,onClick:function(e){}},i.a.createElement("div",{style:Object(h.a)(Object(h.a)(Object(h.a)({position:"fixed"},window.innerWidth>600?{top:77,left:77,right:77,bottom:77}:{top:50,left:7,right:7,bottom:7}),window.innerWidth>600?{zIndex:3}:{zIndex:6e3}),{},{boxShadow:"0px 0px 10px 3px rgba(0,0,0,0.2)",borderRadius:"15px",overflow:"hidden",backgroundColor:"#FFFFFF"})},i.a.createElement("div",{style:{position:"absolute",top:0,left:0,right:0,height:40,background:dt("ColumnTitleColor"),display:"flex",alignItems:"center",justifyContent:"center",color:dt("color"),fontWeight:"bold"}},lt("$__TermsOfUseAndPrivacyPolicy")),i.a.createElement("div",{style:{position:"absolute",top:40,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"}},c?i.a.createElement("iframe",{id:"terms",style:{position:"absolute",top:0,left:0,right:0,bottom:40,width:"100%",height:"calc(100% - 40px)"},width:"100%",height:"100%",src:"https://sonne.global/SONNE-Termos-de-Servicos-2022-01-07.pdf"}):i.a.createElement("iframe",{id:"policy",style:{position:"absolute",top:0,left:0,right:0,bottom:40,width:"100%",height:"calc(100% - 40px)"},width:"100%",height:"100%",onScroll:function(){console.log("scroll")},src:"https://sonne.global/SONNE-Politica-de-Privacidade-2022-01-07.pdf"})),i.a.createElement("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:40,display:"flex",justifyContent:"center"}},i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginLeft:33}},i.a.createElement(At,{id:"policyButtonConsent",title:lt(c?"$__accepted":"$__IReadAndIAgree","*"),text:c?null:lt("$__IReadAndIAgree","*"),color:c?"green":dt("menu"),icon:"verified",onClick:c?null:function(){l(!0)},size:"25px"}),c?lt("$__PrivacyPolicy","*"):i.a.createElement(i.a.Fragment,null)),c&&!g?i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},i.a.createElement(At,{id:"termsofuseButtonConsent",title:lt("$__IReadAndIAgreeTheTermsOfUse","*"),text:lt("$__IReadAndIAgreeTheTermsOfUse","*"),color:dt("menu"),icon:"verified",onClick:function(){y()},size:"25px"})):i.a.createElement(i.a.Fragment,null)))))}function Mt(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;return{type:e,action:t,value:r,next:n,preLoader:a,redirect:o}}function Bt(){Bt=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Yt=Object($e.b)((function(e){return{session:e.session}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState().session,r=i.a.useState(!0),n=Object(Be.a)(r,2),a=(n[0],n[1]),o=i.a.useRef();if(i.a.useEffect((function(){return function(){}}),[]),t&&(!t.require||t.require&&!t.require.licensingAgreement))return i.a.createElement(i.a.Fragment,null);var c=function(){var e=Object(Me.a)(Bt().mark((function e(){var t;return Bt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a(!0),t={accepted_at:"".concat(Ve()().unix("X")),version:"2022-10-24"},De.getState().functions.socket.emit("data",{module:"account",method:"post",action:"agreement"},{version:JSON.stringify(t)});case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return i.a.createElement("div",{id:"licensingAgreement"},i.a.createElement(Je.a,{style:{zIndex:3e4,backdropFilter:"blur(7px) sepia(90%)",display:"flex",alignItems:"center",justifyContent:"center"},open:!0},i.a.createElement("div",{style:Object(h.a)(Object(h.a)(Object(h.a)({position:"fixed"},window.innerWidth>600?{top:77,left:77,right:77,bottom:77}:{top:50,left:7,right:7,bottom:7}),window.innerWidth>600?{zIndex:3}:{zIndex:6e3}),{},{boxShadow:"0px 0px 10px 3px rgba(0,0,0,0.2)",borderRadius:"15px",overflow:"hidden",backgroundColor:"#FFFFFF"})},i.a.createElement("div",{style:{position:"absolute",top:0,left:0,right:0,height:40,background:dt("ColumnTitleColor"),display:"flex",alignItems:"center",justifyContent:"center",color:dt("color"),fontWeight:"bold"}},lt("$__licensingAgreement")),i.a.createElement("div",{style:{position:"absolute",top:40,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"}},i.a.createElement("iframe",{id:"licensing",ref:o,onLoad:function(){console.log(o.current,o.current.contentWindow.window),console.log("licensing")},style:{position:"absolute",top:0,left:0,right:0,bottom:40,width:"100%",height:"calc(100% - 40px)"},width:"100%",height:"100%",src:"https://machen.ai/contracts/MACHEN-Termos-e-Condicoes-Gerais-de-Uso-de-Software-2022-10-24.pdf"})),i.a.createElement("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:40,display:"flex",justifyContent:"center"}},i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginLeft:33}},i.a.createElement(At,{id:"agreementButtonConsent",title:lt("$__IReadAndIAgree","*"),text:lt("$__IReadAndIAgree","*"),color:dt("menu"),icon:"verified",onClick:function(){c()},size:"25px"}))))))})),Gt=r(32),Rt=r(33),Ht=r(43),Wt=r(44),Ut=function(e){Object(Ht.a)(r,e);var t=Object(Wt.a)(r);function r(e){var n;return Object(Gt.a)(this,r),(n=t.call(this,e)).state={hasError:!1,error:null,errorInfo:null},n}return Object(Rt.a)(r,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,errorInfo:t}),console.log(window.location.hostname.indexOf("sonne.machen"),window.location.hostname.indexOf("software.machen")),-1===window.location.hostname.indexOf("sonne.machen")&&-1===window.location.hostname.indexOf("software.machen")&&console.log(e,t)}},{key:"render",value:function(){return this.state.hasError?i.a.createElement("div",null,lt("$__ComponentErrorRefreshOrSupportMessage")):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return{hasError:!0}}}]),r}(i.a.Component),Vt=r(1817),qt=r(1788),Xt=r(1789),Jt=r(1699),Kt=r(59),Zt=function(e){e=(e+="").replace("#","");if(!/[0-9A-Fa-f]/g.test(e)||3!==e.length&&6!==e.length)throw new Error("input is not a valid hex color.");if(3===e.length){var t=e[0],r=e[1],n=e[2];e=t+t+r+r+n+n}var a=(e=e.toUpperCase(e))[0]+e[1],o=e[2]+e[3],i=e[4]+e[5];return parseInt(a,16)+", "+parseInt(o,16)+", "+parseInt(i,16)},Qt={transition:"all 0.33s cubic-bezier(0.685, 0.0473, 0.346, 1)"},er={marginRight:"auto",marginLeft:"auto","&:before,&:after":{display:"table",content:'" "'},"&:after":{clear:"both"}},tr={paddingRight:"15px",paddingLeft:"15px",marginRight:"auto",marginLeft:"auto","@media (min-width: 768px)":{width:"750px"},"@media (min-width: 992px)":{width:"970px"},"@media (min-width: 1200px)":{width:"1170px"},"&:before,&:after":{display:"table",content:'" "'},"&:after":{clear:"both"},"&::-webkit-scrollbar":{width:"4px",height:"4px"},"&::-webkit-scrollbar-button":{width:"0px",height:"0px"},"&::-webkit-scrollbar-thumb":{background:"#e1e1e1",border:"0px none #ffffff",borderRadius:"27px"},"&::-webkit-scrollbar-thumb:hover":{background:"#ffffff"},"&::-webkit-scrollbar-thumb:active":{background:"#000000"},"&::-webkit-scrollbar-track":{background:"#666666",border:"0px none #ffffff",borderRadius:"20px"},"&::-webkit-scrollbar-track:hover":{background:"#666666"},"&::-webkit-scrollbar-track:active":{background:"#333333"},"&::-webkit-scrollbar-corner":{background:"transparent"}},rr={fontFamily:'"Soleto", "Roboto", "Helvetica", "Arial", sans-serif',fontWeight:"300",lineHeight:"1.5em"},nr=["#9c27b0","#ab47bc","#8e24aa","#af2cc5","#7b1fa2"],ar=["#ff9800","#ffa726","#fb8c00","#ffa21a","#f57c00","#faf2cc","#fcf8e3"],or=["#f44336","#ef5350","#e53935","#f55a4e","#d32f2f","#ebcccc","#f2dede"],ir=["#4caf50","#66bb6a","#43a047","#5cb860","#388e3c","#d0e9c6","#dff0d8"],cr=["#00acc1","#26c6da","#00acc1","#00d3ee","#0097a7","#c4e3f3","#d9edf7"],lr=["#e91e63","#ec407a","#d81b60","#eb3573","#c2185b"],sr=["#999","#777","#3C4858","#AAAAAA","#D2D2D2","#DDD","#555555","#333","#eee","#ccc","#e4e4e4","#E5E5E5","#f9f9f9","#f5f5f5","#495057","#e7e7e7","#212121","#c8c8c8","#505050"],ur={boxShadow:"0 10px 30px -12px rgba("+Zt("#000")+", 0.42), 0 4px 25px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt("#000")+", 0.2)"},dr={boxShadow:"0 4px 20px 0 rgba("+Zt("#000")+",.14), 0 7px 10px -5px rgba("+Zt(nr[0])+",.4)"},pr={boxShadow:"0 4px 20px 0 rgba("+Zt("#000")+",.14), 0 7px 10px -5px rgba("+Zt(cr[0])+",.4)"},fr={boxShadow:"0 4px 20px 0 rgba("+Zt("#000")+",.14), 0 7px 10px -5px rgba("+Zt(ir[0])+",.4)"},hr={boxShadow:"0 4px 20px 0 rgba("+Zt("#000")+",.14), 0 7px 10px -5px rgba("+Zt(ar[0])+",.4)"},mr={boxShadow:"0 4px 20px 0 rgba("+Zt("#000")+",.14), 0 7px 10px -5px rgba("+Zt(or[0])+",.4)"},gr={boxShadow:"0 4px 20px 0 rgba("+Zt("#000")+",.14), 0 7px 10px -5px rgba("+Zt(lr[0])+",.4)"},vr=Object(h.a)({background:"linear-gradient(60deg, "+ar[1]+", "+ar[2]+")"},hr),yr=Object(h.a)({background:"linear-gradient(60deg, "+ir[1]+", "+ir[2]+")"},fr),br=Object(h.a)({background:"linear-gradient(60deg, "+or[1]+", "+or[2]+")"},mr),xr=Object(h.a)({background:"linear-gradient(60deg, "+cr[1]+", "+cr[2]+")"},pr),_r=Object(h.a)({background:"linear-gradient(60deg, "+nr[1]+", "+nr[2]+")"},dr),wr=Object(h.a)({background:"linear-gradient(60deg, "+lr[1]+", "+lr[2]+")"},gr),Er=(Zt("#000"),Zt("#000"),Object(h.a)({margin:"0 20px 10px",paddingTop:"10px",borderTop:"1px solid "+sr[8],height:"auto"},rr),{border:"0",borderRadius:"3px",boxShadow:"0 10px 20px -12px rgba("+Zt("#000")+", 0.42), 0 3px 20px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt("#000")+", 0.2)",padding:"10px 0",transition:"all 150ms ease 0s"}),Or=(Zt(sr[6]),Zt("#000"),Zt("#000"),Zt("#000"),{color:sr[2],textDecoration:"none",fontWeight:"300",marginTop:"30px",marginBottom:"25px",minHeight:"32px",fontFamily:"'Roboto', 'Helvetica', 'Arial', sans-serif","& small":{color:sr[1],fontSize:"65%",fontWeight:"400",lineHeight:"1"}}),jr=Object(h.a)(Object(h.a)({},Or),{},{marginTop:"0",marginBottom:"3px",minHeight:"auto","& a":Object(h.a)(Object(h.a)({},Or),{},{marginTop:".625rem",marginBottom:"0.75rem",minHeight:"auto"})}),Sr={button:{minHeight:"auto",minWidth:"auto",backgroundColor:sr[0],color:"#FFF",boxShadow:"0 2px 2px 0 rgba("+Zt(sr[0])+", 0.14), 0 3px 1px -2px rgba("+Zt(sr[0])+", 0.2), 0 1px 5px 0 rgba("+Zt(sr[0])+", 0.12)",border:"none",borderRadius:"3px",position:"relative",padding:"12px 30px",margin:".3125rem 1px",fontSize:"12px",fontWeight:"400",textTransform:"uppercase",letterSpacing:"0",willChange:"box-shadow, transform",transition:"box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1)",lineHeight:"1.42857143",textAlign:"center",whiteSpace:"nowrap",verticalAlign:"middle",touchAction:"manipulation",cursor:"pointer","&:hover,&:focus":{color:"#FFF",backgroundColor:sr[0],boxShadow:"0 14px 26px -12px rgba("+Zt(sr[0])+", 0.42), 0 4px 23px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt(sr[0])+", 0.2)"},"& .fab,& .fas,& .far,& .fal,& .material-icons":{position:"relative",display:"inline-block",top:"0",marginTop:"-1em",marginBottom:"-1em",fontSize:"1.1rem",marginRight:"4px",verticalAlign:"middle"},"& svg":{position:"relative",display:"inline-block",top:"0",width:"18px",height:"18px",marginRight:"4px",verticalAlign:"middle"},"&$justIcon":{"& .fab,& .fas,& .far,& .fal,& .material-icons":{marginTop:"0px",position:"absolute",width:"100%",transform:"none",left:"0px",top:"0px",height:"100%",lineHeight:"41px",fontSize:"20px"}}},fullWidth:{width:"100%"},custom_color:{backgroundColor:dt("color"),boxShadow:"0 2px 2px 0 "+dt("color",.14)+", 0 3px 1px -2px "+dt("color",.2)+", 0 1px 5px 0 rgba("+dt("color",.12),"&:hover,&:focus":{backgroundColor:dt("color"),boxShadow:"0 14px 26px -12px "+dt("color",.42)+", 0 4px 23px 0px "+dt("color",.12)+", 0 8px 10px -5px rgba("+dt("color",.2)}},custom_menuColor:{backgroundColor:dt("menu"),boxShadow:"0 2px 2px 0 "+dt("menu",.14)+", 0 3px 1px -2px "+dt("menu",.2)+", 0 1px 5px 0 rgba("+dt("menu",.12),"&:hover,&:focus":{backgroundColor:dt("menu"),boxShadow:"0 14px 26px -12px "+dt("menu",.42)+", 0 4px 23px 0px "+dt("menu",.12)+", 0 8px 10px -5px rgba("+dt("menu",.2)}},custom_mediumColor:{backgroundColor:dt("medium"),boxShadow:"0 2px 2px 0 "+dt("medium",.14)+", 0 3px 1px -2px "+dt("medium",.2)+", 0 1px 5px 0 rgba("+dt("medium",.12),"&:hover,&:focus":{backgroundColor:dt("medium"),boxShadow:"0 14px 26px -12px "+dt("medium",.42)+", 0 4px 23px 0px "+dt("medium",.12)+", 0 8px 10px -5px rgba("+dt("medium",.2)}},primary:{backgroundColor:nr[0],boxShadow:"0 2px 2px 0 rgba("+Zt(nr[0])+", 0.14), 0 3px 1px -2px rgba("+Zt(nr[0])+", 0.2), 0 1px 5px 0 rgba("+Zt(nr[0])+", 0.12)","&:hover,&:focus":{backgroundColor:nr[0],boxShadow:"0 14px 26px -12px rgba("+Zt(nr[0])+", 0.42), 0 4px 23px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt(nr[0])+", 0.2)"}},info:{backgroundColor:cr[0],boxShadow:"0 2px 2px 0 rgba("+Zt(cr[0])+", 0.14), 0 3px 1px -2px rgba("+Zt(cr[0])+", 0.2), 0 1px 5px 0 rgba("+Zt(cr[0])+", 0.12)","&:hover,&:focus":{backgroundColor:cr[0],boxShadow:"0 14px 26px -12px rgba("+Zt(cr[0])+", 0.42), 0 4px 23px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt(cr[0])+", 0.2)"}},success:{backgroundColor:ir[0],boxShadow:"0 2px 2px 0 rgba("+Zt(ir[0])+", 0.14), 0 3px 1px -2px rgba("+Zt(ir[0])+", 0.2), 0 1px 5px 0 rgba("+Zt(ir[0])+", 0.12)","&:hover,&:focus":{backgroundColor:ir[0],boxShadow:"0 14px 26px -12px rgba("+Zt(ir[0])+", 0.42), 0 4px 23px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt(ir[0])+", 0.2)"}},warning:{backgroundColor:ar[0],boxShadow:"0 2px 2px 0 rgba("+Zt(ar[0])+", 0.14), 0 3px 1px -2px rgba("+Zt(ar[0])+", 0.2), 0 1px 5px 0 rgba("+Zt(ar[0])+", 0.12)","&:hover,&:focus":{backgroundColor:ar[0],boxShadow:"0 14px 26px -12px rgba("+Zt(ar[0])+", 0.42), 0 4px 23px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt(ar[0])+", 0.2)"}},danger:{backgroundColor:or[0],boxShadow:"0 2px 2px 0 rgba("+Zt(or[0])+", 0.14), 0 3px 1px -2px rgba("+Zt(or[0])+", 0.2), 0 1px 5px 0 rgba("+Zt(or[0])+", 0.12)","&:hover,&:focus":{backgroundColor:or[0],boxShadow:"0 14px 26px -12px rgba("+Zt(or[0])+", 0.42), 0 4px 23px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt(or[0])+", 0.2)"}},rose:{backgroundColor:lr[0],boxShadow:"0 2px 2px 0 rgba("+Zt(lr[0])+", 0.14), 0 3px 1px -2px rgba("+Zt(lr[0])+", 0.2), 0 1px 5px 0 rgba("+Zt(lr[0])+", 0.12)","&:hover,&:focus":{backgroundColor:lr[0],boxShadow:"0 14px 26px -12px rgba("+Zt(lr[0])+", 0.42), 0 4px 23px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt(lr[0])+", 0.2)"}},white:{"&,&:focus,&:hover":{backgroundColor:"#FFF",color:sr[0]}},twitter:{backgroundColor:"#55acee",color:"#FFF",boxShadow:"0 2px 2px 0 rgba("+Zt("#55acee")+", 0.14), 0 3px 1px -2px rgba("+Zt("#55acee")+", 0.2), 0 1px 5px 0 rgba("+Zt("#55acee")+", 0.12)","&:hover,&:focus,&:visited":{backgroundColor:"#55acee",color:"#FFF",boxShadow:"0 14px 26px -12px rgba("+Zt("#55acee")+", 0.42), 0 4px 23px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt("#55acee")+", 0.2)"}},facebook:{backgroundColor:"#3b5998",color:"#FFF",boxShadow:"0 2px 2px 0 rgba("+Zt("#3b5998")+", 0.14), 0 3px 1px -2px rgba("+Zt("#3b5998")+", 0.2), 0 1px 5px 0 rgba("+Zt("#3b5998")+", 0.12)","&:hover,&:focus":{backgroundColor:"#3b5998",color:"#FFF",boxShadow:"0 14px 26px -12px rgba("+Zt("#3b5998")+", 0.42), 0 4px 23px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt("#3b5998")+", 0.2)"}},google:{backgroundColor:"#dd4b39",color:"#FFF",boxShadow:"0 2px 2px 0 rgba("+Zt("#dd4b39")+", 0.14), 0 3px 1px -2px rgba("+Zt("#dd4b39")+", 0.2), 0 1px 5px 0 rgba("+Zt("#dd4b39")+", 0.12)","&:hover,&:focus":{backgroundColor:"#dd4b39",color:"#FFF",boxShadow:"0 14px 26px -12px rgba("+Zt("#dd4b39")+", 0.42), 0 4px 23px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt("#dd4b39")+", 0.2)"}},linkedin:{backgroundColor:"#0976b4",color:"#FFF",boxShadow:"0 2px 2px 0 rgba("+Zt("#0976b4")+", 0.14), 0 3px 1px -2px rgba("+Zt("#0976b4")+", 0.2), 0 1px 5px 0 rgba("+Zt("#0976b4")+", 0.12)","&:hover,&:focus":{backgroundColor:"#0976b4",color:"#FFF",boxShadow:"0 14px 26px -12px rgba("+Zt("#0976b4")+", 0.42), 0 4px 23px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt("#0976b4")+", 0.2)"}},pinterest:{backgroundColor:"#cc2127",color:"#FFF",boxShadow:"0 2px 2px 0 rgba("+Zt("#cc2127")+", 0.14), 0 3px 1px -2px rgba("+Zt("#cc2127")+", 0.2), 0 1px 5px 0 rgba("+Zt("#cc2127")+", 0.12)","&:hover,&:focus":{backgroundColor:"#cc2127",color:"#FFF",boxShadow:"0 14px 26px -12px rgba("+Zt("#cc2127")+", 0.42), 0 4px 23px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt("#cc2127")+", 0.2)"}},youtube:{backgroundColor:"#e52d27",color:"#FFF",boxShadow:"0 2px 2px 0 rgba("+Zt("#e52d27")+", 0.14), 0 3px 1px -2px rgba("+Zt("#e52d27")+", 0.2), 0 1px 5px 0 rgba("+Zt("#e52d27")+", 0.12)","&:hover,&:focus":{backgroundColor:"#e52d27",color:"#FFF",boxShadow:"0 14px 26px -12px rgba("+Zt("#e52d27")+", 0.42), 0 4px 23px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt("#e52d27")+", 0.2)"}},tumblr:{backgroundColor:"#35465c",color:"#FFF",boxShadow:"0 2px 2px 0 rgba("+Zt("#35465c")+", 0.14), 0 3px 1px -2px rgba("+Zt("#35465c")+", 0.2), 0 1px 5px 0 rgba("+Zt("#35465c")+", 0.12)","&:hover,&:focus":{backgroundColor:"#35465c",color:"#FFF",boxShadow:"0 14px 26px -12px rgba("+Zt("#35465c")+", 0.42), 0 4px 23px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt("#35465c")+", 0.2)"}},github:{backgroundColor:sr[7],color:"#FFF",boxShadow:"0 2px 2px 0 rgba("+Zt(sr[6])+", 0.14), 0 3px 1px -2px rgba("+Zt(sr[6])+", 0.2), 0 1px 5px 0 rgba("+Zt(sr[6])+", 0.12)","&:hover,&:focus":{backgroundColor:sr[7],color:"#FFF",boxShadow:"0 14px 26px -12px rgba("+Zt(sr[6])+", 0.42), 0 4px 23px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt(sr[6])+", 0.2)"}},behance:{backgroundColor:"#1769ff",color:"#FFF",boxShadow:"0 2px 2px 0 rgba("+Zt("#1769ff")+", 0.14), 0 3px 1px -2px rgba("+Zt("#1769ff")+", 0.2), 0 1px 5px 0 rgba("+Zt("#1769ff")+", 0.12)","&:hover,&:focus":{backgroundColor:"#1769ff",color:"#FFF",boxShadow:"0 14px 26px -12px rgba("+Zt("#1769ff")+", 0.42), 0 4px 23px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt("#1769ff")+", 0.2)"}},dribbble:{backgroundColor:"#ea4c89",color:"#FFF",boxShadow:"0 2px 2px 0 rgba("+Zt("#ea4c89")+", 0.14), 0 3px 1px -2px rgba("+Zt("#ea4c89")+", 0.2), 0 1px 5px 0 rgba("+Zt("#ea4c89")+", 0.12)","&:hover,&:focus":{backgroundColor:"#ea4c89",color:"#FFF",boxShadow:"0 14px 26px -12px rgba("+Zt("#ea4c89")+", 0.42), 0 4px 23px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt("#ea4c89")+", 0.2)"}},reddit:{backgroundColor:"#ff4500",color:"#FFF",boxShadow:"0 2px 2px 0 rgba("+Zt("#ff4500")+", 0.14), 0 3px 1px -2px rgba("+Zt("#ff4500")+", 0.2), 0 1px 5px 0 rgba("+Zt("#ff4500")+", 0.12)","&:hover,&:focus":{backgroundColor:"#ff4500",color:"#FFF",boxShadow:"0 14px 26px -12px rgba("+Zt("#ff4500")+", 0.42), 0 4px 23px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt("#ff4500")+", 0.2)"}},simple:{"&,&:focus,&:hover":{color:"#FFF",background:"transparent",boxShadow:"none"},"&$primary":{"&,&:focus,&:hover,&:visited":{color:nr[0]}},"&$info":{"&,&:focus,&:hover,&:visited":{color:cr[0]}},"&$success":{"&,&:focus,&:hover,&:visited":{color:ir[0]}},"&$warning":{"&,&:focus,&:hover,&:visited":{color:ar[0]}},"&$rose":{"&,&:focus,&:hover,&:visited":{color:lr[0]}},"&$danger":{"&,&:focus,&:hover,&:visited":{color:or[0]}},"&$twitter":{"&,&:focus,&:hover,&:visited":{color:"#55acee"}},"&$facebook":{"&,&:focus,&:hover,&:visited":{color:"#3b5998"}},"&$google":{"&,&:focus,&:hover,&:visited":{color:"#dd4b39"}},"&$linkedin":{"&,&:focus,&:hover,&:visited":{color:"#0976b4"}},"&$pinterest":{"&,&:focus,&:hover,&:visited":{color:"#cc2127"}},"&$youtube":{"&,&:focus,&:hover,&:visited":{color:"#e52d27"}},"&$tumblr":{"&,&:focus,&:hover,&:visited":{color:"#35465c"}},"&$github":{"&,&:focus,&:hover,&:visited":{color:sr[7]}},"&$behance":{"&,&:focus,&:hover,&:visited":{color:"#1769ff"}},"&$dribbble":{"&,&:focus,&:hover,&:visited":{color:"#ea4c89"}},"&$reddit":{"&,&:focus,&:hover,&:visited":{color:"#ff4500"}}},transparent:{"&,&:focus,&:hover":{color:"inherit",background:"transparent",boxShadow:"none"}},disabled:{opacity:"0.65",pointerEvents:"none"},lg:{"&$justIcon":{"& .fab,& .fas,& .far,& .fal,& svg,& .material-icons":{marginTop:"-4px"}},padding:"1.125rem 2.25rem",fontSize:"12px",lineHeight:"1.333333",borderRadius:"0.2rem"},sm:{"&$justIcon":{"& .fab,& .fas,& .far,& .fal,& svg,& .material-icons":{marginTop:"1px"}},padding:"0.40625rem 1.25rem",fontSize:"0.6875rem",lineHeight:"1.5",borderRadius:"0.2rem"},round:{borderRadius:"30px"},block:{width:"100% !important"},link:{"&,&:hover,&:focus":{backgroundColor:"transparent",color:sr[0],boxShadow:"none"}},justIcon:{paddingLeft:"12px",paddingRight:"12px",fontSize:"20px",height:"41px",minWidth:"41px",width:"41px","& .fab,& .fas,& .far,& .fal,& svg,& .material-icons":{marginRight:"0px"},"&$lg":{height:"57px",minWidth:"57px",width:"57px",lineHeight:"56px","& .fab,& .fas,& .far,& .fal,& .material-icons":{fontSize:"32px",lineHeight:"56px"},"& svg":{width:"32px",height:"32px"}},"&$sm":{height:"30px",minWidth:"30px",width:"30px","& .fab,& .fas,& .far,& .fal,& .material-icons":{fontSize:"12px",lineHeight:"29px"},"& svg":{width:"16px",height:"16px"}}}},kr=["color","round","children","fullWidth","disabled","simple","size","block","link","justIcon","className","muiClasses"],Lr=Object(Lt.a)(Sr),Cr=i.a.forwardRef((function(e,t){var r,n=Lr(),a=e.color,o=e.round,c=e.children,l=e.fullWidth,s=e.disabled,u=e.simple,d=e.size,p=e.block,f=e.link,h=e.justIcon,m=e.className,g=e.muiClasses,v=Object(Kt.a)(e,kr),y=We()((r={},Object(O.a)(r,n.button,!0),Object(O.a)(r,n[d],d),Object(O.a)(r,n[a],a),Object(O.a)(r,n.round,o),Object(O.a)(r,n.fullWidth,l),Object(O.a)(r,n.disabled,s),Object(O.a)(r,n.simple,u),Object(O.a)(r,n.block,p),Object(O.a)(r,n.link,f),Object(O.a)(r,n.justIcon,h),Object(O.a)(r,m,m),r));return i.a.createElement(Nt.a,Object.assign({},v,{ref:t,classes:g,className:y}),c)})),Ir=function(e){return{appBar:{backgroundColor:"transparent",boxShadow:"none",borderBottom:"0",marginBottom:"0",position:"absolute",width:"100%",paddingTop:"10px",zIndex:"1029",color:sr[6],border:"0",borderRadius:"3px",padding:"10px 0",transition:"all 150ms ease 0s",minHeight:"50px",display:"block"},container:Object(h.a)(Object(h.a)({},tr),{},{minHeight:"50px"}),flex:{flex:1},title:Object(h.a)(Object(h.a)({},rr),{},{lineHeight:"30px",fontSize:"18px",borderRadius:"3px",textTransform:"none",color:"#FFF",letterSpacing:"unset","&:hover,&:focus":{background:"transparent",color:"#FFF"}}),appResponsive:{top:"8px"},primary:Object(h.a)({backgroundColor:nr[0],color:"#FFF"},Er),info:Object(h.a)({backgroundColor:cr[0],color:"#FFF"},Er),success:Object(h.a)({backgroundColor:ir[0],color:"#FFF"},Er),warning:Object(h.a)({backgroundColor:ar[0],color:"#FFF"},Er),danger:Object(h.a)({backgroundColor:or[0],color:"#FFF"},Er),list:Object(h.a)(Object(h.a)({},rr),{},{fontSize:"12px",margin:0,marginRight:"-15px",paddingLeft:"0",listStyle:"none",color:"#FFF",paddingTop:"0",paddingBottom:"0"}),listItem:Object(O.a)({float:"left",position:"relative",display:"block",width:"auto",margin:"0",padding:"0"},e.breakpoints.down("sm"),{zIndex:"999",width:"100%",paddingRight:"15px"}),navLink:{color:"#FFF",margin:"0 5px",paddingTop:"15px",paddingBottom:"15px",fontWeight:"500",fontSize:"12px",textTransform:"uppercase",borderRadius:"3px",lineHeight:"20px",position:"relative",display:"block",padding:"10px 15px",textDecoration:"none","&:hover,&:focus":{color:"#FFF",background:"rgba("+Zt(sr[17])+", 0.2)"}},listItemIcon:{marginTop:"-3px",top:"0px",position:"relative",marginRight:"3px",width:"20px",height:"20px",verticalAlign:"middle",color:"inherit",display:"inline-block"},listItemText:{flex:"none",padding:"0",minWidth:"0",margin:0,display:"inline-block",position:"relative",whiteSpace:"nowrap"},navLinkActive:{backgroundColor:"rgba("+Zt("#FFF")+", 0.1)"},drawerPaper:Object(h.a)(Object(h.a)(Object(h.a)(Object(h.a)({border:"none",bottom:"0",transitionProperty:"top, bottom, width",transitionDuration:".2s, .2s, .35s",transitionTimingFunction:"linear, linear, ease"},ur),{},{width:260},ur),{},{position:"fixed",display:"block",top:"0",height:"100vh",right:"0",left:"auto",visibility:"visible",overflowY:"visible",borderTop:"none",textAlign:"left",paddingRight:"0px",paddingLeft:"0"},Qt),{},{"&:before,&:after":{position:"absolute",zIndex:"3",width:"100%",height:"100%",content:'""',display:"block",top:"0"},"&:after":{background:"#000",opacity:".8"}}),sidebarButton:{"&,&:hover,&:focus":{color:"#FFF"},top:"-2px"}}},Fr=Object(Lt.a)(Ir);function Tr(e){var t=i.a.useState(!1),r=Object(Be.a)(t,2),n=(r[0],r[1],Fr()),a=e.color,o=(e.brandText,We()(Object(O.a)({}," "+n[a],a)));Jt.a,n.list;return i.a.createElement(qt.a,{position:"static",className:n.appBar+o},i.a.createElement(Xt.a,null,i.a.createElement("div",{style:{display:"flex",justifyContent:"center",width:"100%"}},i.a.createElement("div",{style:{maxWidth:"222px"}},i.a.createElement("img",{src:dt("customLogo"),alt:"logo",style:{width:"100%"}})))))}var Nr={block:{},left:{float:"left!important",display:"block"},right:{margin:"0",fontSize:"12px",float:"right!important",padding:"15px"},footer:Object(h.a)(Object(h.a)({bottom:"0",borderTop:"1px solid "+sr[15],padding:"15px 0"},rr),{},{zIndex:4}),container:Object(h.a)(Object(h.a)({zIndex:3},tr),{},{position:"relative"}),containerFluid:Object(h.a)(Object(h.a)({zIndex:3},er),{},{position:"relative"}),a:{color:nr[0],textDecoration:"none",backgroundColor:"transparent"},list:{marginBottom:"0",padding:"0",marginTop:"0"},inlineBlock:{display:"inline-block",padding:"0",width:"auto"},whiteColor:{"&,&:hover,&:focus":{color:"#FFF"}}},Pr=Object(Lt.a)(Nr);function Dr(e){var t,r,n=Pr(),a=e.fluid,o=e.white,c=(e.rtlActive,We()((t={},Object(O.a)(t,n.container,!a),Object(O.a)(t,n.containerFluid,a),Object(O.a)(t,n.whiteColor,o),t))),l=n.a+We()(Object(O.a)({}," "+n.whiteColor,o));We()((r={},Object(O.a)(r,n.block,!0),Object(O.a)(r,n.whiteColor,o),r));return i.a.createElement("footer",{className:n.footer},i.a.createElement("div",{className:c,style:{display:"flex",justifyContent:"center"}},i.a.createElement("div",{className:n.left},i.a.createElement(Jt.a,{className:n.list})),i.a.createElement("p",{className:n.center},"\xa9 ",1900+(new Date).getYear()," ",i.a.createElement("a",{href:"https://sonne.global",className:l,target:"_blank"},"SONNE GLOBAL")," | ".concat("$__footerDescription"!==lt("$__footerDescription",1)?lt("$__footerDescription",1):""))))}var Ar=r(686),$r=r.n(Ar),zr=(r(754),r(238)),Mr=r.n(zr),Br=r(289),Yr=(r(1093),function(e){return{backdrop:{zIndex:4e3},header:{position:"absolute",top:"0px",left:"0px",right:"0px",height:"50px"},btClose:{position:"absolute",right:"15px",top:"15px"},content:{position:"absolute",top:"50px",bottom:"50px",left:"30px",right:"30px",display:"flex",justifyContent:"center",alignItems:"center"},loader:{position:"absolute",top:"calc(50% - 20px)",left:"calc(50% - 20px)",width:"40px",height:"40px","& .MuiCircularProgress-root":{color:"".concat(dt("color")," !important")}},img:{position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px",backgroundRepeat:"no-repeat",backgroundSize:"contain",backgroundPosition:"center center",display:"flex",alignItems:"center",justifyContent:"center","& img":{width:"auto",height:"auto",maxWidth:"100%",maxHeight:"100%"}},movie:{position:"absolute",width:"-webkit-fill-available",height:"-webkit-fill-available"},embed:{position:"absolute",width:"-webkit-fill-available",height:"-webkit-fill-available"},leftButtom:{position:"absolute",top:"50px",bottom:"50px",left:"0px",width:"30px",display:"flex",alignItems:"center"},rightButtom:{position:"absolute",top:"50px",bottom:"50px",width:"30px",right:"0px",display:"flex",alignItems:"center"},footer:{position:"absolute",bottom:"0px",left:"0px",right:"0px",height:"50px",display:"flex",alignItems:"center",justifyContent:"center"}}}),Gr=r(330),Rr=r.n(Gr);var Hr,Wr,Ur=Object($e.b)((function(e){return{store:{lightbox:e.lightBox}}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Yr)((function(e){var t=e.classes,r=De.getState(),n=r.db,a=r.lightBox,o=i.a.useState(!1),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.useState(!1),d=Object(Be.a)(u,2),p=d[0],f=d[1],m=i.a.useState(!1),g=Object(Be.a)(m,2),v=g[0],y=g[1],b=i.a.useState(null),x=Object(Be.a)(b,2),_=x[0],w=x[1],E=i.a.useState(null),O=Object(Be.a)(E,2),j=O[0],S=O[1],k=i.a.useState(null),L=Object(Be.a)(k,2),C=(L[0],L[1]),I=i.a.useState(!0),F=Object(Be.a)(I,2),T=F[0],N=F[1],P=i.a.useState(.5),D=Object(Be.a)(P,2),A=D[0];D[1],i.a.useEffect((function(){l||(s(!0),window.addEventListener("keydown",(function(e){$(e)}),!1))})),i.a.useEffect((function(){if(a.open&&a.files.length>0&&a.file&&a.file!==_){f(!0),w(a.file);var e=De.getState().lightBox.files.filter((function(e){return e._id===a.file}))[0],t=e&&e.name?e.name.split("."):null,r=e&&e.file?"https://machen.azureedge.net/".concat(encodeURIComponent(e.file)):null,o=e&&e.file?"https://machen.azureedge.net/".concat(e.file):null,i=t.length>0?t[t.length-1]:null;"pdf"===(i?n.fileExtensions.filter((function(e){return e.ext.indexOf(i.toLowerCase())>-1})).length>0?n.fileExtensions.filter((function(e){return e.ext.indexOf(i.toLowerCase())>-1}))[0].viewer:"file":null)&&(N(!0),S(r));n.fileExtensions.filter((function(e){return e.ext.indexOf(i.toLowerCase())>-1})).length>0&&(n.fileExtensions.filter((function(e){return e.ext.indexOf(i.toLowerCase())>-1})).length>0&&n.fileExtensions.filter((function(e){return e.ext.indexOf(i.toLowerCase())>-1}))[0].icon?n.fileExtensions.filter((function(e){return e.ext.indexOf(i.toLowerCase())>-1}))[0].icon:"https://machen.azureedge.net/".concat(e.file)),setTimeout((function(){f(!1),S(r),C(o)}),1e3)}}),[a]);var $=function(e){if(39!==e.keyCode&&40!==e.keyCode&&37!==e.keyCode&&38!==e.keyCode&&27!==e.keyCode||1===De.getState().lightBox.files.length&&27!==e.keyCode)return!1;if(De.getState().lightBox.open){var t;if(De.getState().lightBox.files.map((function(e,r){e._id===De.getState().lightBox.file&&(t=r)})),39===e.keyCode||40===e.keyCode)t+1===De.getState().lightBox.files.length?t=0:t+=1,M("R");else{if(37!==e.keyCode&&38!==e.keyCode)return 27===e.keyCode&&void z();0===t?t=De.getState().lightBox.files.length-1:t-=1,M("L")}f(!0),setTimeout((function(){f(!1)}),1e3)}},z=function(){setTimeout((function(){e.reduxFunction("ASYNC","LIGHTBOX_CLOSE")}),500),window.removeEventListener("keydown",(function(e){$(e)}),!1)},M=function(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;De.getState().lightBox.open&&(f(!0),De.getState().lightBox.files.map((function(e,r){e._id===De.getState().lightBox.file&&(t=r)})),"R"===v||"R"===r?t+1===De.getState().lightBox.files.length?t=0:t+=1:"L"!==v&&"L"!==r||(0===t?t=De.getState().lightBox.files.length-1:t-=1),De.getState().lightBox.files.length>0&&De.getState().lightBox.files[t]&&e.reduxFunction("ASYNC","LIGHTBOX",Object(h.a)(Object(h.a)({},De.getState().lightBox),{},{file:De.getState().lightBox.files[t]._id})),setTimeout((function(){f(!1),y(!1)}),700))};if(!De.getState().lightBox.open&&0===De.getState().lightBox.files.length)return null;var B=De.getState().lightBox.files.filter((function(e){return e._id===_}))[0];if(!B||!B.file)return i.a.createElement(i.a.Fragment,null);var Y=B&&B.name?B.name.split("."):null,G=Y.length>0?Y[Y.length-1]:null,R=G?n.fileExtensions.filter((function(e){return e.ext.indexOf(G.toLowerCase())>-1})).length>0?n.fileExtensions.filter((function(e){return e.ext.indexOf(G.toLowerCase())>-1}))[0].viewer:"file":null,H=j,W=B&&B.file?"https://fl.machen.ai/?arq=".concat(B.file.replace("&","||MCH-ECOM||"),"&name=").concat(B.name.replace("&","||MCH-ECOM||")):null,U=(B.file,B.name,"https://fls.machen.ai/".concat(encodeURIComponent(B.file),"/name/").concat(encodeURIComponent(B.name)));return console.log(U),n.fileExtensions.filter((function(e){return e.ext.indexOf(G.toLowerCase())>-1})).length>0&&(H=n.fileExtensions.filter((function(e){return e.ext.indexOf(G.toLowerCase())>-1})).length>0&&n.fileExtensions.filter((function(e){return e.ext.indexOf(G.toLowerCase())>-1}))[0].icon?n.fileExtensions.filter((function(e){return e.ext.indexOf(G.toLowerCase())>-1}))[0].icon:"https://machen.azureedge.net/".concat(B.file)),i.a.createElement($r.a,{onSwipeMove:function(e,t){e.x>100?y("L"):e.x<-100?y("R"):e.y<-100&&z()},onSwipeEnd:function(e){!1!==v&&M()}},i.a.createElement(Je.a,{className:t.backdrop,open:De.getState().lightBox.open,onClick:function(e){z()}},i.a.createElement("div",{id:"lightBox",className:t.header,onClick:function(e){z(),e.stopPropagation()}},i.a.createElement("div",{className:t.btClose},i.a.createElement(kt,{title:lt("$__close","*"),color:dt("light"),onClick:function(){z()}},"close"))),i.a.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"}},i.a.createElement("div",{className:t.content,style:{zIndex:1e3},onClick:function(e){e.stopPropagation()}},p?i.a.createElement("div",{className:t.loader},i.a.createElement(Ct.a,null)):"img"===R?i.a.createElement("div",{className:t.img},"string"===typeof j&&(-1===j.indexOf("https://")||j.indexOf("svg")>-1)?i.a.createElement(i.a.Fragment,null,"img"===R&&H&&H.indexOf("svg")>-1&&i.a.createElement("a",{href:W},i.a.createElement("div",{style:{color:"#FFFFFF",fontWeight:"bolder",fontSize:"22px"}},i.a.createElement("img",{src:Rr.a,style:{borderRadius:"15px",boxShadow:"0 1px 2px 2px rgba(0,0,0,0.1)",maxWidth:"100%",height:"100%",maxHeight:"100px"}}),lt("$__clickHereToDownload",1)))):i.a.createElement("img",{src:"".concat(H),onError:function(e){return e.target.src=H}})):p||"movie"!==R?p||"microsoft"!==R?p||"text"!==R?!p&&"pdf"===R&&j?i.a.createElement("div",{className:t.embed},T&&i.a.createElement("div",{className:t.loader},i.a.createElement(Ct.a,null)),i.a.createElement("div",{className:t.embed},i.a.createElement("div",{className:t.embed,style:{overflow:"auto"}},i.a.createElement("div",{className:t.embed,style:{zoom:"".concat(100*A,"%")}},i.a.createElement(Ut,null,i.a.createElement("embed",{className:t.embed,id:"embed-docs",onLoad:function(e){e.target.style.display="none",e.target.style.display="flex"},onError:function(e){e.target.style.display="none",e.target.style.display="flex"},src:"".concat(U),d:!0})))))):p||"audio"!==R?p||"file"!==R?p?null:i.a.createElement("embed",{className:t.embed,id:"embed-pdf",onLoad:function(e){e.target.style.display="none",e.target.style.display="flex"},onError:function(e){e.target.style.display="none",e.target.style.display="flex"},src:"https://drive.google.com/viewerng/viewer?embedded=true&url=".concat(j)}):i.a.createElement("a",{href:W},i.a.createElement("div",{style:{color:"#FFFFFF",fontWeight:"bolder",fontSize:"22px"}},lt("$__clickHereToDownload",1))):i.a.createElement(Mr.a,{src:j,autoPlay:!0,controls:!0}):i.a.createElement(i.a.Fragment,null,i.a.createElement(Ut,null,i.a.createElement("embed",{className:t.embed,id:"embed-docs",style:{backgroundColor:"#FFFFFF",padding:15},onLoad:function(e){e.target.style.display="none",e.target.style.display="flex"},onError:function(e){e.target.style.display="none",e.target.style.display="flex"},src:"".concat(U)}))):i.a.createElement(i.a.Fragment,null,i.a.createElement(Ut,null,i.a.createElement("embed",{className:t.embed,id:"embed-docs",onLoad:function(e){e.target.style.display="none",e.target.style.display="flex"},onError:function(e){e.target.style.display="none",e.target.style.display="flex"},src:"https://view.officeapps.live.com/op/embed.aspx?src=".concat(U)}))):i.a.createElement("video",{className:t.movie,src:j,controls:!0})),De.getState().lightBox.files.length>1&&i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:t.leftButtom},i.a.createElement(kt,{title:lt("$__previous","*"),color:dt("light"),size:"33px",onClick:function(){M("L")}},"keyboard_arrow_left")),i.a.createElement("div",{className:t.rightButtom},i.a.createElement(kt,{title:lt("$__next","*"),color:dt("light"),size:"33px",onClick:function(){M("R")}},"keyboard_arrow_right"))),i.a.createElement("div",{className:t.footer,onClick:function(e){e.stopPropagation()}},i.a.createElement("a",{href:W},i.a.createElement(kt,{title:lt("$__download","*"),color:dt("light"),size:"33px"},"get_app"))))))}))),Vr=Xe.default.div(Hr||(Hr=Object(ze.a)(["\n position: relative;\n width: 100%;\n height: 100%;\n padding-top: 20px;\n padding-bottom: 20px;\n"]))),qr=Xe.default.div(Wr||(Wr=Object(ze.a)(["\n position: fixed;\n top: 0;\n left: 0;\n right: 25%;\n width: 100%;\n height: 100%;\n background-color: #ffffffeb;\n z-index: 7000;\n"])));function Xr(e){return i.a.createElement("div",{id:"preloaderComponent"},e.fullScreen?i.a.createElement(qr,null,i.a.createElement(Ct.a,{size:50|e.size})):i.a.createElement(Vr,null,i.a.createElement(Ct.a,null)))}var Jr=function(e){return i.a.createElement("div",{style:{position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px",display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},i.a.createElement("div",{style:{width:"100%",maxWidth:"250px",height:"150px",display:"flex",alignItems:"center",justifyContent:"center"}},i.a.createElement(Xr,null)))},Kr=Object(Lt.a)((function(){return{customColor:{display:"flex",alignItems:"center","& .MuiBadge-badge":{backgroundColor:dt("color"),color:dt("light"),display:"flex",alignItems:"center",zIndex:"1500 !important"}},root:{"& .MuiBadge-badge":{display:"flex",alignItems:"center",zIndex:20}}}})),Zr=Object(Ze.a)((function(e){return{tooltip:{backgroundColor:"#f5f5f9",color:"rgba(0, 0, 0, 0.87)",fontSize:e.typography.pxToRem(12),border:"1px solid #dadde9",borderRadius:"7px",boxShadow:"0 0 3px 3px rgba(0,0,0,0.03)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"1000 !important"}}}))(Qe.a);function Qr(e){var t=Kr(),r=i.a.useState(e.badgeVisible||!1),n=Object(Be.a)(r,2),a=n[0],o=n[1],c=i.a.useState(e.tooltipprops&&e.tooltipprops.open?e.tooltipprops.open:(!e.tooltipprops||"false"!==String(e.tooltipprops.open))&&void 0),l=Object(Be.a)(c,2),s=l[0],u=l[1];return i.a.useEffect((function(){e&&e.tooltipprops&&e.tooltipprops.open&&!s&&u(!0),e&&e.tooltipprops&&s&&"false"===String(e.tooltipprops.open)&&u(!1)})),i.a.createElement("div",{className:t.root},i.a.createElement(Zr,{title:e.title&&"string"===typeof e.title?i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{color:dt("darkText"),display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",height:"auto"}},lt(e.title,1))):e.title?i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:t.customColor},i.a.createElement("div",{style:{position:"relative"}},e.title,e.onClose&&i.a.createElement(Ke.a,{style:{position:"absolute",left:"5px",top:"0px",zIndex:10,cursor:"pointer"},onClick:function(){return e.onClose()},title:"close"},"close")))):"",className:null,open:s,disableFocusListener:!(!e.tooltipprops||!e.tooltipprops.disableFocusListener)&&e.tooltipprops.disableFocusListener,disableHoverListener:!(!e.tooltipprops||!e.tooltipprops.disableHoverListener)&&e.tooltipprops.disableHoverListener,disableTouchListener:!(!e.tooltipprops||!e.tooltipprops.disableTouchListene)&&e.tooltipprops.disableTouchListene,onClose:function(){e.tooltipprops&&e.tooltipprops.onClose&&e.tooltipprops.onClose()},interactive:!("string"===typeof e.title||!e.tooltipprops||!e.tooltipprops.interactive)&&e.tooltipprops.interactive},i.a.createElement(Pt.a,{overlap:"rectangular",badgeContent:e.count,style:{opacity:1,fontSize:"5px"},max:e.max||9,anchorOrigin:{vertical:"top",horizontal:"right"},invisible:e.count&&!a},"string"===typeof e.icon?i.a.createElement(Ke.a,{onMouseEnter:function(){return!e.badgeVisible&&o(!0)},onMouseLeave:function(){return!e.badgeVisible&&o(!1)},onClick:e.onClick?function(t){e.onClick(),t.stopPropagation()}:null,className:e.className,style:Object(h.a)({width:e.size?e.size:"fit-content",height:e.size?e.size:"fit-content",fontSize:e.size||"22px",color:e.color||dt("medium"),opacity:!e.disabled||a?"1":"0.5",cursor:e.onClick?"pointer":""},e.style)},e.icon):i.a.createElement(e.icon,{onMouseEnter:function(){return!e.badgeVisible&&o(!0)},onMouseLeave:function(){return!e.badgeVisible&&o(!1)},onClick:e.onClick?function(t){e.onClick(),t.stopPropagation()}:null,className:e.className,style:Object(h.a)({width:e.size||"22px",height:e.size||"22px",fontSize:e.size||"22px",color:e.color||dt("medium"),opacity:!e.disabled||a?"1":"0.5",cursor:e.onClick?"pointer":""},e.style)}))))}var en={button:Object(h.a)(Object(h.a)({},rr),{},{alignItems:"center",justifyContent:"center",cursor:"pointer",userSelect:"none","&$reverse":{}}),buttonText:Object(h.a)(Object(h.a)({},rr),{},{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",width:"fit-content",userSelect:"none","&$reverse":{},"& :hover":{}}),reverse:{flexDirection:"row-reverse"},iconButton:{width:"21px",height:"21px",display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"10%"},icon:{fontSize:"21px"},onlyIcon:{fontSize:"21px"},text:{marginLeft:"7px",marginRight:"7px"}},tn=Object(Lt.a)(en),rn=i.a.forwardRef((function(e,t){var r,n,a=tn(),o=(e.reverse,e.text),c=We()((r={},Object(O.a)(r,a.button,!0),Object(O.a)(r,a.reverse,!!e.reverse),r)),l=We()((n={},Object(O.a)(n,a.buttonText,!0),Object(O.a)(n,a.reverse,!!e.reverse),n));return i.a.createElement("div",{className:e.text?l:c,onClick:function(){return e.onClick?e.onClick():null},style:Object(h.a)({},e.style)},i.a.createElement("div",{className:a.iconButton,style:{color:e.iconColor?dt(e.iconColor):dt("color"),backgroundColor:e.iconBackground?dt(e.iconBackground):"none"}},e.icon?i.a.createElement(Qr,{className:e.iconBackground?a.icon:a.onlyIcon,size:e.size?e.size:null,icon:e.icon,color:e.iconColor,title:e.title||null,onClick:function(){return e.onClick?e.onClick():null},style:Object(h.a)({},e.style?e.style:{})}):i.a.createElement(Qr,{className:e.iconBackground?a.icon:a.onlyIcon,icon:"stop_circle",color:e.iconColor,title:e.title||null,onClick:function(){return e.onClick?e.onClick():null},style:Object(h.a)({},e.style?e.style:{})})),o&&i.a.createElement("div",{className:a.text,style:{color:e.textColor?dt(e.textColor):dt("medium")}},o))})),nn=r(1731),an=r(83),on=r.n(an);function cn(){cn=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var ln=Object(Lt.a)({users:{position:"relative",bottom:"0px",right:"2px",fontSize:"10px","& .MuiAvatarGroup-root":{justifyContent:"flex-end"},"& .MuiAvatar-root":{width:"25px",height:"25px",fontSize:"10px"}}}),sn=function(e){var t=De.getState(),r=t.session,n=t.functions.socket,a=i.a.useState(e.data),o=Object(Be.a)(a,2),c=o[0],l=o[1],s=ln();i.a.useEffect((function(){l(e.data)}),[e.data]);var u=function(){var t=Object(Me.a)(cn().mark((function t(a,o){var i,s;return cn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n.emit("data",{module:"social",method:"post",action:"interact"},{react:a,user:r._id,nodeId:e.data._id,message:e.data._id,delete:o}),(i=c)&&i._reactions&&Object.keys(i._reactions).length>0&&Object.keys(i._reactions).filter((function(e){return e!==a})).map((function(e){i._reactions[e][r._id]&&delete i._reactions[e][r._id]})),o&&c&&c._reactions&&c._reactions[a]&&c._reactions[a][r._id]?(delete(s=c)._reactions[a][r._id],l(s)):l(Object(h.a)(Object(h.a)({},c),{},{_reactions:Object(h.a)(Object(h.a)({},c._reactions),{},Object(O.a)({},a,Object(O.a)({},r._id,Object(h.a)(Object(h.a)(Object(h.a)(Object(h.a)({},r.displayName?{displayName:r.displayName}:{}),r.name?{name:r.name}:{}),r.image?{image:r.image}:{}),{},{reactDate:{low:Ve()().tz("America/Sao_Paulo").unix("X")}}))))}));case 4:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}();c._reactions&&Object.keys(c._reactions).length>0&&Object.keys(c._reactions).map((function(e){Object.keys(c._reactions[e]).length>0&&Object.keys(c._reactions[e]).map((function(t){t===r._id&&e}))}));var d=function(t){var n=t.react,a=t.color,o=t.primaryIcon,l=t.secondaryIcon;return e.hideDisables&&c&&n&&c._reactions&&(!c._reactions[n]||c._reactions[n]&&0===Object.keys(c._reactions[n]).length)?i.a.createElement(i.a.Fragment,null):i.a.createElement(rn,{icon:c._reactions&&c._reactions[n]&&c._reactions[n][r._id]?o:l||o,iconColor:c._reactions&&c._reactions[n]&&c._reactions[n][r._id]?a||dt("menu"):"lightgray",size:"18px",onClick:function(){u(n,!!(c._reactions&&c._reactions[n]&&c._reactions[n][r._id]))},title:c._reactions&&c._reactions[n]&&Object.keys(c._reactions[n]).length>0?i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{position:"relative",width:"100%",paddingBottom:3,borderBottom:"1px solid lightgray",marginBottom:"7px"}},lt("$__".concat(n),1)),i.a.createElement("div",{className:s.users},Object.keys(c._reactions[n]).sort((function(e,t){return c._reactions[n][e].reactDate&&String(c._reactions[n][e].reactDate.low)&&c._reactions[n][t].reactDate&&String(c._reactions[n][t].reactDate.low)&&parseInt(c._reactions[n][e].reactDate.low)<parseInt(c._reactions[n][t].reactDate.low)?-1:c._reactions[n][e].reactDate&&String(c._reactions[n][e].reactDate.low)&&c._reactions[n][t].reactDate&&String(c._reactions[n][t].reactDate.low)&&parseInt(c._reactions[n][e].reactDate.low)>parseInt(c._reactions[n][t].reactDate.low)?1:0})).map((function(e,t){return i.a.createElement("div",{key:e,style:{position:"relative",display:"flex",alignItems:"center"}},i.a.createElement(nn.a,{alt:c._reactions[n][e].name,src:c._reactions[n][e].image||on.a}),i.a.createElement("span",{style:{paddingLeft:"7px"}},c._reactions[n][e].displayName?c._reactions[n][e].displayName:c._reactions[n][e].name,c._reactions[n][e].reactDate&&c._reactions[n][e].reactDate.low&&" (".concat(Ve()(1e3*c._reactions[n][e].reactDate.low).tz("America/Sao_Paulo").format("DD/MM/YYYY H:mm"),")")))})))):lt("$__".concat(n),1)})};return i.a.createElement("div",{onClick:function(e){e.stopPropagation()}},i.a.createElement("div",{style:{display:"flex",minWidth:"fit-content",justifyContent:"center"}},i.a.createElement(d,{react:"like",primaryIcon:"thumb_up",secondaryIcon:"thumb_up_off_alt"}),i.a.createElement(d,{react:"nolike",primaryIcon:"thumb_down",secondaryIcon:"thumb_down_off_alt"}),i.a.createElement(d,{react:"love",primaryIcon:"favorite",secondaryIcon:"favorite_border",color:"red"}),i.a.createElement(d,{react:"approve",primaryIcon:"verified",color:"green"}),i.a.createElement(d,{react:"attention",primaryIcon:"report_problem",color:"red"}),e.children&&i.a.createElement(i.a.Fragment,null,e.children)))},un={tags:Object(h.a)(Object(h.a)({},rr),{},{position:"absolute",width:"100%",right:"0px",bottom:"-6px",userSelect:"none",height:"6px",marginBottom:"0px",display:"flex",justifyContent:"flex-end",overflow:"hidden","& .tag":{width:"15px",marginRight:"3px",cursor:"pointer",height:"6px",borderRadius:" 0px 0px 3px 3px"}}),tagsOver:Object(h.a)(Object(h.a)({},rr),{},{position:"relative",width:"100%",userSelect:"none",marginTop:"5px",marginBottom:"5px",height:"auto",overflow:"hidden","& .tag":{fontSize:"12px",padding:"0 5px",margin:"3px",borderRadius:" 5px",color:dt("light")}})},dn=r(1011),pn=r(1790),fn=r(1696),hn=r(1020),mn=r(1694);function gn(){gn=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}Object(Lt.a)((function(e){return{iconButtonStyleTransaparent:{padding:"3px",margin:0,"&:hover":{backgroundColor:"rgba(250,250,250,0.9)"}},iconButtonStyleWhite:{padding:"3px",margin:0,backgroundColor:"#FFFFFF","&:hover":{backgroundColor:"rgba(250,250,250,0.9)"}}}}));var vn=function(e){var t=i.a.useState(!1),r=Object(Be.a)(t,2),n=r[0],a=r[1],o=i.a.useState(e.color?e.color:"rgba(200,200,200,1)"),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.useRef(null),d=function(t){u.current&&u.current.contains(t.target)||(a(!1),e.onClose&&e.onClose())},p=function(){var t=Object(Me.a)(gn().mark((function t(r){return gn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.onChange&&e.onChange(r),a(!n),!e._id){t.next=5;break}return t.next=5,ot.put("node/update",{_id:e._id,color:r});case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return i.a.createElement("div",{className:"cardColorPicker",style:Object(h.a)({},e.style?e.style:{}),onClick:function(e){e.stopPropagation(),e.preventDefault()},onDrag:function(e){e.preventDefault(),e.stopPropagation()},onDragStart:function(e){e.preventDefault(),e.stopPropagation()},onDragEnter:function(e){e.preventDefault(),e.stopPropagation()},onDragCapture:function(e){e.preventDefault(),e.stopPropagation()},onDragEnterCapture:function(e){e.preventDefault(),e.stopPropagation()},onDragOver:function(e){e.preventDefault(),e.stopPropagation()}},e.children?i.a.createElement("div",{ref:u,style:{margin:3,cursor:"pointer"},onClick:function(e){a((function(e){return!e}))}},i.a.createElement("div",{onClick:function(e){}},e.children)):i.a.createElement("div",{ref:u,style:Object(h.a)(Object(h.a)({},e.label?{borderRadius:7,padding:7,color:l?Et(l,!0):"#FFFFFF",fontSize:12}:{width:e.size?e.size:21,height:e.size?e.size:21}),{},{margin:3,backgroundColor:l,borderRadius:e.size?e.size:21,cursor:"pointer"}),onClick:function(){a((function(e){return!e}))}},e.label?e.label:""),i.a.createElement(mn.a,{open:n,anchorEl:u.current,role:void 0,transition:!0,disablePortal:!!e.disablePortal},(function(t){var r=t.TransitionProps;t.placement;return i.a.createElement(fn.a,Object.assign({},r,{style:{transformOrigin:"right center"}}),i.a.createElement(hn.a,null,i.a.createElement(pn.a,{onClickAway:d},i.a.createElement("div",{style:{position:"relative",backgroundColor:"#FFFFFF",boxShadow:"0px 0px 10px 5px rgba(0,0,0,0.17)",borderRadius:7},onClick:function(e){e.stopPropagation()}},i.a.createElement("div",{style:{position:"relative",width:"100%",display:"flex",marginTop:"-5px",justifyContent:"end"}},i.a.createElement(At,{title:lt("$__cancel",1),color:"lightgrey",icon:"close",onClick:function(){s(e.color?e.color:"rgba(200,200,200,1)"),a(!n)},size:"30px"}),e.color?i.a.createElement(At,{title:lt("$__removeColor",1),color:"red",icon:"format_color_reset",onClick:function(){p(null)},size:"30px"}):i.a.createElement(i.a.Fragment,null),i.a.createElement(At,{title:lt("$__saveColor",1),color:"green",icon:"save",onClick:function(){p(l)},size:"30px"})),i.a.createElement(dn.a,{color:l,onChange:function(e,t){s("rgba(".concat(e.rgb.r,", ").concat(e.rgb.g,", ").concat(e.rgb.b,", ").concat(e.rgb.a,")")),t.stopPropagation()},disableAlpha:!0}),i.a.createElement("div",{style:{clear:"both"}})))))})))},yn=Object(Lt.a)(un);var bn=function(e){var t=yn(),r=i.a.useState(!!e.showOptions),n=Object(Be.a)(r,2),a=n[0],o=n[1],c=i.a.useState(!1),l=Object(Be.a)(c,2),s=l[0],u=l[1],d=i.a.useState([]),p=Object(Be.a)(d,2),f=p[0],m=p[1];return i.a.useEffect((function(){return m(De.getState().db[e.dbNode?e.dbNode:"tag"]),function(){m([]),u(!1)}}),[e.options]),i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:a||e.expanded?t.tagsOver:t.tags,onClick:function(t){e.options&&e.options.length>0&&!a&&o(!0),t.stopPropagation()},onMouseOver:function(){u(!0)},onMouseLeave:function(){setTimeout((function(){u(!1)}),500)}},f&&f.length>0&&e.options&&e.options.filter((function(e){return e.value})).map((function(t,r){var n=t;if(De.getState().db.tag.filter((function(e){return e.value===t.value})).length>0){n=De.getState().db.tag.filter((function(e){return e.value===t.value}))[0];var c=f.filter((function(e){return e.value===n.value})).length>0&&f.filter((function(e){return e.value===n.value}))[0].color?f.filter((function(e){return e.value===n.value}))[0].color:dt("medium");return i.a.createElement("div",{key:r,className:"tag",style:Object(h.a)({position:"relative",float:"left",whiteSpace:"nowrap",backgroundColor:c},e.rounded?{borderRadius:"7px !important"}:{}),onClick:function(){e.colorPicker||e.showOptions||o(!1)}},!e.showOptions&&a&&e.colorPicker?i.a.createElement(vn,{label:n.label,color:c,_id:n.value,onChange:function(e){var t=n;t.color=e,De.getState().functions.socket.emit("tag.UPD",t)}}):(a||e.expanded)&&i.a.createElement("div",{className:"tag",style:Object(h.a)({backgroundColor:c,color:n.color?Et(n.color,!0):"#FFFFFF"},e.rounded?{borderRadius:"7px !important"}:{})},n.label))}})),!e.showOptions&&a&&!e.expanded&&s&&i.a.createElement("div",{style:{position:"absolute",top:"0",right:"0"}},i.a.createElement(Qe.a,{title:lt("$__hideTags")},i.a.createElement(i.a.Fragment,null,i.a.createElement(Tt.a,{onClick:function(t){e.showOptions||o(!1)}},i.a.createElement(kt,{size:"22px",color:dt("medium"),icon:"visibility_off"})))))))},xn=r(1792),_n=r(1791),wn=Object(Lt.a)((function(e){return{iconButtonStyleTransaparent:Object(h.a)({padding:"3px",margin:0,"&:hover":{backgroundColor:"rgba(250,250,250,0.9)"}},e.buttonStyle?e.buttonStyle:{}),iconButtonStyleWhite:Object(h.a)({padding:"3px",margin:0,backgroundColor:"#FFFFFF","&:hover":{backgroundColor:"rgba(250,250,250,0.9)"}},e.buttonStyle?e.buttonStyle:{})}}));var En=Object(o.memo)((function(e){var t=wn(),r=i.a.useState(!1),n=Object(Be.a)(r,2),a=n[0],o=n[1],c=i.a.useRef(null),l=function(t){t.preventDefault(),t.stopPropagation(),c.current&&c.current.contains(t.target)||(o(!1),e.onClose&&e.onClose())};function s(t){"Tab"===t.key&&(t.preventDefault(),o(!1),e.onClose&&e.onClose())}return e.options&&0!==e.options.length?i.a.createElement("div",{style:Object(h.a)({zIndex:"100 !important"},e.style?e.style:{})},i.a.createElement(Qe.a,{title:e.title?e.title:lt("$__options",1)},e.text?i.a.createElement(Nt.a,{ref:c,"aria-controls":a?"menu-list-grow":void 0,"aria-haspopup":"true","aria-label":"menu",onClick:function(t){o((function(e){return!e})),!a&&e.onOpen&&e.onOpen(),a&&e.onClose&&e.onClose(),t.stopPropagation()},className:e.transparent?t.iconButtonStyleTransaparent:t.iconButtonStyleWhite},i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{style:{marginRight:"15px",color:e.textColor?e.textColor:e.color?e.color:dt("menu"),overflow:"hidden",textOverflow:"ellipsis",width:"90%",maxWidth:e.maxWidth?e.maxWidth:"90%",whiteSpace:"nowrap"}},e.text),i.a.createElement(kt,{count:e.count?e.count:null,usePropagation:!0,size:e.size?e.size:"20px",color:e.btColor?e.btColor:dt("menu"),icon:e.icon?e.icon:e.horizontalButton?"more_horiz":"more_vert"}))):i.a.createElement(Tt.a,{ref:c,"aria-controls":a?"menu-list-grow":void 0,"aria-haspopup":"true","aria-label":"menu",onClick:function(t){o((function(e){return!e})),!a&&e.onOpen&&e.onOpen(),a&&e.onClose&&e.onClose(),t.stopPropagation()},className:e.transparent?t.iconButtonStyleTransaparent:t.iconButtonStyleWhite},i.a.createElement(kt,{count:e.count?e.count:null,usePropagation:!0,size:e.size?e.size:"20px",color:e.btColor?e.btColor:dt("menu"),icon:e.icon?e.icon:e.horizontalButton?"more_horiz":"more_vert"}))),i.a.createElement(mn.a,{open:a,anchorEl:c.current,role:void 0,transition:!0,style:{zIndex:"100 !important"}},(function(t){var r=t.TransitionProps;t.placement;return i.a.createElement(fn.a,Object.assign({},r,{style:{transformOrigin:"right center",zIndex:"100 !important"}}),i.a.createElement(hn.a,null,i.a.createElement(pn.a,{onClickAway:l},i.a.createElement(_n.a,{autoFocusItem:a,id:"menu-list-grow",onKeyDown:s,style:{zIndex:"100 !important"}},e.options.filter((function(e){return e&&!e.hide})).map((function(t,r){return i.a.createElement(xn.a,{key:r,style:{color:t&&t.color?t.color:dt("menu"),padding:"12px 7px"},onClick:function(r){e.forceStopPropagation||o(!1),e.onClose&&e.onClose(),t.onClick&&t.onClick(),r.preventDefault(),r.stopPropagation()},disabled:!!t.disabled},t.render?t.render:t.avatar?i.a.createElement(nn.a,{alt:t.name,src:t.avatar||null,style:{width:e.size?e.size:"20px",height:e.size?e.size:"20px"}},t.name.substr(0,1)):i.a.createElement(Pt.a,{overlap:"rectangular",badgeContent:t.count?t.count:null,color:"secondary"},i.a.createElement(kt,{usePropagation:!0,icon:t.icon,style:{margin:"none !important"},color:t.iconColor?t.iconColor:t.color?t.color:dt("menu")})),!t.render&&i.a.createElement("span",{style:{marginLeft:"7px"}},lt(t.name,1)))}))))))}))):i.a.createElement(i.a.Fragment,null)}));function On(){On=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}rt.a.defaults.headers.post["Content-Type"]="application/json; charset=UTF-8";var jn=rt.a.create("true"===String("true")?{baseURL:"https://machen.azurewebsites.net/api"}:{baseURL:"http://localhost:7071/api"});rt.a.defaults.withCredentials=!0,jn.interceptors.request.use(function(){var e=Object(Me.a)(On().mark((function e(t){var r;return On().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.headers["Content-Type"]="".concat(t.headers["Content-Type"]?"".concat(t.headers["Content-Type"]):"application/json","; charset=UTF-8;"),r=localStorage.getItem("TOKEN")||"","null"!==String(r)&&""!==String(r)&&"undefined"!==String(r)&&(t.headers.Authorization="Bearer ".concat(r),t.headers.Accept="application/json;charset=UTF-8;application/x-www-form-urlencoded"),e.abrupt("return",t);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),jn.interceptors.response.use(function(){var e=Object(Me.a)(On().mark((function e(t){return On().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve(t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),(function(e){var t=Promise.reject(e.response);return e&&e.response&&e.response.status&&401===e.response.status&&"/login"!==window.location.pathname&&"/register"!==window.location.pathname&&"/activate"!==window.location.pathname&&console.log(e),t}));var Sn=jn;r(979);function kn(){kn=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Ln=function(){var e=Object(Me.a)(kn().mark((function e(t,r){var n,a,o,i,c,l=arguments;return kn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=l.length>2&&void 0!==l[2]&&l[2],a=l.length>3?l[3]:void 0,(o=r).originalName=o.name,(i=new FormData).append("file",o,o.name),i.append("id",t),e.next=9,new Promise(function(){var e=Object(Me.a)(kn().mark((function e(t,r){var n,o,l;return kn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!a||!a.onUploadProgress){e.next=9;break}return n=a.onUploadProgress,e.next=5,ot.post("upload/file/",i,{onUploadProgress:n});case 5:(o=e.sent)&&(c=o.data),e.next=13;break;case 9:return e.next=11,ot.post("upload/file/",i);case 11:(l=e.sent)&&(c=l.data);case 13:e.next=19;break;case 15:e.prev=15,e.t0=e.catch(0),a&&a.onUploadError&&a.onUploadError(e.t0),r(!1);case 19:return e.prev=19,t(!0),e.finish(19);case 22:case"end":return e.stop()}}),e,null,[[0,15,19,22]])})));return function(t,r){return e.apply(this,arguments)}}());case 9:if(!e.sent){e.next=18;break}if(n){e.next=15;break}return e.abrupt("return","https://machen.azureedge.net/".concat(c.file));case 15:return e.abrupt("return",c);case 16:e.next=19;break;case 18:return e.abrupt("return",!1);case 19:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}();function Cn(){Cn=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var In=function(){var e=Object(Me.a)(Cn().mark((function e(t,r){var n,a,o,i,c,l,s,u,d,p,f,m,g,v,y,b,x,_,w,E,j,S,k,L,C,I,F,T,N,P,D,A,$,z,M,B,Y;return Cn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.idRel,a=r.adminView,o=void 0!==a&&a,i=r.callback,c=void 0===i?null:i,l=r.cardLoad,s=void 0===l?"my":l,u=r.completed,d=void 0!==u&&u,p=r.status,f=r.deleted,m=void 0!==f&&f,g=r.archived,v=void 0!==g&&g,y=r.templates,b=void 0!==y&&y,x=r.allStatus,_=void 0!==x&&x,w=r.search,E=void 0===w?"":w,j=r.completedDays,S=void 0===j?7:j,k=r.limit,L=void 0===k?0:k,C=r.skip,I=void 0===C?0:C,F=r.startDate,T=void 0===F?null:F,N=r.endDate,P=void 0===N?null:N,D=!!r.ignoreLoader,("search"===s||t.ignoreLoader)&&(D=!0),A=De.getState(),$=A.sessionLoads,z=Object(h.a)({},$.cards.load),M=Re()("".concat(JSON.stringify(r))).toString(),!(Object.keys(z).length>0&&z[M])){e.next=8;break}return e.abrupt("return",!0);case 8:return D||t.reduxFunction("ASYNC","SET_SESSION_LOADS",Object(h.a)(Object(h.a)({},De.getState().sessionLoads),{},{cards:Object(h.a)(Object(h.a)({},De.getState().sessionLoads.cards),{},{load:Object(h.a)(Object(h.a)({},De.getState().sessionLoads.cards.load),{},Object(O.a)({},M,D?"completed":"loading"))})})),B=(B=String(De.getState().session.dashboard.period).replace("$__last","")).replace("Days",""),e.next=13,new Promise(function(){var e=Object(Me.a)(Cn().mark((function e(r){var a,i,l;return Cn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Sn.post("/Card_List/",Object(h.a)(Object(h.a)(Object(h.a)({idRel:n,adminView:o,load:s,completed:d,archived:v,templates:b,status:p,allStatus:_,limit:L,skip:I,startDate:T,endDate:P},d?{completedDays:S||B}:{}),E?{search:E}:{}),m?{deleted:!0}:{}));case 3:if(!(a=e.sent)||!a.data){e.next=10;break}return i=a.data,e.next=8,Fn(t,i);case 8:(l=e.sent)&&(t.reduxFunction("ASYNC","SET_SESSION_LOADS",Object(h.a)(Object(h.a)({},De.getState().sessionLoads),{},{cards:Object(h.a)(Object(h.a)({},De.getState().sessionLoads.cards),{},{load:Object(h.a)(Object(h.a)({},De.getState().sessionLoads.cards.load),{},Object(O.a)({},M,"completed"))})})),c&&c(),r({total:i.length,cards:l}));case 10:e.next=16;break;case 12:e.prev=12,e.t0=e.catch(0),console.log("loadCards::ERR::"),console.log(e.t0);case 16:case"end":return e.stop()}}),e,null,[[0,12]])})));return function(t){return e.apply(this,arguments)}}());case 13:if(!(Y=e.sent)){e.next=17;break}return t.reduxFunction("ASYNC","preLoader",Object(h.a)(Object(h.a)({},De.getState().preLoader),{},{cards:!1})),e.abrupt("return",Y);case 17:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),Fn=function(){var e=Object(Me.a)(Cn().mark((function e(t){var r,n,a,o,i,c=arguments;return Cn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=c.length>1&&void 0!==c[1]?c[1]:[],n=De.getState(),a=n.session,o=function(e){return!!(e&&e.data&&e.data._id&&(!e.data.private||!1===e.data.private||e.data.private&&e.users.filter((function(e){return e._id===a._id})).length>0))},e.next=5,new Promise((function(e,t){var n={};r&&r.filter((function(e){return o(e)})).length>0?r.filter((function(e){return o(e)})).map((function(t,i){var c=t.data._id;if(!De.getState().db.cards[t.data._id]){var l={};t.users.length>0&&t.users.map((function(e){var r=null;t&&t.myDayUsers&&t.myDayUsers.filter((function(e){return e._id})).length>0&&(r=t.myDayUsers.filter((function(t){return t._id===e._id})).length>0?t.myDayUsers.filter((function(t){return t._id===e._id}))[0].date:null),l=Object(h.a)(Object(h.a)({},l),{},Object(O.a)({},e._id,Object(h.a)(Object(h.a)({},e),r?{myDay:r}:{})))})),t&&t.data&&t.data.planId&&delete t.data.planId,n=Object(h.a)(Object(h.a)({},n),{},Object(O.a)({},c,Object(h.a)(Object(h.a)(Object(h.a)(Object(h.a)(Object(h.a)(Object(h.a)({},De.getState().db.cards[c]&&De.getState().db.cards[c]._selected?{_selected:!0}:{}),t.data),{},{_isFavorite:"false"===String(t.favorite)},t.account?{_account:Re()(t.account).toString()}:{}),{},{_myDay:t.myDay,_parent:t.parent,_planId:t.plan,_users:l,_tags:t.tags,_aspects:t.aspects?t.aspects:[],_notifications:t.notifications},t.parentCompleted&&t.parentCompleted.card?{_parentCompleted:t.parentCompleted,status:"completed",completed_at:{low:t.parentCompleted.date?t.parentCompleted.date:t.updated_at&&t.updated_at.low?t.updated_at.low:null}}:{}),t.timer?{_kpiTimer:Object(O.a)({},t.timer._id,Object(h.a)(Object(h.a)({},t.timer),{},{userId:a._id}))}:{}),t.parentPrivate?{private:!0}:{})))}i+1===r.filter((function(e){return o(e)})).length&&e(n)})):e({})}));case 5:if(!(i=e.sent)){e.next=9;break}return t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),i)}),(function(){})),e.abrupt("return",i);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Tn=function(){var e=Object(Me.a)(Cn().mark((function e(t,r){var n,a,o,i,c,l,s,u=arguments;return Cn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.length>2&&void 0!==u[2]&&u[2],a=u.length>3&&void 0!==u[3]?u[3]:null,o=u.length>4&&void 0!==u[4]?u[4]:"my",i=u.length>5&&void 0!==u[5]&&u[5],c=u.length>6?u[6]:void 0,l=u.length>7&&void 0!==u[7]&&u[7],e.next=8,In(t,{idRel:r,adminView:n,callback:a,cardLoad:o,completed:i,status:c,ignoreLoader:l});case 8:if(!(s=e.sent)){e.next=11;break}return e.abrupt("return",s);case 11:return e.abrupt("return",!1);case 12:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),Nn=function(){var e=Object(Me.a)(Cn().mark((function e(t){var r,n,a=arguments;return Cn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:7,(n=window.location.hash.split("/"))[0]=n[0].replace("#",""),e.next=5,new Promise(function(){var e=Object(Me.a)(Cn().mark((function e(a,o){return Cn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("/calendar"!==window.location.pathname){e.next=4;break}return e.next=3,In(t,{cardLoad:"calendar",iniDate:Ve()().startOf("month").unix("x"),endDate:Ve()().endOf("month").unix("x")});case 3:a(!0);case 4:if("/sp"!==window.location.pathname||36===n[0].length||"archived"!==n[1]){e.next=10;break}return e.next=7,In(t,{cardLoad:"plans",archived:!0});case 7:return e.next=9,In(t,{cardLoad:"plans",archived:!0,completed:!0,completedDays:r});case 9:a(!0);case 10:if("/sp"!==window.location.pathname||36===n[0].length||"completed"!==n[1]){e.next=14;break}return e.next=13,In(t,{cardLoad:"plans",completed:!0,completedDays:r});case 13:a(!0);case 14:if("/sp"!==window.location.pathname||36===n[0].length||"templates"!==n[1]){e.next=18;break}return e.next=17,In(t,{cardLoad:"templates",templates:!0});case 17:a(!0);case 18:if("/sp"!==window.location.pathname||36===n[0].length||"admin"!==n[1]){e.next=22;break}return e.next=21,In(t,{cardLoad:"plans",adminView:!0});case 21:a(!0);case 22:if("/sp"!==window.location.pathname||36===n[0].length||"deleted"!==n[1]){e.next=26;break}return e.next=25,In(t,{cardLoad:"plans",deleted:!0});case 25:a(!0);case 26:if("/d"!==window.location.pathname&&"/login"!==window.location.pathname&&"/"!==window.location.pathname||"dayTasks"===n[1]){e.next=30;break}return e.next=29,In(t,{cardLoad:"dashboard"});case 29:a(!0);case 30:if("/d"!==window.location.pathname||"dayTasks"!==n[1]){e.next=34;break}return e.next=33,In(t,{adminView:!0,cardLoad:"myDay"});case 33:a(!0);case 34:if("/d"!==window.location.pathname||"ourTasks"!==n[1]){e.next=38;break}return e.next=37,In(t,{adminView:!0,cardLoad:"myDay"});case 37:a(!0);case 38:if("/sp"!==window.location.pathname||!n[0]||36!==n[0].length){e.next=44;break}return e.next=41,In(t,{idRel:n[0],cardLoad:"plan"});case 41:return e.next=43,In(t,{idRel:n[0],cardLoad:"plan",completed:!0});case 43:a(!0);case 44:if("/sp"===window.location.pathname&&36!==n[0].length&&a(!0),"/sp"!==window.location.pathname||36===n[0].length||"archived"!==n[1]){e.next=48;break}return e.next=48,In(t,{cardLoad:"plans",archived:!0});case 48:if("/sp"!==window.location.pathname||36===n[0].length||"templates"!==n[1]){e.next=51;break}return e.next=51,In(t,{cardLoad:"templates"});case 51:if("/sp"===window.location.pathname&&36!==n[0].length&&"trash"===n[1]&&In(t,{cardLoad:"deletedPlans",deleted:!0,adminView:!!(De.getState().session._access&&De.getState().session._access.plan&&De.getState().session._access.planAdmin)}),"/library"!==window.location.pathname){e.next=56;break}return e.next=55,In(t,{cardLoad:"plans"});case 55:a(!0);case 56:if("/calendar"!==window.location.pathname){e.next=60;break}return e.next=59,In(t,{cardLoad:"calendar",startDate:null,endDate:null});case 59:a(!0);case 60:if("/p"!==window.location.pathname&&"/acc"!==window.location.pathname||a(!0),"/bright-and-connected"!==window.location.pathname){e.next=69;break}if("tab"!==n[0]||"radar"!==n[1]){e.next=65;break}return e.next=65,In(t,{cardLoad:"links",limit:9,skip:0});case 65:if("tab"!==n[0]||"insight-boards"!==n[1]){e.next=68;break}return e.next=68,In(t,{cardLoad:"insights",limit:9,skip:0});case 68:a(!0);case 69:if("/c"!==window.location.pathname){e.next=74;break}if("tab"!==n[0]||"users"===n[1]){e.next=73;break}return e.next=73,In(t,{cardLoad:"plans"});case 73:a(!0);case 74:if("/t"!==window.location.pathname){e.next=95;break}if(n[1]&&(!n[1]||"myTasks"!==n[1])){e.next=81;break}return e.next=78,In(t,{cardLoad:"myResponsible"});case 78:return e.next=80,In(t,{cardLoad:"myResponsible",completed:!0,completedDays:r});case 80:a(!0);case 81:if(!n[1]||"myDay"!==n[1]&&"ourDay"!==n[1]){e.next=85;break}return e.next=84,In(t,{cardLoad:"myDay",completed:!0,completedDays:r});case 84:a(!0);case 85:if(!n[1]||"myTasks"===n[1]||"myDay"===n[1]){e.next=95;break}return e.next=88,In(t,{cardLoad:"in"});case 88:return e.next=90,In(t,{cardLoad:"in",completed:!0,completedDays:r});case 90:return e.next=92,In(t,{cardLoad:"myResponsible"});case 92:return e.next=94,In(t,{cardLoad:"myResponsible",completed:!0,completedDays:r});case 94:a(!0);case 95:if("/tags"!==window.location.pathname){e.next=100;break}if(36!==n[0].length){e.next=99;break}return e.next=99,In(t,{cardLoad:"tags",idRel:n[0]});case 99:a(!0);case 100:"/calendar"===window.location.pathname&&a(!0),"/masterAdmin"!==window.location.pathname&&"/plataformAdministrator"!==window.location.pathname||a(!0),"/subscriptionUpgrade"===window.location.pathname&&a(!0),36!==n[0].length||!De.getState().db.cards||De.getState().db.cards[n[0]]&&!De.getState().db.cards[n[0]]||De.getState().db.cards&&De.getState().db.cards[n[0]]&&n[0]&&!De.getState().db.cards[n[0]]._loadedFeeds&&"bright-and-connected"===n[1]&&a(!0);case 104:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}());case 5:if(!e.sent){e.next=8;break}return e.abrupt("return",!0);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Pn=r(1818);function Dn(){Dn=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var An=function(){var e=Object(Me.a)(Dn().mark((function e(t){var r,n,a,o,i,c,l,s,u,d=arguments;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=d.length>1&&void 0!==d[1]&&d[1],n=d.length>2?d[2]:void 0,a=d.length>3&&void 0!==d[3]?d[3]:null,(o=window.location.hash.split("/"))[0]=o[0].replace("#",""),36!==o[0].length&&(o[0]=null),i=Object(h.a)({},n),c=i._id?Object(h.a)({},De.getState().db.cards[i._id]):{},l=null,i.order&&String(i.order.low)&&(i.order=i.order.low),"chatGroup"===i.type&&i._planId&&(delete i._planId,delete i._parent,delete i.idRel),Object.keys(i).map((function(e){return"file"===e&&(l=i[e],delete i.file),(i[e]&&i[e].low||i[e]&&i[e].low&&"0"===String(i[e].low))&&(i[e]=i[e].low),i})),i._id&&(!i._id||36===i._id.length)){e.next=20;break}return a?(i.idRel=a,i._parent=a,"plan"===De.getState().db.cards[a].type&&(i._planId=a),"plan"!==De.getState().db.cards[a].type&&De.getState().db.cards[a]._planId&&(i._planId=De.getState().db.cards[a]._planId)):(window.location.pathname.indexOf("sp")>-1&&!i._parent&&(i._parent=i._parent?i._parent:o[0]?o[0]:null),i._parent&&(i.idRel=a||i._parent),window.location.pathname.indexOf("sp")>-1&&o[0]&&36===o[0].length&&(i._planId=o[0])),e.next=16,Yn(t,Object(h.a)(Object(h.a)({},i),{},{oldData:c}),l,r);case 16:return s=e.sent,e.abrupt("return",s);case 20:return e.next=22,Gn(t,Object(h.a)(Object(h.a)({},i),{},{oldData:c}),l,r);case 22:if(u=e.sent,!(i&&i.type&&i.type.indexOf("guideline")>-1&&"guideline"!==i.type&&Object.keys(De.getState().db.cards).filter((function(e){return(De.getState().db.cards[e]._planId===o[0]||De.getState().db.cards[e]._parent===o[0])&&!0===De.getState().db.cards[e]._selected})).length>0)){e.next=26;break}return e.next=26,Bn(i._id);case 26:return e.abrupt("return",u);case 27:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),$n=function(){var e=Object(Me.a)(Dn().mark((function e(t,r){var n;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t&&t.store&&De.getState().functions&&De.getState().functions.socket,De.getState().functions.socket,e.next=3,ot.post("timer/start",{idRel:r,startTime:Ve()().unix("X")});case 3:if(!(n=e.sent)){e.next=6;break}return e.abrupt("return",n.data);case 6:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),zn=function(){var e=Object(Me.a)(Dn().mark((function e(t,r){var n;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t&&t.store&&De.getState().functions&&De.getState().functions.socket,De.getState().functions.socket,e.next=3,ot.put("timer/stop",{idRel:r});case 3:if(!(n=e.sent)){e.next=6;break}return e.abrupt("return",n.data);case 6:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),Mn=function(){var e=Object(Me.a)(Dn().mark((function e(t,r,n){var a,o;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t&&t.store&&De.getState().functions&&De.getState().functions.socket,De.getState().functions.socket,e.next=3,ot.delete("timer/run/".concat(n),{idRel:r});case 3:if(a=e.sent,(o=De.getState().db.cards[r]._kpiTimer)[n]&&delete o[n],!a){e.next=9;break}return t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},r,Object(h.a)(Object(h.a)({},De.getState().db.cards[r]),{},{_kpiTimer:o})))})),e.abrupt("return",!0);case 9:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),Bn=function(){var e=Object(Me.a)(Dn().mark((function e(t){var r,n,a;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=window.location.hash.split("/"))[0]=r[0].replace("#",""),n=Object.keys(De.getState().db.cards).filter((function(e){if((De.getState().db.cards[e]._planId===r[0]||De.getState().db.cards[e]._parent===r[0])&&!0===De.getState().db.cards[e]._selected&&De.getState().db.cards[e].type&&De.getState().db.cards[e].type.indexOf("guideline")>-1)return!0}))[0],a=Object.keys(De.getState().db.cards).filter((function(e){return(De.getState().db.cards[e]._planId===r[0]||De.getState().db.cards[e]._parent===r[0])&&!0===De.getState().db.cards[e]._selected&&De.getState().db.cards[e].type&&-1===De.getState().db.cards[e].type.indexOf("guideline")})),ot.put("matrix/aspects",{_id:n,_parent:r[0],aspects:a}),t&&t.reduxFunction&&t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},n,Object(h.a)(Object(h.a)({},De.getState().db.cards[n]),{},{_aspects:a})))})),e.abrupt("return",!0);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Yn=function(){var e=Object(Me.a)(Dn().mark((function e(t,r,n){var a,o,i,c,l,s,u,d,p=arguments;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=p.length>3&&void 0!==p[3]&&p[3],o=(t&&t.store&&De.getState().functions&&De.getState().functions.socket,De.getState().functions.socket),De.getState().db.dataType,i=De.getState(),c=i.session,l=i.db,(s=window.location.hash.split("/"))[0]=s[0].replace("#",""),u=new Promise(function(){var e=Object(Me.a)(Dn().mark((function e(i,u){return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{"add","myTask"!==r.type&&"chatGroup"!==r.type||(r.myTask=!0),r.status||(r.status="notStarted"),o.emit("data",{module:"cards",method:"post",action:"add"},r,function(){var e=Object(Me.a)(Dn().mark((function e(o){return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r._users=Object(O.a)({},c._id,{name:l.users[c._id].name?l.users[c._id].name:null,displayName:l.users[c._id].displayName?l.users[c._id].displayName:null,image:l.users[c._id].image?l.users[c._id].image:null,access:5,_id:c._id}),!(r.type&&r.type.indexOf("guideline")>-1)){e.next=4;break}return e.next=4,Bn(o.id);case 4:r.myTask&&delete r.myTask,r._loaded=!0,r._loadTimeline=!0,o.id&&(a||t.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{id:o.id,data:Object(h.a)(Object(h.a)(Object(h.a)({},De.getState().sideModule.data),r),{},{_id:o.id})})),r._id=o.id,parseInt(r.order)>=0&&(r.order={low:r.order}),r=Object(h.a)(Object(h.a)({},r),o.data),t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},r._id,Object(h.a)(Object(h.a)({},r),{},{created_at:Ve()().tz("America/Sao_Paulo").unix("x"),updated_at:{low:Ve()().tz("America/Sao_Paulo").unix("x")}})))})),Rn(t,r._id,Object(O.a)({},o.log._id,Object(h.a)(Object(h.a)({},o.log),{},{_parent:r._id}))),n?Gn(t,Object(h.a)({},r),n,a):"tab"===s[0]&&"myDay"===s[1]&&(Zn(t,{_id:o.id,userId:c._id,option:!0},{new:!0,user:c._id,cardId:r._id,cardData:Object(h.a)({},r)}),Rn(t,r._id,Object(O.a)({},o.log._id,Object(h.a)(Object(h.a)({},o.log),{},{_parent:r._id}))))),i(Object(h.a)(Object(h.a)({},r),{},{created_at:Ve()().tz("America/Sao_Paulo").unix("x"),updated_at:{low:Ve()().tz("America/Sao_Paulo").unix("x")}}));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}catch(u){console.log(u)}case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()),e.next=9,u;case 9:return d=e.sent,e.abrupt("return",d);case 11:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),Gn=function(){var e=Object(Me.a)(Dn().mark((function e(t,r,n){var a,o,i;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=Object(h.a)({},r),i=(t&&t.store&&De.getState().functions&&De.getState().functions.socket,De.getState().functions.socket),!n){e.next=7;break}return e.next=5,Ln(a._id,n);case 5:o=e.sent,a.image=o;case 7:return(!n||n&&o)&&(t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},a._id,Object(h.a)(Object(h.a)(Object(h.a)({},De.getState().db.cards[a._id]),a),{},{_users:Object(h.a)({},De.getState().db.cards[a._id]._users)})))})),i.emit("data",{module:"cards",method:"put",action:"update220527"},a,function(){var e=Object(Me.a)(Dn().mark((function e(r){var n,o;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a.order&&parseInt(a.order)>=0&&(a.order={low:a.order}),r&&r.log&&r.log._id&&Rn(t,a._id,Object(O.a)({},r.log._id,Object(h.a)(Object(h.a)({},r.log),{},{_parent:[a._id]}))),n=De.getState(),o=n.db,!(a.type&&a._id&&a.type.indexOf("guideline")>-1&&"guideline"!==a.type&&Object.keys(o.cards).filter((function(e){return o.cards[e]._parent===a._id&&o.dataType.filter((function(t){return t.name===o.cards[e].type&&"swot"===t.module})).length>0})))){e.next=6;break}return e.next=6,Bn(a._id);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())),e.abrupt("return",!0);case 9:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),Rn=function(e,t,r){var n=De.getState().timeline[t]?De.getState().timeline[t]:{};n=Object(h.a)(Object(h.a)({},n),r),e.reduxFunction("ASYNC","SET_TIMELINE",Object(h.a)(Object(h.a)({},De.getState().timeline),{},Object(O.a)({},t,n)))},Hn=function(){var e=Object(Me.a)(Dn().mark((function e(t,r){return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(t&&t.store&&De.getState().functions&&De.getState().functions.socket,De.getState().functions.socket).emit("data",{module:"cards",method:"put",action:"restore"},{_id:r._id},function(){var e=Object(Me.a)(Dn().mark((function e(n){return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Un(t,{cardId:r._id},!1);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 2:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),Wn=function(){var e=Object(Me.a)(Dn().mark((function e(t,r,n){var a,o,i,c=arguments;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=c.length>3&&void 0!==c[3]&&c[3],o=De.getState(),i=o.db,n?Un(t,{cardId:r._id,childrens:r.childrensDelete},!0):(t&&t.store&&De.getState().functions&&De.getState().functions.socket,De.getState().functions.socket).emit("data",{module:"cards",method:"put",action:"delete"},{_id:r._id,deleted:!0,childrensDelete:a,client:i.cards[r._id]&&i.cards[r._id].client?i.cards[r._id].client:i.cards[r._id]&&i.cards[r._id]._planId&&i.cards[i.cards[r._id]._planId]&&i.cards[i.cards[r._id]._planId].client?i.cards[i.cards[r._id]._planId].client:null},function(){var e=Object(Me.a)(Dn().mark((function e(n){return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Un(t,{cardId:r._id,childrens:a},!0);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 3:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),Un=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=Object(h.a)({},De.getState().db.cards);if(n[t.cardId]=Object(h.a)(Object(h.a)({},n[t.cardId]),{},{deleted:r},n[t.cardId]&&n[t.cardId]._selected?{_selected:!1}:{}),t.childrens){var a=ua(t.cardId);Object.keys(a).map((function(e){n[e]=Object(h.a)(Object(h.a)({},n[e]),{},{deleted:r})}))}e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),n)}))},Vn=function(){var e=Object(Me.a)(Dn().mark((function e(t,r){var n,a;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise(function(){var e=Object(Me.a)(Dn().mark((function e(n,a){var o;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(De.getState().db.cards[r.cardId]){e.next=7;break}return e.next=3,In(t,{idRel:r.cardId,cardLoad:"fullCatenation",ignoreLoader:!0});case 3:(o=e.sent)&&o.cards&&o.cards[r.cardId]&&n(o.cards[r.cardId]),e.next=8;break;case 7:n(De.getState().db.cards[r.cardId]);case 8:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}());case 2:(n=e.sent)&&(a=De.getState().db.tag,De.getState().db.cards&&n&&(r.cardData&&r.cardData._tags&&r.cardData._tags.length>0&&r.cardData._tags.map((function(e){n&&n._tags&&0===n._tags.filter((function(t){return t.value===e.value})).length&&a.filter((function(t){return t.value===e.value})).map((function(e){e.count=e.count+1}))})),n._tags&&n._tags.map((function(e){r.cardData._tags&&0===r.cardData._tags.filter((function(t){return t.value===e.value})).length&&a.filter((function(t){return t.value===e.value})).map((function(e){e.count=e.count-1}))}))),(!r.new||r.new&&r.user!==X._id)&&t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},r.cardId,Object(h.a)(Object(h.a)(Object(h.a)({},n||{}),r.cardData),{},{_notifications:De.getState().db.cards&&n&&n._notifications?n._notifications:{comment:0,log:0,timer:0,kpi:0},createdBy:r.user?r.user:null}))),tag:a})));case 4:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),qn=function(){var e=Object(Me.a)(Dn().mark((function e(t,r){return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},r._id,Object(h.a)(Object(h.a)({},De.getState().db.cards[r._id]?De.getState().db.cards[r._id]:{}),r)))}));case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),Xn=function(){var e=Object(Me.a)(Dn().mark((function e(t,r){var n,a,o,i,c,l;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=De.getState(),a=n.db,o=a.cards,i=o[r],(c=window.location.hash.split("/"))[0]=c[0].replace("#",""),36!==c[0].length&&(c[0]=null),l={},Object.keys(a.cards).filter((function(e){return a.cards[e]&&!a.cards[e].deleted&&(a.cards[e]._planId===c[0]||a.cards[e]._parent===c[0])})).map((function(e){l=Object(h.a)(Object(h.a)({},l),{},Object(O.a)({},e,a.cards[e]))})),Object.keys(l).map((function(e){l[e]&&l[e].type&&-1===l[e].type.indexOf("guideline")&&-1===l[e].type.indexOf("objective")&&-1===l[e].type.indexOf("goal")&&(l[e]=Object(h.a)(Object(h.a)({},l[e]),{},{_selected:!1}))})),i&&i._aspects&&i._aspects.length>0&&i._aspects.map((function(e){l[e]&&(l[e]=Object(h.a)(Object(h.a)({},l[e]),{},{_selected:!0}))})),t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},o),l)}));case 11:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),Jn=function(){var e=Object(Me.a)(Dn().mark((function e(t,r,n){var a,o;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=Object(h.a)(Object(h.a)(Object(h.a)({},De.getState().db.cards[r._id]&&De.getState().db.cards[r._id]._users&&De.getState().db.cards[r._id]._users[r.userId]?De.getState().db.cards[r._id]._users[r.userId]:{}),n&&n.data&&n.data._users&&n.data._users[r.userId]?n.data._users[r.userId]:{}),{},{myDay:!r.checklist&&r.option?o:null}),o=Ve()().tz("America/Sao_Paulo").unix("x"),t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},r._id,Object(h.a)(Object(h.a)(Object(h.a)({},n&&n.data?n.data:{}),De.getState().db.cards[r._id]),{},{_users:Object(h.a)(Object(h.a)(Object(h.a)({},De.getState().db.cards[r._id]&&De.getState().db.cards[r._id]._users?De.getState().db.cards[r._id]._users:{}),n&&n.data&&n.data._users?n.data._users:{}),{},Object(O.a)({},r.userId,a))})))}));case 3:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),Kn=function(){var e=Object(Me.a)(Dn().mark((function e(t,r){return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},r._id,Object(h.a)(Object(h.a)({},De.getState().db.cards[r._id]),{},{_users:Object(h.a)(Object(h.a)({},De.getState().db.cards[r._id]&&De.getState().db.cards[r._id]._users?De.getState().db.cards[r._id]._users:{}),{},Object(O.a)({},r.userId,Object(h.a)(Object(h.a)({},De.getState().db.cards[r._id]&&De.getState().db.cards[r._id]._users&&De.getState().db.cards[r._id]._users[r.userId]?De.getState().db.cards[r._id]._users[r.userId]:{}),{},{myDay:r.option?r.createDate:null})))})))}));case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),Zn=function(){var e=Object(Me.a)(Dn().mark((function e(t,r,n){var a;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=Ve()().unix("x"),Jn(t,r,n),(t&&t.store&&De.getState().functions&&De.getState().functions.socket,De.getState().functions.socket).emit("data",{module:"cards",method:"post",action:"setMyDay"},Object(h.a)(Object(h.a)({},r),{},{createDate:a})),De.getState().sideModule.id&&De.getState().sideModule.id===r._id&&t.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{data:Object(h.a)(Object(h.a)({},De.getState().sideModule.data?De.getState().sideModule.data:{}),{},{_users:Object(h.a)(Object(h.a)({},De.getState().db.cards[r._id]&&De.getState().db.cards[r._id]._users?De.getState().db.cards[r._id]._users:{}),{},Object(O.a)({},r.userId,Object(h.a)(Object(h.a)({},De.getState().db.cards[r._id]&&De.getState().db.cards[r._id]._users&&De.getState().db.cards[r._id]._users[r.userId]?De.getState().db.cards[r._id]._users[r.userId]:{}),{},{myDay:r.option?a:null})))})}));case 5:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),Qn=function(){var e=Object(Me.a)(Dn().mark((function e(t,r){return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ot.put("/cards/moveTo",Object(h.a)({},r));case 3:if(!e.sent){e.next=7;break}return ea(t,r),e.abrupt("return",!0);case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),ft({message:"".concat(lt("$__tryAgainOrContactSupport",1),". ERROR: cMoveTo->API~887"),variant:"error",persist:!1,horizontal:"right"});case 12:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t,r){return e.apply(this,arguments)}}(),ea=function(){var e=Object(Me.a)(Dn().mark((function e(t,r){var n;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=De.getState().db.cards,e.next=3,new Promise(function(){var e=Object(Me.a)(Dn().mark((function e(t,a){var o;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fa(r.cardId);case 2:(o=e.sent)&&o.length>0?o.map((function(e,a){n[e]&&(n[e]=Object(h.a)(Object(h.a)({},n[e]),{},{_planId:r.planId})),a+1===o.length&&t(!0)})):t(!0);case 4:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}());case 3:e.sent&&(n[r.cardId]&&(n[r.cardId]=Object(h.a)(Object(h.a)({},n[r.cardId]),{},{_parent:r.newRel,_planId:r.planId})),t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),n)})));case 5:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),ta=function(){var e=Object(Me.a)(Dn().mark((function e(t,r){var n,a,o,i;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(De.getState().db.cards[r.cardId]){e.next=7;break}return e.next=3,In(t,{idRel:r.cardId,cardLoad:"fullCatenation",ignoreLoader:!0});case 3:(n=e.sent)&&(a=De.getState().db.cards[r.cardId]&&De.getState().db.cards[r.cardId]._users?De.getState().db.cards[r.cardId]._users:{},r.isResponsible&&Object.keys(a).map((function(e){e!==r.userId&&a[e].isResponsible&&delete a[e].isResponsible})),o=De.getState().db.cards[r.cardId]?De.getState().db.cards[r.cardId]:{},n&&n.cards&&n.cards[r.cardId]&&(o=n.cards[r.cardId]),t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},r.cardId,Object(h.a)(Object(h.a)({},o),{},{_users:Object(h.a)(Object(h.a)({},a),{},Object(O.a)({},r.userId,Object(h.a)(Object(h.a)(Object(h.a)(Object(h.a)(Object(h.a)({},r.userData?r.userData:{}),De.getState().db.users&&De.getState().db.users[r.userId]?De.getState().db.users[r.userId]:{}),o&&o._users&&o._users[r.userId]?o._users[r.userId]:{}),r.isResponsible?{isResponsible:!0}:{}),r.access?{access:r.access}:{})))})))}))),e.next=10;break;case 7:i=De.getState().db.cards[r.cardId]&&De.getState().db.cards[r.cardId]._users?De.getState().db.cards[r.cardId]._users:{},r.isResponsible&&Object.keys(i).map((function(e){e!==r.userId&&i[e].isResponsible&&delete i[e].isResponsible})),t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},r.cardId,Object(h.a)(Object(h.a)({},De.getState().db.cards[r.cardId]?De.getState().db.cards[r.cardId]:{}),{},{_users:Object(h.a)(Object(h.a)({},i),{},Object(O.a)({},r.userId,Object(h.a)(Object(h.a)(Object(h.a)(Object(h.a)(Object(h.a)({},De.getState().db.cards[r.cardId]&&De.getState().db.cards[r.cardId]._users&&De.getState().db.cards[r.cardId]._users[r.userId]?De.getState().db.cards[r.cardId]._users[r.userId]:{}),i[r.userId]?i[r.userId]:{}),r.userData?r.userData:{}),r.isResponsible?{isResponsible:!0}:{}),r.access?{access:r.access}:{})))})))}));case 10:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),ra=function(){var e=Object(Me.a)(Dn().mark((function e(t,r){return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{ot.put("cards/unlinkChildrens",{cardId:r.cardId,planId:r._planId})}catch(t){console.log(t)}return e.abrupt("return",!0);case 2:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),na=function(){var e=Object(Me.a)(Dn().mark((function e(t,r){var n;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=De.getState().db.cards,Object.keys(n).filter((function(e){return n[e]._parent===r.cardId&&"step"!==n[e].type&&(!n[e].checklist||n[e].checklist&&n[e].showCard)})).map((function(e){n[e]._parent=r.planId})),r.cards&&r.cards.length>0&&r.cards.map((function(e){n[e]&&(n[e]=Object(h.a)(Object(h.a)({},n[e]),{},{_parent:r.planId}))})),n&&n[r.cardId]&&(n[r.cardId]=Object(h.a)(Object(h.a)({},n[r.cardId]),{},{_parent:r.planId})),t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:n}));case 5:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),aa=function e(t,r){var n=t&&t.color?t.color:null,a=!(!t.color||!r);if(t._parent&&De.getState().db.cards[t._parent]){var o=e(De.getState().db.cards[t._parent],!0);if(o.color)return o}return{parent:a,color:n,parentId:t.color?t._id:null}},oa=function(){var e=Object(Me.a)(Dn().mark((function e(t,r){return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(t&&t.store&&De.getState().functions&&De.getState().functions.socket,De.getState().functions.socket).emit("data",{module:"cards",method:"put",action:"link"},r,function(){var e=Object(Me.a)(Dn().mark((function e(t){return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 2:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),ia=function(e){var t=De.getState(),r=t.db,n=t.session,a=Object(h.a)({},r.cards[e]);if(r.cards[e]){var o=0;return a&&a._users&&Object.keys(a._users).length>0&&a._users[Object.keys(a._users).find((function(e){return e.indexOf(n._id)>-1}))]&&a._users[Object.keys(a._users).find((function(e){return e.indexOf(n._id)>-1}))].access&&(o=parseInt(a._users[Object.keys(a._users).find((function(e){return e.indexOf(n._id)>-1}))].access)),a&&a._parent&&r.cards[a._parent]&&r.cards[a._parent]._users&&Object.keys(r.cards[a._parent]._users).length>0&&r.cards[a._parent]._users[Object.keys(r.cards[a._parent]._users).find((function(e){return e.indexOf(n._id)>-1}))]&&r.cards[a._parent]._users[Object.keys(r.cards[a._parent]._users).find((function(e){return e.indexOf(n._id)>-1}))].access&&parseInt(r.cards[a._parent]._users[Object.keys(r.cards[a._parent]._users).find((function(e){return e.indexOf(n._id)>-1}))].access)>parseInt(o)&&(o=parseInt(r.cards[a._parent]._users[Object.keys(r.cards[a._parent]._users).find((function(e){return e.indexOf(n._id)>-1}))].access)),r.cards[e]._planId&&r.cards[r.cards[e]._planId]&&r.cards[r.cards[e]._planId]._users&&Object.keys(r.cards[r.cards[e]._planId]._users).length>0&&r.cards[r.cards[e]._planId]._users[Object.keys(r.cards[r.cards[e]._planId]._users).find((function(e){return e.indexOf(n._id)>-1}))]&&parseInt(r.cards[r.cards[e]._planId]._users[Object.keys(r.cards[r.cards[e]._planId]._users).find((function(e){return e.indexOf(n._id)>-1}))].access)>parseInt(o)&&(o=parseInt(r.cards[r.cards[e]._planId]._users[Object.keys(r.cards[r.cards[e]._planId]._users).find((function(e){return e.indexOf(n._id)>-1}))].access)),o}return 0},ca=function e(t){var r,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=De.getState(),i=o.db,c=o.session,l=Object(h.a)({},t?i.cards[t]:{}),s={};((null===a||void 0===a?void 0:a.noInternal)||Object.keys(i.users).filter((function(e){return"user"===i.users[e].type&&i.users[e]._parent===c._account&&!i.users[e].deleted})).map((function(e){s=Object(h.a)(Object(h.a)({},s),{},Object(O.a)({},e,Object(h.a)(Object(h.a)({},i.users[e]),{},{_id:e,type:"user"})))})),(null===l||void 0===l?void 0:l.client)&&i.users[l.client]&&Object.keys(i.users).filter((function(e){return i.users[e]._parent===l.client&&!i.users[e].deleted})).map((function(e){s=Object(h.a)(Object(h.a)({},s),{},Object(O.a)({},e,Object(h.a)(Object(h.a)({},i.users[e]),{},{_id:e,type:"external"},i.users[e]._parent?{_parent:i.users[e]._parent}:{})))})),(null===l||void 0===l?void 0:l._users)&&Object.keys(l._users).map((function(e){if(e!==c._id){var t="user";(!i.users[e]||i.users[e]&&i.users[e]._parent&&i.users[i.users[e]._parent]&&i.users[e]._parent!==c.account)&&(t="external"),(!i.users[e]||i.users[e]&&i.users[e]._parent&&!i.users[i.users[e]._parent])&&(t="consultant"),s=Object(h.a)(Object(h.a)({},s),{},Object(O.a)({},e,Object(h.a)(Object(h.a)({},l._users[e]),{},{_id:e,type:t},l._users[e]._parent?{_parent:l._users[e]._parent}:{})))}})),a&&!a.onlyCard)&&(!a.noPlan&&l._planId&&(null===(r=i.cards[l._planId])||void 0===r?void 0:r._users[c._id])&&(Object.keys(i.cards[l._planId]._users).map((function(e){})),s=Object(h.a)(Object(h.a)({},s),e(l._planId,{noPlan:!0,noInternal:!0}))),l._parent&&(null===(n=i.cards[l._parent])||void 0===n?void 0:n._users[c._id])&&(s=Object(h.a)(Object(h.a)({},s),e(l._parent,{noPlan:!0,noInternal:!0}))));if(null===a||void 0===a?void 0:a.isArray){var u=[];return Object.keys(s).map((function(e){0===u.filter((function(t){return t._id===e})).length&&u.push(s[e])})),u}return s},la=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t===r)return!1;if(!t)return!1;var n=!1,a=De.getState().db.cards[t]?De.getState().db.cards[t]:null;return!!a&&(a&&a.isTemplate?n=!0:a&&a._planId&&a._planId!==a._id&&De.getState().db.cards[a._planId]?n=e(a._planId,r||t):a&&a._parent&&De.getState().db.cards[a._parent]&&(n=e(a._parent,r||t)),n)},sa=function(){var e=Object(Me.a)(Dn().mark((function e(t,r,n){var a,o;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=new Promise(function(){var e=Object(Me.a)(Dn().mark((function e(t,a){return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ot.post("/cards/copy",{from:r,to:n});case 2:e.sent&&t(!0);case 4:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()),e.next=3,a;case 3:return o=e.sent,e.abrupt("return",o);case 5:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),ua=function e(t){var r=De.getState().db.cards,n=Object(O.a)({},t,!0);return Object.keys(r).filter((function(e){return r[e]._parent===t})).map(function(){var t=Object(Me.a)(Dn().mark((function t(r,a){var o;return Dn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(o=e(r))&&(n=Object(h.a)(Object(h.a)({},n),o));case 2:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()),n},da=function(){var e=Object(Me.a)(Dn().mark((function e(t,r){var n,a,o,i;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.data&&t.data._id?De.getState().db.cards[t.data._id]:{},a=(t&&t.store&&De.getState().functions&&De.getState().functions.socket,De.getState().functions.socket),i=o=r,"completed"===o.status?i=Object(h.a)(Object(h.a)({},i),{},{completed_at:{low:Ve()().unix("X")}}):o=Object(h.a)(Object(h.a)({},i),{},{completed_at:null});try{a.emit("data",{module:"cards",method:"put",action:"status"},Object(h.a)({_id:n._id},o),Object(Me.a)(Dn().mark((function e(){return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},n._id,Object(h.a)(Object(h.a)({},De.getState().db.cards[n._id]),i)))}));case 1:case"end":return e.stop()}}),e)}))))}catch(c){console.log(c)}case 6:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),pa=function(){var e=Object(Me.a)(Dn().mark((function e(t,r){var n,a,o,i;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.data&&t.data._id?De.getState().db.cards[t.data._id]:{},a=(t&&t.store&&De.getState().functions&&De.getState().functions.socket,De.getState().functions.socket),i=o=r,"completed"===o.status?i=Object(h.a)(Object(h.a)({},i),{},{completed_at:{low:Ve()().unix("X")}}):o.status&&(i=Object(h.a)(Object(h.a)({},i),{},{completed_at:{low:null}})),t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},n._id,Object(h.a)(Object(h.a)({},De.getState().db.cards[n._id]),i)))}));try{a.emit("data",{module:"cards",method:"put",action:"update220527"},Object(h.a)({_id:n._id},o))}catch(c){console.log(c)}case 7:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),fa=function(){var e=Object(Me.a)(Dn().mark((function e(t){var r,n,a,o,i,c=arguments;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=c.length>1&&void 0!==c[1]?c[1]:null,n=c.length>2?c[2]:void 0,a=De.getState().db.cards,o=[],!((i=Object.keys(a).filter((function(e){return a[e]&&a[e]._parent&&(a[e]._parent===t||a[e]._parent===n)&&(!r||"completed"===r&&"completed"!==a[e].status||"completed"!==r&&a[e]._parentCompleted&&a[e]._parentCompleted.cardId&&(a[e]._parentCompleted.cardId===t||a[e]._parentCompleted.cardId===n))}))).length>0)){e.next=13;break}return e.next=8,new Promise((function(e,n){i.map(function(){var n=Object(Me.a)(Dn().mark((function n(a,c){var l;return Dn().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,fa(a,r,t);case 2:l=n.sent,-1===o.indexOf(a)&&o.push(a),l&&l.length>0?l.map((function(t,r){-1===o.indexOf(t)&&o.push(t),r+1===l.length&&c+1===i.length&&e(!0)})):e(!0);case 5:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}())}));case 8:if(!e.sent){e.next=11;break}return e.abrupt("return",o);case 11:e.next=14;break;case 13:return e.abrupt("return",[]);case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ha=function(){var e=Object(Me.a)(Dn().mark((function e(t,r,n){var a,o;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fa(r,n);case 2:a=e.sent,o=De.getState().db.cards,a&&a.length>0&&a.map((function(e){o[e]=Object(h.a)(Object(h.a)({},o[e]),{},{status:n,completed_at:"completed"===n?{low:Ve()().unix("X")}:null},"completed"===n?{_parentCompleted:{cardId:r,completed_at:{low:Ve()().unix("X")}}}:{_parentCompleted:null})})),o[r]=Object(h.a)(Object(h.a)({},o[r]),{},{status:n,completed_at:"completed"===n?{low:Ve()().unix("X")}:null}),t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:o}));case 7:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),ma=function(e){var t=De.getState(),r=t.session,n=De.getState().db.cards[e]&&De.getState().db.cards[e]._notifications?De.getState().db.cards[e]._notifications:{};Object.keys(n).map((function(e){return n[e]=parseInt(n[e])}));var a=0;return Object.keys(n).filter((function(e){return"total"!==e})).map((function(t){De.getState().db.cards[e]&&De.getState().db.cards[e]._users&&De.getState().db.cards[e]._users[r._id]&&De.getState().timeline[e]&&parseInt(n[t])<Object.keys(De.getState().timeline[e]).filter((function(r){return De.getState().timeline[e][r]&&De.getState().timeline[e][r].type&&De.getState().timeline[e][r].type===t})).length?(n[t]=De.getState().timeline&&De.getState().timeline[e]&&Object.keys(De.getState().timeline[e]).length>0?Object.keys(De.getState().timeline[e]).filter((function(n){if(r&&r._id&&parseInt(De.getState().timeline[e][n].created_at)>1650666142&&De.getState().timeline[e][n].type===t&&De.getState().timeline[e][n].user&&De.getState().timeline[e][n].user._id!==r._id&&(!De.getState().timeline[e][n].readedBy||De.getState().timeline[e][n].readedBy&&!De.getState().timeline[e][n].readedBy[r._id]))return!0})).length:0,a+=parseInt(n[t])):(n[t]=parseInt(n[t]),a+=parseInt(n[t]))})),Object(h.a)(Object(h.a)({},n),{},{total:a})},ga=function(e){var t=De.getState(),r=t.session,n=t.db;return!(e&&36===e.length&&n.cards[e]&&!n.cards[e].isTemplate&&n.cards[e]._users&&!n.cards[e]._users[r._id]&&n.cards[e]._account&&n.cards[e]._account!==Re()(r.account).toString())},va=function(e){var t=De.getState(),r=t.session,n=t.db;return!(e&&36===e.length&&n.cards[e]&&!n.cards[e].isTemplate&&n.cards[e]._account&&n.cards[e]._account!==Re()(r.account).toString())},ya=function(){var e=Object(Me.a)(Dn().mark((function e(t,r){var n;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Sn.post("/Card_Count",{id:r._id});case 2:(n=e.sent)&&parseInt(n.data)>0&&"completed"!==r.status?ft({message:lt("$__concludeWithChildrensNotConcludedConfirm",1),autoClose:5e4,buttons:[{shadow:!0,title:lt("$__concludeAll"),text:lt("$__concludeAll"),color:"green",icon:"close",size:"25px",onClick:function(){pa(Object(h.a)(Object(h.a)({},t),{},{data:{_id:r._id}}),{status:"completed"===r.status?"inProgress":"completed"}),n&&parseInt(n.data)>0&&ha(t,r._id,"completed"===r.status?"inProgress":"completed")},style:{marginLeft:15}},{shadow:!0,title:lt("$__cancel"),text:lt("$__cancel"),color:"red",icon:"close",size:"25px",onClick:function(){},style:{marginLeft:15}}],variant:"warning",persist:!1,horizontal:"right"}):(pa(Object(h.a)(Object(h.a)({},t),{},{data:{_id:r._id}}),{status:"completed"===r.status?"inProgress":"completed"}),n&&parseInt(n.data)>0&&ha(t,r._id,"completed"===r.status?"inProgress":"completed"));case 4:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),ba=Object(Lt.a)((function(e){return{iconButtonStyle:{margin:0,marginTop:"-8px",backgroundColor:"#FFFFFF","&:hover":{backgroundColor:"rgba(250,250,250,0.9)"}}}}));var xa=Object($e.b)((function(e,t){return{cards:e.db.cards[t.nodeId],timeline:e.timeline[t.nodeId]}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=ba();i.a.useEffect((function(){return function(){}}),[]);var r=ma(e.nodeId);return r.total<1?i.a.createElement(i.a.Fragment,null):i.a.createElement("div",{id:"notificationsBt",style:{top:0,zIndex:0}},i.a.createElement(At,{className:t.iconButtonStyle,badgeContent:r.total,color:dt("menu"),icon:0===r.total?"notifications_none":"notifications_active",size:"17px",transparent:!0}))})),_a=r(1017),wa=r(980),Ea=r.n(wa);function Oa(){Oa=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var ja=["$__last7Days","$__last15Days","$__last30Days","$__last60Days","$__last90Days","$__last180Days","$__last365Days"];var Sa=Object($e.b)((function(e){return{store:{session:e.session}}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState().session,r=i.a.useState(null),n=Object(Be.a)(r,2),a=n[0],o=n[1],c=Boolean(a);i.a.useEffect((function(){return function(){e.reduxFunction("ASYNC","SET_SESSION",Object(h.a)(Object(h.a)({},De.getState().session),{},{period:"$__last7Days",dashboard:Object(h.a)(Object(h.a)({},De.getState().session),{},{period:"$__last7Days"})}))}}),[]);var l=function(){var t=Object(Me.a)(Oa().mark((function t(r){var n;return Oa().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o(null),"string"!==typeof r){t.next=7;break}return e.reduxFunction("ASYNC","SET_SESSION",Object(h.a)(Object(h.a)({},De.getState().session),{},{period:r,dashboard:Object(h.a)(Object(h.a)({},De.getState().session),{},{period:r})})),n=(n=String(r).replace("$__last","")).replace("Days",""),t.next=7,Nn(e,n);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return i.a.createElement("div",null,i.a.createElement(Tt.a,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true",onClick:function(e){o(e.currentTarget)},style:Object(h.a)({},e.style?e.style:{})},i.a.createElement(Ea.a,null)),i.a.createElement(_a.a,{id:"long-menu",anchorEl:a,keepMounted:!0,open:c,onClose:l,PaperProps:{style:{maxHeight:216,width:"20ch"}}},ja.map((function(e){return i.a.createElement(xn.a,{key:e,selected:e===t.dashboard.period,onClick:function(t){return l(e)}},lt(e,1))}))))})),ka=r(1793),La=i.a.forwardRef((function(e,t){var r={root:Object(h.a)(Object(h.a)({},rr),{},{color:dt("mediumText"),padding:0,width:"100%",marginTop:"7px",marginBottom:"7px","& .invalid":{borderBottom:"solid 2px red !important"},"& .MuiOutlinedInput-input":{padding:"11px 11px",fontSize:"12px"},"& label":{marginTop:"-10px",fontSize:"12px"},"& label.MuiFormLabel-filled":{color:dt("mediumText"),marginTop:"standard"===dt("fieldVariant")||"filled"===dt("fieldVariant")?"-10px":0},"& label.Mui-focused":{color:dt("mediumText"),marginTop:"standard"===dt("fieldVariant")||"filled"===dt("fieldVariant")?"-10px":0},"& .MuiInput-underline:after":{borderBottomColor:dt("line")},"& .MuiOutlinedInput-root":{borderRadius:dt("fieldRadius"),"& fieldset":{borderColor:dt("line")},"&.Mui-focused fieldset":{borderColor:dt("line")}},"& .MuiFilledInput-root":{borderRadius:dt("fieldRadius"),"& fieldset":{borderColor:dt("line")},"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")},"&.Mui-focused":{borderBottomColor:dt("line"),"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")}}},"& .MuiInputLabel-outlined":{marginTop:"0px","&.Mui-focused":{marginTop:"0px"},"&.MuiFormLabel-filled":{marginTop:"0px"}},"& .MuiInputBase-root":{marginTop:"standard"===dt("fieldVariant")?0:"filled"===dt("fieldVariant")?"-15px":0,borderRadius:dt("fieldRadius"),"& fieldset":{borderColor:dt("line")},"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")},"&.Mui-focused":{borderBottomColor:dt("line"),"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")}}}})},n=Object(Lt.a)(r)();return i.a.createElement(ka.a,Object.assign({},e,{ref:t,className:n.root}))}));function Ca(){Ca=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Ia=Object(Lt.a)((function(e){return{header:{display:"flex",width:"100%",justifyContent:"space-between"},content:{position:"relative",width:"100%",height:"100%",display:"flex",alignItems:"center"},contentWithExpand:{position:"relative",width:"calc(100% - 7px)",height:"100%",display:"flex",paddingLeft:"5px",paddingTop:"5px",alignItems:"center",justifyContent:"center"},info:{display:"flex",width:"100%",alignItems:"center"},headerIcon:{display:"contents",alignItems:"center"},headerTitle:{width:"100%",overflowX:"hidden",overflowY:"hidden",fontWeight:"bold"},actionButtons:{position:"absolute",height:"24px",right:"3px",display:"flex"},cancelButton:{right:"4px",position:"absolute",cursor:"pointer"},saveButton:{right:"33px",position:"absolute",cursor:"pointer"},button:{padding:"3px auto",cursor:"pointer",alignItems:"center",display:"flex",opacity:1},parent:{width:"100%",padding:"0 5px","& .title":{color:dt("medium"),fontSize:"10px",textTransform:"uppercase"},"& .info":{marginTop:"-8px",color:dt("colorText"),fontWeight:"500",alignItems:"center"}},iconButtonStyle:{margin:0,backgroundColor:"#FFFFFF","&:hover":{backgroundColor:"rgba(250,250,250,0.9)"},padding:"3px"}}}));var Fa=function(e){var t=De.getState(),r=t.session,n=t.functions,a=t.db,o=n.socket,c=Ia(),l=i.a.useState(!1),s=Object(Be.a)(l,2),u=(s[0],s[1],i.a.useState(e.title.trim()||null)),d=Object(Be.a)(u,2),p=d[0],m=d[1],g=i.a.useState(!1),v=Object(Be.a)(g,2),y=v[0],b=v[1],x=i.a.useState(!1),_=Object(Be.a)(x,2),w=_[0],E=_[1];i.a.useEffect((function(){return function(){}}),[]),i.a.useEffect((function(){"0"===String(e.unlockedPrivates)&&w&&E(!1)}),[e.unlockedPrivates]),i.a.useEffect((function(){!e.title&&e.editable&&b(!0)}),[e.title]);var O=function(){var t=Object(Me.a)(Ca().mark((function t(r){return Ca().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:try{e._id&&o.emit("data",{module:"node",method:"put",action:"update",noLog:!0},Object(h.a)({_id:e._id},r)),e.onEdit&&e.onEdit(p,e._id?e._id:null)}catch(n){console.log(n)}b(!1);case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return i.a.createElement("div",{className:c.header,style:Object(h.a)(Object(h.a)({minHeight:e.style&&e.style.minHeight?e.style.minHeight:"30px"},e.style),e.backClick?{cursor:"pointer"}:{})},i.a.createElement("div",{className:!e.onExpanding||y?c.content:c.contentWithExpand},i.a.createElement("div",{className:c.info},!e.private||De.getState().controls.lockPrivate||w?i.a.createElement(i.a.Fragment,null,e.icon&&i.a.createElement("div",{className:c.headerIcon,style:Object(h.a)({color:e.color?e.color:dt("colorText")},e.backClick?{cursor:"pointer"}:{})},i.a.createElement(Qr,{overlap:"rectangular",size:"calc(".concat(e.fontSize," + 4px)")||!1,icon:e.icon,color:"parent",title:e.iconTitle?e.iconTitle.substring(0,1).toUpperCase().concat(e.iconTitle.substring(1)):""})),e.searchText?i.a.createElement("div",{style:Object(h.a)({marginLeft:"7px"},e.searchTextStyle?e.searchTextStyle:{})},yt(e.title?e.title:"",e.searchText,!!e.dark)):i.a.createElement("div",{className:c.headerTitle,style:Object(h.a)(Object(h.a)({fontSize:e.fontSize?e.fontSize:"14px",color:e.color?e.color:dt("colorText"),marginLeft:e.icon?"7px":"none"},e.textStyle?e.textStyle:{}),e.backClick?{cursor:"pointer"}:{}),onClick:e.backClick?function(t){e.backClick(),t.stopPropagation()}:null},y?i.a.createElement("div",{style:Object(h.a)({position:"relative",float:"left",width:"100%",paddingTop:"10px",paddingLeft:"7px",display:"flex",alignItems:"center",justifyContent:"space-between"},e.inputStyle?e.inputStyle:{}),onClick:function(e){e.stopPropagation()}},i.a.createElement(La,{style:{width:"calc(100% - 60px)"},label:e.fieldName?e.fieldName:lt("$__nameOfCard",1),variant:dt("fieldVariant"),name:"name",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",onChange:function(e){m(e.target.value)},onKeyDown:function(t){13===t.keyCode&&p&&O({name:p}),27===t.keyCode&&(b(!1),m(e.value?e.value:e.title?e.title.trim():""))}},value:p,placeholder:lt("$__titleOfCard_placeholder",1),autoFocus:!e.noAutoFocus,multiline:!!e.multiline}),i.a.createElement(Qr,{color:dt("medium"),onClick:function(){return y?b(!1):e.onCancel()},icon:"cancel",title:lt("$__close","*"),size:e.actionsSize||"25px"}),i.a.createElement(Qr,{overlap:"rectangular",color:"green",icon:"save",onClick:function(){y?O({name:p}):e.onSave()},title:lt("$__save"," * "),size:e.actionsSize||"25px"})):i.a.createElement(Qe.a,{title:e.title?e.title:""},i.a.createElement("div",{style:Object(h.a)({},e.expanded?{width:"100%"}:{width:"100%",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:e.viewAllName&&!0===e.viewAllName?"":"nowrap"}),onDoubleClick:function(){e.onEdit&&e.editable&&(m(e.value?e.value:e.title?e.title.trim():""),b(!0))}},"".concat(e.showOrder?"".concat(e.showOrder,". "):"").concat(e.title&&e.title.indexOf("$__")>-1?lt(e.title,1):e.title?function(e){var t=document.createElement("DIV");return t.innerHTML=e,t.textContent||t.innerText||""}(e.title):""))))):i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:c.headerIcon,style:{color:"lightgray"}},i.a.createElement(Qr,{overlap:"rectangular",size:"calc(".concat(e.fontSize," + 4px)")||!1,icon:"private_connectivity",color:"parent",title:e.iconTitle?e.iconTitle.substring(0,1).toUpperCase().concat(e.iconTitle.substring(1)):""})),i.a.createElement("div",{style:{marginLeft:"7px",fontSize:12,color:"lightgray"}},e.privateTitle?e.privateTitle:lt("$__privateActivity")))),e.periodFilter&&r&&r.period&&i.a.createElement("div",{style:{position:"absolute",right:0,textAlign:"right",color:"#FFFFFF",display:"flex",alignItems:"center",whiteSpace:"nowrap"}},lt(r.period),i.a.createElement(Sa,{style:{color:"#FFFFFF",height:"20px",width:"20px"}}))),!y&&i.a.createElement("div",{style:{position:"absolute",right:7,padding:"3px 0px",display:"flex",alignItems:"center",borderRadius:7,backgroundColor:"rgba(250,250,250,0.7)"},onClick:function(e){e.preventDefault(),e.stopPropagation()}},!e.moreButton&&i.a.createElement(xa,{nodeId:e._id}),e.moreButton&&i.a.createElement("div",{style:{position:"absolute",top:0,right:0,display:"flex",alignItems:"center"},onClick:function(e){e.stopPropagation()}},!e.private||De.getState().controls.lockPrivate||w?i.a.createElement(i.a.Fragment,null,e.colorPicker&&i.a.createElement("div",{style:{zIndex:1e3}},i.a.createElement(vn,{color:e._id&&a.cards[e._id]&&a.cards[e._id].color?a.cards[e._id].color:null,_id:e._id,onChange:function(t){e.colorPicker(t)},style:{zIndex:5e3}})),e.options&&e.options.length>0&&e.options.filter((function(e){if(e&&e.name&&("$__removeSelection"===e.name||"$__selectThis"===e.name))return!0})).length>0&&i.a.createElement(Qe.a,{title:lt(e.options.filter((function(e){if(e&&e.name&&("$__removeSelection"===e.name||"$__selectThis"===e.name))return!0}))[0].name)},i.a.createElement(Tt.a,{onClick:function(t){e.options.filter((function(e){if(e&&e.name&&("$__removeSelection"===e.name||"$__selectThis"===e.name))return!0}))[0].onClick()},className:c.iconButtonStyle},i.a.createElement(kt,{size:"22px",color:dt("menu"),icon:e.options.filter((function(e){if(e&&e.name&&("$__removeSelection"===e.name||"$__selectThis"===e.name))return!0}))[0].icon,usePropagation:!0}))),!e.noExpanding&&e.onExpanding&&i.a.createElement(Qe.a,{title:lt(e.isExpanded?"$__collapse":"$__expand")},i.a.createElement(Tt.a,{onClick:function(t){e.onExpanding()},className:c.iconButtonStyle},i.a.createElement(kt,{size:"22px",color:dt("menu"),icon:e.isExpanded?"expand_less":"expand_more",usePropagation:!0}))),e.options&&e.options.length>0&&i.a.createElement(En,Object.assign({noButton:!0,options:[].concat(Object(f.a)(e.options),Object(f.a)(e.private&&w?[{color:"lightblue",icon:"lock",name:"$__lockThisPrivateCard",onClick:function(){E((function(e){return!e})),e.setPrivate&&e.setPrivate(!w)},show:"hover"}]:[]))},e.optionsProps?e.optionsProps:{}))):i.a.createElement(i.a.Fragment,null,i.a.createElement(At,{title:lt("$__showPrivateActivity","*"),color:"lightGray",icon:"lock_open",onClick:function(){E((function(e){return!e})),e.setPrivate&&e.setPrivate(!w)},size:"21px",style:{padding:"0px !important"}})))))},Ta=Object(Lt.a)((function(e){return{root:{display:"flex","& > *":{margin:e.spacing(1)}},sm:{width:e.spacing(3),height:e.spacing(3)},md:{width:e.spacing(5),height:e.spacing(5)},lg:{width:e.spacing(7),height:e.spacing(7)}}}));function Na(e){var t=Ta(),r=Object(h.a)({},e);return r.title&&delete r.title,e.title?i.a.createElement(Qe.a,{title:e.title},i.a.createElement(nn.a,Object.assign({},r,{className:t[e.size]}),e.children)):i.a.createElement(nn.a,Object.assign({},r,{className:t[e.size]}),e.children)}function Pa(){Pa=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Da=Object($e.b)((function(e){return{showPrivate:e.controls.lockPrivate,history:e.db.history}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.timeline,n=t.functions,a=t.session,o=n.socket,c=De.getState().db,l=i.a.useState(e.data),s=Object(Be.a)(l,2),u=s[0],d=s[1];i.a.useEffect((function(){return function(){}}),[]);var p=u.name.split("."),f=p[p.length-1];"blob"===u.name&&(u.name="".concat(lt("$__coverImage","*"),".jpg"),f="jpg");var m="attachment";De.getState().db.fileExtensions.filter((function(e){return e.ext.indexOf(f.toLowerCase())>-1})).length>0&&(m=De.getState().db.fileExtensions.filter((function(e){return e.ext.indexOf(f.toLowerCase())>-1}))[0].icon||"https://machen.azureedge.net/".concat(u.file));var g=function(){var e=Object(Me.a)(Pa().mark((function e(t){return Pa().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{o.emit("data",{module:"node",method:"put",action:"update"},Object(h.a)({_id:u._id},t),Object(Me.a)(Pa().mark((function e(){return Pa().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:d(Object(h.a)(Object(h.a)({},u),t));case 1:case"end":return e.stop()}}),e)}))))}catch(r){console.log(r)}case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),v="img";return c.fileExtensions.filter((function(e){return e.ext.indexOf(f.toLowerCase())>-1})).length>0&&c.fileExtensions.filter((function(e){return e.ext.indexOf(f.toLowerCase())>-1}))[0].viewer&&(v=c.fileExtensions.filter((function(e){return e.ext.indexOf(f.toLowerCase())>-1}))[0].viewer),i.a.createElement("div",null,i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",marginBottom:"5px",cursor:"pointer"}},i.a.createElement("div",{style:{position:"relative",width:"100%"}},i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},u.in&&u.in.private&&!e.showPrivate?i.a.createElement("div",{style:{position:"relative",float:"left",width:"33px",height:"33px",alignItems:"center",justifyContent:"center",backgroundColor:"lightgray",backgroundSize:"cover",backgroundRepeat:"no-repeat",borderRadius:7,display:"flex"}},i.a.createElement(kt,{icon:"lock",size:"17px"})):i.a.createElement(i.a.Fragment,null,"string"===typeof m&&-1===m.indexOf("https")&&-1===m.indexOf("svg")?i.a.createElement("div",{style:{position:"relative",float:"left",width:"33px",height:"33px",alignItems:"center",display:"flex",cursor:"pointer"},onClick:function(t){e.openLightBox&&e.openLightBox()}},i.a.createElement(kt,{icon:m,size:"33px"})):i.a.createElement("div",{style:{position:"relative",float:"left",width:"33px",height:"33px",alignItems:"center",backgroundImage:'url("'.concat(m,'")'),backgroundSize:"cover",backgroundRepeat:"no-repeat",borderRadius:7,cursor:"pointer"},onClick:function(t){e.openLightBox&&e.openLightBox()}})),i.a.createElement("div",{style:{display:"flex",paddingLeft:15,alignItems:"center",maxWidth:"calc(100% - 40px)"}},u.in&&u.in.name&&i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},"User"===u.in.db&&u.in._id===a._id?i.a.createElement("div",null,i.a.createElement(Na,{alt:u.createdBy.name,src:u.createdBy.image,style:{width:"21px",height:"21px"}},u.createdBy.name)):i.a.createElement(i.a.Fragment,null),"User"===u.in.db&&u.in._id!==a._id?i.a.createElement("div",null,i.a.createElement(Na,{alt:u.in.name,src:u.in.image,style:{width:"21px",height:"21px"}},u.in.name)):i.a.createElement(i.a.Fragment,null),i.a.createElement(Fa,{private:!(!u.in||!u.in.private),title:"".concat("User"===u.in.db?"".concat(lt("$__chatWithUser","*")," - ").concat(u.in._id!==a._id?"".concat(u.in.name):"".concat(u.createdBy.name)):"chatGroup"===u.in.type?"".concat(lt("$__chatGroup","*")," - ").concat(u.in.name):"User"!==u.in.db&&"chatGroup"!==u.in.type?"".concat(u.in.name):""),icon:"User"===u.in.db||"chatGroup"===u.in.type?null:u.in.type&&c&&c.dataType&&c.dataType.filter((function(e){return e.name===u.in.type}))[0]&&c.dataType.filter((function(e){return e.name===u.in.type}))[0].icon||"$__topic",color:dt("medium"),style:{padding:"7px",minHeight:"21px !important",textAlign:"left"},textStyle:!0}),i.a.createElement("span",{style:{marginRight:7}},"/")),i.a.createElement(Fa,{private:!(!u.in||!u.in.private),privateTitle:lt("$__privateFile"),title:u.name,value:u.name.replace(".".concat(f),""),searchText:e.searchText?e.searchText:null,color:e.dark?dt("lightgray"):dt("gray"),editable:!!e.admin,_id:u._id,dark:!!e.dark,inputStyle:e.dark?{backgroundColor:"rgba(250,250,250,0.8)",borderRadius:7}:null,textStyle:{fontSize:12,fontWeight:"normal"},searchTextStyle:Object(h.a)({fontSize:12},e.dark?{color:"#FFFFFF"}:{}),style:{minHeight:"21px !important"},onEdit:e.admin?function(e){g({name:"".concat(e,".").concat(f)})}:null}))),"audio"===v&&i.a.createElement("div",{style:{position:"relative",width:"100%",float:"left"}},i.a.createElement(Mr.a,{src:"https://machen.azureedge.net/".concat(u.file),controls:!0})),u.createdBy&&i.a.createElement("div",{style:{position:"relative",display:"flex",alignItems:"center",color:e.dark?"lightgray":"gray",fontSize:10,marginLeft:"57px",clear:"both"}},u.in&&!u.in.private?i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{style:{color:"lightgray",fontSize:10,marginRight:7}},lt("$__sendedBy"),":"),i.a.createElement(Na,{alt:u.createdBy.name,src:u.createdBy.image,style:{width:"15px",height:"15px"}},u.createdBy.name),i.a.createElement("span",{style:{marginLeft:3}},u.createdBy.name)):i.a.createElement(i.a.Fragment,null),i.a.createElement("span",{style:{marginLeft:3}},Ot(u.created_at)))),e.showParent&&(u.timelineId||u.message)&&(c.cards[u.cardId]&&r[u.cardId]&&r[u.cardId][u.timelineId]||u.message)&&i.a.createElement("div",{style:{width:"100%",marginBottom:"33px"}},i.a.createElement(Fc,{openLightBox:function(t){e.openLightBox&&e.openLightBox(t)},storie:c.cards[u.cardId]&&r[u.cardId]&&r[u.cardId][u.timelineId]?r[u.cardId][u.timelineId]:u.message,db:"cards",nodeId:u.cardId}),i.a.createElement("div",{style:{clear:"both"}})),e.showParent&&u.cardId&&c.cards[u.cardId]&&i.a.createElement("div",{style:{width:"100%",top:"33px"}},i.a.createElement(oc,{db:"cards",data:c.cards[u.cardId],showConnectedIn:!0})),i.a.createElement("div",{style:{width:"100%",height:"1px",backgroundColor:"rgba(0,0,0,0.1)",marginTop:"15px"}})))})),Aa=r(523),$a=r(358),za=r(524),Ma=r.n(za),Ba=Object(Lt.a)((function(e){return{iconButtonStyle:{margin:0,backgroundColor:"#FFFFFF","&:hover":{backgroundColor:"rgba(250,250,250,0.9)"}}}}));function Ya(e){var t=Ba();return i.a.createElement(Qe.a,{title:e.title?e.title:""},i.a.createElement(Tt.a,{onClick:e.onClick?function(t){e.onClick()}:null,className:t.iconButtonStyle},i.a.createElement(kt,{usePropagation:!0,size:e.size?e.size:"20px",color:e.color?e.color:dt("menu"),icon:e.icon?e.icon:"circle"})))}var Ga=r(1796),Ra=r(1795),Ha={control:{backgroundColor:"#fff",fontSize:14,fontFamily:"Roboto",fontWeight:"normal",lineHeight:"17px"},"&multiLine":{control:{fontFamily:"Roboto"},highlighter:{padding:9,border:"1px solid transparent",boxSizing:"border-box",overflow:"hidden",maxHeight:150},input:{padding:9,border:"1px solid silver",overflow:"auto",maxHeight:150,borderColor:"transparent"}},"&singleLine":{display:"inline-block",width:180,lineHeight:"17px",highlighter:{lineHeight:"17px",padding:1,border:"2px inset transparent"},input:Object(O.a)({border:"none",lineHeight:"17px",padding:1},"border","2px inset")},suggestions:{position:"absolute",list:{backgroundColor:"white",border:"1px solid rgba(0,0,0,0.15)",borderRadius:"7px 7px",boxShadow:"0 0 3px 5px rgba(0,0,0,0.05)",fontSize:14,zIndex:200,maxHeight:"151px !important",overflow:"auto !important"},item:{padding:"5px 15px",borderBottom:"1px solid rgba(0,0,0,0.15)","&focused":{backgroundColor:dt("color")}},zIndex:500,bottom:"100%",top:"none",left:"33px",height:"auto",maxHeight:"151px !important",overflow:"auto !important"}},Wa=function(e){var t,r,n;return{root:{position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px"},rootRelative:{position:"relative",top:"0px",left:"0px",right:"0px",bottom:"0px"},content:{position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px",overflowY:"auto",backgroundColor:"rgba(249,249,249,1)"},timeline:{listStyle:"none",padding:"0",position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px",display:"flex",width:"100%","& .file-drop-target":{width:"100%",display:"flex",position:"absolute",bottom:"0px",left:"0px",right:"0px",height:"auto"}},scrollEnd:{marginTop:"160px",position:"relative",width:"100%",height:"0px",marginBottom:"-100px"},timelineSimple:{position:"relative",overflow:"hidden",marginTop:"0px",padding:"0 0 20px",width:"-webkit-fill-available","&:before":{left:"15px"}},item:{marginBottom:"5px",position:"relative",width:"calc(100% - 15px)","&:before,&:after":{content:'" "',display:"table"},"&:after":{clear:"both"}},timelineBadge:(t={},Object(O.a)(t,e.breakpoints.down("sm"),{left:"30px !important"}),Object(O.a)(t,"color","#FFF"),Object(O.a)(t,"width","30px"),Object(O.a)(t,"height","30px"),Object(O.a)(t,"lineHeight","25px"),Object(O.a)(t,"fontSize","12px"),Object(O.a)(t,"textAlign","center"),Object(O.a)(t,"position","absolute"),Object(O.a)(t,"bottom","23px"),Object(O.a)(t,"left","50%"),Object(O.a)(t,"marginLeft","-24px"),Object(O.a)(t,"zIndex","1"),Object(O.a)(t,"borderTopRightRadius","50%"),Object(O.a)(t,"borderTopLeftRadius","50%"),Object(O.a)(t,"borderBottomRightRadius","50%"),Object(O.a)(t,"borderBottomLeftRadius","50%"),Object(O.a)(t,"display","flex"),Object(O.a)(t,"alignItems","center"),Object(O.a)(t,"justifyContent","center"),t),timelineSimpleBadge:{left:"30px"},custom:{backgroundColor:dt("color"),boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt("#000")+", 0.4)"},info:{backgroundColor:cr[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(cr[0])+", 0.4)"},success:{backgroundColor:ir[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(ir[0])+", 0.4)"},danger:{backgroundColor:or[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(or[0])+", 0.4)"},warning:{backgroundColor:ar[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(ar[0])+", 0.4)"},primary:{backgroundColor:nr[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(nr[0])+", 0.4)"},badgeIcon:{width:"14px",height:"14px"},timelinePanel:(r={},Object(O.a)(r,e.breakpoints.down("sm"),{float:"right !important",width:"calc(100% - 60px) !important","&:before":{borderLeftWidth:"0 !important",borderRightWidth:"15px !important",left:"-20px !important",right:"auto !important"},"&:after":{borderLeftWidth:"0 !important",borderRightWidth:"14px !important",left:"-19px !important",right:"auto !important"}}),Object(O.a)(r,"width","45%"),Object(O.a)(r,"float","left"),Object(O.a)(r,"padding","7px"),Object(O.a)(r,"marginBottom","5px"),Object(O.a)(r,"position","relative"),Object(O.a)(r,"boxShadow","0 1px 4px 0 rgba("+Zt("#000")+", 0.14)"),Object(O.a)(r,"borderRadius","6px"),Object(O.a)(r,"color","rgba("+Zt("#000")+", 0.87)"),Object(O.a)(r,"background","#FFF"),Object(O.a)(r,"&:before",{position:"absolute",bottom:"16px",right:"-15px",display:"inline-block",borderTop:"15px solid transparent",borderLeft:"15px solid "+sr[10],borderRight:"0 solid "+sr[10],borderBottom:"15px solid transparent",content:'" "'}),Object(O.a)(r,"&:after",{position:"absolute",bottom:"16px",right:"-14px",display:"inline-block",borderTop:"14px solid transparent",borderLeft:"14px solid #FFF",borderRight:"0 solid #FFF",borderBottom:"14px solid transparent",content:'" "'}),r),timelineSimplePanel:{width:"calc(100% - 60px)"},timelinePanelInverted:Object(O.a)({},e.breakpoints.up("sm"),{float:"right",backgroundColor:"#FFF","&:before":{borderLeftWidth:"0",borderRightWidth:"15px",left:"-15px",right:"auto"},"&:after":{borderLeftWidth:"0",borderRightWidth:"14px",left:"-14px",right:"auto"}}),timelineHeading:{marginBottom:"0px"},timelineBody:{fontSize:"12px",lineHeight:"21px"},timelineFooter:{zIndex:"1",position:"relative",float:"left",width:"100%",display:"inline-flex",justifyContent:"space-between"},footerUser:{display:"flex",alignItems:"center",fontSize:"12px",fontWeight:"bold",color:dt("medium")},footerLine:{position:"relative",marginTop:"10px",marginBottom:"5px"},dropFile:{display:"none"},onDropFile:Object(O.a)({position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px",zIndex:"5",display:"flex",alignItems:"center",justifyContent:"center",color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.77)"},"zIndex",11),editor:{position:"absolute",bottom:"0px",height:"auto",width:"calc(100% - 0px)",zIndex:10},editorRelative:{position:"relative",bottom:"0px",minHeight:"50px",height:"auto",width:"calc(100% - 0px)",zIndex:10},files:{display:"inline-table",position:"absolute",width:"100%",bottom:0},textEditor:{zIndex:100},textEditorIcon:{cursor:"pointer",color:dt("color")},progressBar:{backgroundColor:"".concat(dt("color","0.1")," !important"),"& .MuiLinearProgress-indeterminate":{backgroundColor:"".concat(dt("color")," !important")},"& .MuiLinearProgress-bar":{backgroundColor:"".concat(dt("color")," !important")}},actionButton:{alignItems:"center",cursor:"pointer",float:"left",height:"20px",position:"relative",textAlign:"center",width:"30px"},sendingMessage:{width:"100%"},valuePositive:{positive:"relative",float:"left",color:"blue"},valueNegative:{positive:"relative",float:"left",color:"red"},lastValue:{positive:"relative",float:"right",color:"grey"},timeInfo:{display:"flex",alignItems:"center",color:"grey",width:"100%",position:"relative",float:"left",marginBottom:"7px","& .text":{marginLeft:"7px"}},urlPreview:{position:"absolute",width:"100%",top:"-90px",maxHeight:"120px",background:"linear-gradient(60deg, rgba(250,250,250,1), rgba(250,250,250,0.9))",padding:"7px",display:"flex",overflow:"auto",alignItems:"center","& img":{maxWidth:"20%",height:"auto",position:"relative",float:"left",marginTop:"0px",marginRight:"7px"},"& .data":{position:"relative",float:"left",width:"75%","& .title":{fontSize:"16px",fontWeight:"bold"},"& .siteName":{fontSize:"14px",fontWeight:"bold",color:"#909090"},"& .contentSnippet":{fontSize:"12px",color:"#909090"}}},mentionInput:Object(h.a)(Object(h.a)({},rr),{},{"& textarea":Object(h.a)(Object(h.a)({},rr),{},{padding:"7px",borderRadius:"7px",fontSize:"16px",width:"calc(100% - 14px)",minHeight:"38px",border:"solid 1px rgba(0,0,0,0.1)"}),"& .sugestions":{top:"none !important",bottom:"40px",border:"solid 10px red"},"& textarea::placeholder":{color:"rgba(0,0,0,0.2)"}}),mentionWrapper:{width:"100%",background:"transparent",fontSize:"0.9rem",color:" #a9b5c4","&&.mentionWrapper__control":{borderRadius:"25px",border:"1px solid #3a546f",minHeight:"45px","&& .mentionWrapper__highlighter":{padding:"0.7rem 1rem"},"&& .mentionWrapper__input":(n={padding:"0.7rem 1rem",outline:0,border:0,resize:"none"},Object(O.a)(n,"outline","none"),Object(O.a)(n,"fontSize","0.9rem"),Object(O.a)(n,"color","#7288a3"),Object(O.a)(n,"borderColor"," #3a546f"),Object(O.a)(n,"overflow","hidden"),Object(O.a)(n,"&& :: placeholder",{color:"#7288a3"}),n)}}}};function Ua(){Ua=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Va=function(){var e=Object(Me.a)(Ua().mark((function e(t){var r,n,a,o,i,c,l,s;return Ua().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(t&&t.store&&De.getState().functions&&De.getState().functions.socket,De.getState().functions.socket),n=De.getState(),a=n.sideModule,o=a.data,i=De.getState().db[a.db][a.id]||{},!1,!1,console.log(o),(c=window.location.hash.split("/"))[0]=c[0].replace("#",""),JSON.stringify(i)!==JSON.stringify(o)&&!0,"user"===o.type&&c&&c.length>2&&c[2]&&36===c[2].length&&(o.type="user",o._parent=c[2]),Object.keys(o).map((function(e){"file"===e&&(!0,!0),(i&&i[e]&&o[e]!==i[e]||!i&&o)&&!0,(o[e]&&o[e].low||o[e]&&o[e].low&&"0"===String(o[e].low))&&(o[e]=o[e].low)})),l=o.file||null,delete o.file,"new"!==o._id&&o._id){e.next=25;break}return e.prev=15,r.emit("data",{module:"user",method:"post",action:"add"},Object(h.a)(Object(h.a)({},o),{},{oldData:i}),function(){var e=Object(Me.a)(Ua().mark((function e(n){var a;return Ua().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o._id=n.id,o._token={_id:n.tokenId},!l){e.next=8;break}return e.next=5,Ln(o._id,l);case 5:e.t0=e.sent,e.next=9;break;case 8:e.t0=o.image;case 9:a=e.t0,o.image=a,r.emit("data",{module:"user",method:"put",action:"update"},Object(h.a)(Object(h.a)({},o),{},{image:a,oldData:i})),t.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{id:n.id,data:Object(h.a)(Object(h.a)({},De.getState().sideModule.data),{},{_id:n.id})}));case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.abrupt("return",!0);case 20:e.prev=20,e.t0=e.catch(15),console.log(e.t0);case 23:e.next=35;break;case 25:if(!l){e.next=31;break}return e.next=28,Ln(o._id,l);case 28:e.t1=e.sent,e.next=32;break;case 31:e.t1=o.image;case 32:return s=e.t1,(l&&s||!l)&&r.emit("data",{module:"user",method:"put",action:"update"},Object(h.a)(Object(h.a)({},o),{},{image:s,oldData:i}),function(){var e=Object(Me.a)(Ua().mark((function e(t){return Ua().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.abrupt("return",!0);case 35:case"end":return e.stop()}}),e,null,[[15,20]])})));return function(t){return e.apply(this,arguments)}}(),qa=function(){var e=Object(Me.a)(Ua().mark((function e(t){var r,n,a,o;return Ua().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(t&&t.store&&De.getState().functions&&De.getState().functions.socket,De.getState().functions.socket),n=De.getState(),a=n.sideModule,o=a.data,r.emit("data",{module:"user",method:"post",action:"access"},{_id:o._id,email:o.email,name:o.name,access:o._access,safety:o._safety},function(){var e=Object(Me.a)(Ua().mark((function e(t){return Ua().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.emit("user.ACCESS",Object(O.a)({_id:o._id},o._id,Object(h.a)({},o)));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Xa=function(e,t){var r=Object(h.a)({},t[t._id]?t[t._id]:{});De.getState().db.users[t._id]&&(r=Object(h.a)(Object(h.a)({},De.getState().db.users[t._id]),r)),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{users:Object(h.a)(Object(h.a)({},De.getState().db.users),{},Object(O.a)({},t._id,Object(h.a)({},r)))}))};function Ja(e){return Ka.apply(this,arguments)}function Ka(){return(Ka=Object(Me.a)(Ua().mark((function e(t){var r;return Ua().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=De.getState().db.users,1!==Object.keys(r).filter((function(e){return r[e].email===t})).length){e.next=5;break}return e.abrupt("return",!0);case 5:return e.prev=5,e.next=8,Sn.get("/M_User_Verify_MailExist/?email=".concat(t));case 8:return e.abrupt("return",!1);case 11:return e.prev=11,e.t0=e.catch(5),e.abrupt("return",!0);case 14:return e.abrupt("return",!1);case 15:case"end":return e.stop()}}),e,null,[[5,11]])})))).apply(this,arguments)}function Za(e){return Qa.apply(this,arguments)}function Qa(){return(Qa=Object(Me.a)(Ua().mark((function e(t){return Ua().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Sn.get("/M_User_Verify_MailExist/?email=".concat(t));case 3:if(!e.sent){e.next=6;break}return e.abrupt("return",!1);case 6:e.next=11;break;case 8:return e.prev=8,e.t0=e.catch(0),e.abrupt("return",!0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)}function eo(e,t){return to.apply(this,arguments)}function to(){return(to=Object(Me.a)(Ua().mark((function e(t,r){return Ua().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ot.post("user/email-token-validate",{token:t,email:r});case 3:if(!e.sent){e.next=6;break}return e.abrupt("return",!0);case 6:e.next=11;break;case 8:return e.prev=8,e.t0=e.catch(0),e.abrupt("return",!1);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)}function ro(e,t){return no.apply(this,arguments)}function no(){return(no=Object(Me.a)(Ua().mark((function e(t,r){return Ua().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ot.post("user/email-token-generate",{name:t,email:r});case 3:if(!e.sent){e.next=6;break}return e.abrupt("return",!0);case 6:e.next=11;break;case 8:return e.prev=8,e.t0=e.catch(0),e.abrupt("return",!1);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)}var ao=function(e,t,r,n,a){var o,i=De.getState().db.users[t]?De.getState().db.users[t]:a;o=(e&&e.store&&De.getState().functions&&De.getState().functions.socket,De.getState().functions.socket);var c=De.getState().db;return ta(e,{cardId:n,userId:t,access:r,userData:{_id:t,name:i.name,image:i.image?i.image:null}}),o.emit("data",{module:"cards",method:"post",action:"access"},{cardType:c.cards[n].type,cardId:n,parentUser:c.cards[n]._parent,userId:t,access:r,userData:{_id:t,name:i.name,image:i.image?i.image:null}},function(){var e=Object(Me.a)(Ua().mark((function e(t){return Ua().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),!0},oo=function(){var e=Object(Me.a)(Ua().mark((function e(t,r){var n,a;return Ua().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(t&&t.store&&De.getState().functions&&De.getState().functions.socket,De.getState().functions.socket),a=De.getState(),a.db,n.emit("data",{module:"cards",method:"post",action:"userResponsible"},Object(h.a)({},r),function(){var e=Object(Me.a)(Ua().mark((function e(t){return Ua().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.abrupt("return",!0);case 4:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}();function io(){io=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}r(168).config();var co=function(){var e=Object(Me.a)(io().mark((function e(t,r){var n,a,o,i,c,l;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n={},a=De.getState(),o=a.db,i=a.session,(De.getState().timeline[r.id]||De.getState().timeline[r.readedBy])&&(n=De.getState().timeline,c=r.id,l={},"cards"!==r.db?(c=n[r.readedBy]?r.readedBy:r.id,l={_id:r.readedBy,name:o.users[r.readedBy].name,image:o.users[r.readedBy].image}):o.cards[r.id]&&o.cards[r.id]._users&&o.cards[r.id]._users[r.readedBy]&&(l=o.cards[r.id]._users[r.readedBy]),n&&n[c]&&Object.keys(n[c]).filter((function(e){if(r&&r.type&&("all"!==r.type&&n[c][e].type===r.type||"all"===r.type)&&n[c][e].user._id!==r.readedBy&&(!n[c][e].readedBy||i&&i._id&&n[c][e].readedBy&&!n[c][e].readedBy[i._id]))return!0})).map((function(e,t){n[c][e]=Object(h.a)(Object(h.a)({},n[c][e]),{},{readedBy:Object(h.a)(Object(h.a)({},n[c][e]&&n[c][e].readedBy?n[c][e].readedBy:{}),{},Object(O.a)({},r.readedBy,Object(h.a)(Object(h.a)(Object(h.a)({},n[c][e]&&n[c][e].readedBy&&n[c][e].readedBy[r.readedBy]?n[c][e].readedBy[r.readedBy]:{}),l),{},{readedDate:{low:Ve()().unix("x")}})))})}))),t.reduxFunction("ASYNC","SET_TIMELINE",Object(h.a)({},n)),De.getState().db.cards[r.id]&&r.type&&De.getState().db.cards[r.id]._notifications&&(De.getState().db.cards[r.id]._notifications[r.type]||"all"===r.type)&&t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},r.id,Object(h.a)(Object(h.a)({},De.getState().db.cards[r.id]),"all"===r.type?{notifications:{}}:{_notifications:Object(h.a)(Object(h.a)({},De.getState().db.cards[r.id]&&De.getState().db.cards[r.id]._notifications?De.getState().db.cards[r.id]._notifications:{}),{},Object(O.a)({},r.type,0))})))}));case 5:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),lo=function(){var e=Object(Me.a)(io().mark((function e(t,r){var n,a,o,i,c,l,s,u;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=De.getState(),a=n.db,o=n.timeline,i=n.session,c={},l=r.nodeId!==i._id?l=r.nodeId:r.user,a.users[r.user]?c=a.users[r.user]:r.user&&a[r.db]&&o[l]&&o[l]._users&&o[l]._users[r.user]&&(c=o[l]._users[r.user]),l&&r.message&&o&&o[i._id]&&o[i._id][r.message]&&(l=i._id),a[r.db]&&o[l]&&o[l][r.message]&&(s=Object(h.a)(Object(h.a)({},o[l][r.message]&&o[l][r.message]._reactions?o[l][r.message]._reactions:{}),{},Object(O.a)({},r.react,Object(h.a)(Object(h.a)({},o[l][r.message]&&o[l][r.message]._reactions&&o[l][r.message]._reactions[r.react]?o[l][r.message]._reactions[r.react]:{}),{},Object(O.a)({},r.user,Object(h.a)(Object(h.a)({},c),{},{reactDate:{low:Ve()().tz("America/Sao_Paulo").unix("x")}}))))),Object.keys(s).map((function(e){e!==r.react&&Object.keys(s[e]).map((function(t){s[e][t]&&t===r.user&&delete s[e][t]}))})),u=Object(h.a)(Object(h.a)({},o),{},Object(O.a)({},l,Object(h.a)(Object(h.a)({},o[l]),{},Object(O.a)({},r.message,Object(h.a)(Object(h.a)({},o[l][r.message]),{},{_reactions:s}))))),t.reduxFunction("ASYNC","SET_TIMELINE",u));case 6:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),so=function(){var e=Object(Me.a)(io().mark((function e(t,r){var n,a,o,i,c;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise(function(){var e=Object(Me.a)(io().mark((function e(n,a){return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r||"cards"!==r.db||De.getState().db.cards[r.idRel]){e.next=7;break}return e.next=3,In(t,{idRel:r.idRel,cardLoad:"fullCatenation",ignoreLoader:!0});case 3:e.sent&&n(!0),e.next=8;break;case 7:n(!0);case 8:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}());case 2:e.sent&&(n=r,a=De.getState(),o=a.timeline,i=a.session,(c=n._parent?n._parent:n.cardId?n.cardId:n.node)===i._id&&(c=n.comment.user._id),n.to&&(n.to.map((function(e){var t=De.getState().db.users[e];n._toUser=Object(h.a)(Object(h.a)({},n._toUser?n._toUser:{}),{},Object(O.a)({},e,{_id:e,name:t.displayName?t.displayName:t.name,image:t.image?t.image:null}))})),delete n.to),c&&n.comment&&t.reduxFunction("ASYNC","SET_TIMELINE",Object(h.a)(Object(h.a)({},o),{},Object(O.a)({},c,Object(h.a)(Object(h.a)({},o[c]),{},Object(O.a)({},n.comment._id,Object(h.a)(Object(h.a)(Object(h.a)(Object(h.a)({},o[c]&&o[c][n.comment._id]?o[c][n.comment._id]:{}),n.comment),n._toUser?{_toUser:n._toUser}:{}),{},{type:o[c]&&o[c][n.comment._id]&&o[c][n.comment._id].type?o[c][n.comment._id].type:n&&n.comment&&n.comment.type?n.comment.type:o[c]&&o[c][n.comment._id]&&o[c]&&o[c][n.comment._id].type?o[c]&&o[c][n.comment._id].type:"comment",readedBy:Object(h.a)(Object(h.a)({},o[c]&&o[c][n.comment._id]&&o[c][n.comment._id].readedBy?o[c][n.comment._id].readedBy:{}),n.comment&&n.comment.readedBy?n.comment.readedBy:{}),idRel:null})))))));case 4:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),uo=function(){var e=Object(Me.a)(io().mark((function e(t,r){var n,a,o,i,c,l,s,u,d,p,f,m,g,v,y,b,x,_,w,E,j,S,k;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=(null===(n=De.getState().chat)||void 0===n?void 0:n.lastMessageDate)||0,o=r.ids,i=r.db,c=r.type,l=r.limit,s=void 0===l?0:l,u=r.skip,d=void 0===u?0:u,p=r.toId,f=void 0===p?null:p,m=r.ini,g=void 0!==m&&m,v=r.reqChildrens,y=void 0!==v&&v,b=r.newUpdates,x=void 0!==b&&b,_=r.lastDate,void 0===_?null:_,w=De.getState(),E=w.session,j=[],S=[],"string"===typeof o?S.push(o):S=o,S&&S.length>0&&S.map((function(e){-1===j.indexOf(e)&&j.push(e)})),!(j.length>0)){e.next=16;break}return e.next=10,new Promise(function(){var e=Object(Me.a)(io().mark((function e(n,o){var l,u,p;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(j.length>0)){e.next=13;break}return e.prev=1,e.next=4,Sn.post("/M_Timeline_Get_V3",{nodesIds:j,db:i,type:c||"comment",skip:parseInt(d),limit:s,toId:f,ini:g,newUpdates:x,reqChildrens:y,lastDate:x?r.lastDate?r.lastDate:a:null});case 4:(l=e.sent)&&l.data&&l.data.length>0?(u=Object(h.a)({},De.getState().timeline),p=null,l.data.map((function(e){var t=u&&u[o]&&u[o][e.data._id]&&u[o][e.data._id].readedBy?u[o][e.data._id].readedBy:{},n={},o=e.nodeId!==E._id?e.nodeId:e.params.user._id;e&&e.params&&e.params.readedBy&&e.params.readedBy.filter((function(e){return e._id})).length>0&&e.params.readedBy.map((function(e){t=Object(h.a)(Object(h.a)({},t),{},Object(O.a)({},e._id,e))})),e&&e.params&&e.params.reactions&&e.params.reactions.filter((function(e){return e._id})).length>0&&e.params.reactions.map((function(e){n=Object(h.a)(Object(h.a)({},n),{},Object(O.a)({},e.type,Object(h.a)(Object(h.a)({},n[e.type]),{},Object(O.a)({},e._id,e))))}));var i={};e&&e.params&&e.params.users&&e.params.users.filter((function(e){return e.name})).length>0&&e.params.users.filter((function(e){return e.name})).map((function(e){i=Object(h.a)(Object(h.a)({},i),{},Object(O.a)({},e._id,e))})),E&&E._id&&t&&!t[E._id]&&u[o]&&Object.keys(u[o]).filter((function(r){u[o][r]&&u[o][r].readedBy&&u[o][r].readedBy[E._id]&&parseInt(u[o][r].created_at)>parseInt(e.data.created_at)&&(t=Object(h.a)(Object(h.a)({},t),{},Object(O.a)({},E._id,Object(h.a)({},u[o][r].readedBy[E._id]))))})),(r.ini||r.newUpdates)&&parseInt(e.data.created_at)>parseInt(a)&&(a=parseInt(e.data.created_at),p=o),u=Object(h.a)(Object(h.a)({},u),{},Object(O.a)({},o,Object(h.a)(Object(h.a)({},u&&u[o]?u[o]:{}),{},Object(O.a)({},e.data._id,Object(h.a)(Object(h.a)(Object(h.a)(Object(h.a)({},e.data),e.params),"timer"===e.data.type&&"0"===String(e.data.ini)?{manualEntry:!0,ini:parseInt(e.data.created_at),fin:parseInt(e.data.created_at)+parseInt(e.data.fin)}:{}),{},{readedBy:t,_reactions:n},i!=={}?{_toUser:i}:{})))))})),t.noReg||t.reduxFunction("ASYNC","SET_TIMELINE",Object(h.a)(Object(h.a)({},De.getState().timeline),u)),n({result:!0,total:l.data.length,timelines:u,chatOpenId:p,lastMessageDate:a})):n({result:!0,total:l.data.length}),e.next=13;break;case 8:e.prev=8,e.t0=e.catch(1),console.group("loadTimeline::ERR::"),console.log(e.t0),console.groupEnd();case 13:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,r){return e.apply(this,arguments)}}());case 10:if((k=e.sent)&&(k.chatOpenId||k.lastMessageDate)&&t.reduxFunction("IMMEDIATE","SET_CHAT",Object(h.a)(Object(h.a)(Object(h.a)({},De.getState().chat),(r.ini||r.newUpdates)&&k.lastMessageDate?{lastMessageDate:k.lastMessageDate}:{}),r.ini&&k.chatOpenId?{nodeId:k.chatOpenId}:{})),!k){e.next=14;break}return e.abrupt("return",k);case 14:e.next=17;break;case 16:return e.abrupt("return",{result:!0,total:0});case 17:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),po=function(){var e=De.getState(),t=e.db,r=e.session,n=e.timeline,a=0,o=0;return Object.keys(n).map((function(e){Object.keys(n[e]).map((function(i){n[e]&&n[e][i]&&!n[e][i].deleted&&n[e][i].user&&n[e][i].user._id&&n[e][i].user._id!==r._id&&(!n[e][i].readedBy||n[e][i].readedBy&&!n[e][i].readedBy[r._id])&&(e&&t.cards[e]&&"chatGroup"===t.cards[e].type&&(a+=1),e&&t.users[e]&&"user"===t.users[e].type&&(o+=1),1)}))})),{total:a+o+0+0,groups:a,externalGroups:0,users:o,externalUsers:0}},fo=function(){var e=Object(Me.a)(io().mark((function e(t,r){var n,a;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(t&&t.store&&De.getState().functions&&De.getState().functions.socket,De.getState().functions.socket),e.next=3,new Promise(function(){var e=Object(Me.a)(io().mark((function e(a,o){return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.emit("data",{module:"chat",method:"put",action:"cancel"},r,(function(e){var n=r.idRel,o=De.getState().session;De.getState().timeline[o._id]&&De.getState().timeline[o._id][r.id]&&(n=o._id),t.reduxFunction("ASYNC","SET_TIMELINE",Object(h.a)(Object(h.a)({},De.getState().timeline),{},Object(O.a)({},n,Object(h.a)(Object(h.a)({},De.getState().timeline[n]),{},Object(O.a)({},r.id,Object(h.a)(Object(h.a)({},De.getState().timeline&&De.getState().timeline[n]&&De.getState().timeline[n][r.id]),{},{deleted:!0},r.deletedReason?{deletedReason:r.deletedReason}:{})))))),a(!0)}));case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}());case 3:if(!(a=e.sent)){e.next=6;break}return e.abrupt("return",a);case 6:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),ho=r(1794),mo=["children","className"],go=Object(Lt.a)({grid:{margin:"0",width:"100%"}});function vo(e){var t=go(),r=e.children,n=e.className,a=Object(Kt.a)(e,mo);return i.a.createElement(ho.a,Object.assign({container:!0},a,{className:t.grid+" "+n}),r)}var yo=["children","className"],bo=Object(Lt.a)({grid:{padding:"0 15px !important"}});function xo(e){var t=bo(),r=e.children,n=e.className,a=Object(Kt.a)(e,yo);return i.a.createElement(ho.a,Object.assign({item:!0},a,{className:t.grid+" "+n}),r)}function _o(){_o=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var wo=Object(Lt.a)(Wa),Eo=Object($e.b)((function(e,t){return{draft:e.chats&&e.chats.drafts?e.chats.drafts[t.nodeId]:{}}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.db,n=t.session,a=(t.functions.socket,i.a.useState("")),o=Object(Be.a)(a,2),c=o[0],l=o[1],s=i.a.useState(!1),u=Object(Be.a)(s,2),d=u[0],p=u[1],m=i.a.useState(!1),g=Object(Be.a)(m,2),v=g[0],y=g[1],b=i.a.useState([]),x=Object(Be.a)(b,2),_=x[0],w=x[1],E=i.a.useState([]),j=Object(Be.a)(E,2),S=j[0],k=j[1],L=i.a.useState({}),C=Object(Be.a)(L,2),I=C[0],F=C[1],T=i.a.useState(null),N=Object(Be.a)(T,2),P=N[0],D=N[1],A=i.a.useState(null),$=Object(Be.a)(A,2),z=$[0],M=$[1],B=i.a.useState(!1),Y=Object(Be.a)(B,2),G=Y[0],R=Y[1],H=i.a.useState([]),W=Object(Be.a)(H,2),U=W[0],V=W[1],q=i.a.useState(!1),X=Object(Be.a)(q,2),J=X[0],K=X[1],Z=i.a.useState(58),Q=Object(Be.a)(Z,2),ee=Q[0],te=Q[1],re=wo(),ne=i.a.createRef(),ae=i.a.createRef(),oe=xt(),ie=0;n._id&&r.cards[e.nodeId]&&r.cards[e.nodeId]._users&&r.cards[e.nodeId]._users[Object.keys(r.cards[e.nodeId]._users).find((function(e){return e.indexOf(n._id)>-1}))]&&(ie=r.cards[e.nodeId]._users[Object.keys(r.cards[e.nodeId]._users).find((function(e){return e.indexOf(n._id)>-1}))]);var ce=window.location.hash.split("/");ce[0]=ce[0].replace("#",""),i.a.useEffect((function(){var t,r=!0;return r&&(e.draft&&e.draft.message?l(e.draft.message):l("")),(null===e||void 0===e||null===(t=e.draft)||void 0===t?void 0:t.files)?w(e.draft.files):w([]),function(){r=!1,l("")}}),[e.nodeId]);i.a.createRef();i.a.useEffect((function(){var t,r=document.getElementById("sendingInput_".concat(e.nodeId));(null===(t=e.draft)||void 0===t?void 0:t.reply)&&r&&r.focus()}),[e.draft]);var le=function(){var e,t=[];if(e=c){var r=e.split("@[");r.length>0&&r.map((function(e){if(e){var r=e.split("](")[1];r&&(r=r.split(")")[0])&&36===r.length&&t.push(r)}}))}return t},se=function(){var t=Object(Me.a)(_o().mark((function t(){var a,o,i,s,u,d,f,m;return _o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a={_id:Object(Pn.a)(),idRel:e.nodeId,replyData:e.draft&&e.draft.reply&&De.getState().timeline[e.nodeId][e.draft.reply]?De.getState().timeline[e.nodeId][e.draft.reply]:{},reply:e.draft&&e.draft.reply?e.draft.reply:null,message:c,type:"comment",mentions:le(),notifyUsers:o,filesCount:_.length>0?_.length:0,_parent:e.nodeId,_client:r.cards[e.nodeId]&&r.cards[e.nodeId].client?r.cards[e.nodeId].client:null,db:e.db?e.db:"cards"},z&&(a=Object(h.a)(Object(h.a)({},a),{},{urlPreview:JSON.stringify(z)}),M(null)),l(""),De.getState().functions.socket,K(!1),_.length>0&&p(!0),o=[],i=le(),r.cards[e.nodeId]&&"chatGroup"!==r.cards[e.nodeId].type&&r.cards[e.nodeId]._users&&Object.keys(r.cards[e.nodeId]._users).length>0&&Object.keys(r.cards[e.nodeId]._users).filter((function(e){return e!==n._id&&-1===i.indexOf(e)})).map((function(e){o.push(e)})),e.onSending&&e.onSending(Object(h.a)(Object(h.a)({},a),{},{user:{_id:n._id,name:r.users[n._id].name,image:r.users[n._id].image||null}})),(s=Object(h.a)(Object(h.a)({},a),{},{created_at:"".concat(Ve()().unix("x")),user:{_id:n._id,name:r.users[n._id].name,image:r.users[n._id].image||null}})).mentions&&delete s.mentions,s.notifyUsers&&delete s.notifyUsers,s.db&&delete s.db,so({reduxFunction:e.reduxFunction},Object(h.a)(Object(h.a)({},a),{},{comment:s})),e.reduxFunction("ASYNC","SET_CHATS",Object(h.a)(Object(h.a)({},De.getState().chats),{},{drafts:Object(h.a)(Object(h.a)({},De.getState().chats.drafts),{},Object(O.a)({},e.nodeId,{message:null,reply:null,files:null}))})),t.next=18,ot.post("timeline/add",a);case 18:return(u=t.sent)&&u.data&&(d=u.data)._id&&(f=Object(h.a)(Object(h.a)({},d.comment),{},{_parent:e.nodeId,_client:r.cards[e.nodeId]&&r.cards[e.nodeId].client?r.cards[e.nodeId].client:null}),m=2,ie<2&&(m=ie),i.map(function(){var t=Object(Me.a)(_o().mark((function t(n){return _o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.cards[e.nodeId]&&(!r.cards[e.nodeId]._users||r.cards[e.nodeId]._users&&!r.cards[e.nodeId]._users[n])&&ao(e,n,m,e.nodeId,!0);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),_.length>0?pe({comment:f,dataMessage:a}):(e.onSending&&e.onSending(),k([]),w([]),V([]),M(null),R(!1),p(!1),e.onSending&&e.onSending())),t.abrupt("return",!1);case 21:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ue=function(){var e=Object(Me.a)(_o().mark((function e(t,r){var n;return _o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Math.round(100*t.loaded/t.total),F(Object(h.a)(Object(h.a)({},I),{},Object(O.a)({},r,n)));case 2:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),de=function(){var e=Object(Me.a)(_o().mark((function e(t,r){return _o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:D({options:t,fi:r}),F({});case 2:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),pe=function(){var t=Object(Me.a)(_o().mark((function t(r){var n,a,o,i,c,l=arguments;return _o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=l.length>1&&void 0!==l[1]?l[1]:0,a=l.length>2&&void 0!==l[2]?l[2]:[],De.getState().functions.socket,o=r.comment,i=r.dataMessage,(c=Array.from(_)).map(function(){var t=Object(Me.a)(_o().mark((function t(l,s){var u,d;return _o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s!==n){t.next=5;break}return t.next=3,Ln(o._id,l,!0,{onUploadProgress:function(e){return ue(e,s)},onUploadError:function(e){de(r,s)}});case 3:(u=t.sent)&&((d=Array.from(a)).push(u),k(d),c.length>n+1?pe(r,n+1,d):c.length===n+1&&(i.files=d,setTimeout((function(){ot.post("timeline/add",i)}),1e3),k([]),w([]),M(null),R(!1),p(!1),e.onSending&&e.onSending()));case 5:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}());case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),fe=function(){var t=Object(Me.a)(_o().mark((function t(r){var n;return _o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:w([].concat(Object(f.a)(_),Object(f.a)(Object.keys(r).map((function(e){return r[e]}))))),e.reduxFunction("ASYNC","SET_CHATS",Object(h.a)(Object(h.a)({},De.getState().chats),{},{drafts:Object(h.a)(Object(h.a)({},De.getState().chats.drafts),{},Object(O.a)({},e.nodeId,Object(h.a)(Object(h.a)({},(null===(n=De.getState().chats.drafts)||void 0===n?void 0:n[e.nodeId])||{}),{},{files:[].concat(Object(f.a)(_),Object(f.a)(Object.keys(r).map((function(e){return r[e]}))))})))})),y(!1);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),he=function(){var e=Object(Me.a)(_o().mark((function e(t){var r,n,a,o,i,c;return _o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(De.getState().functions.socket,l(t),!t||!(t.indexOf("http://")>-1||t.indexOf("https://")>-1)){e.next=30;break}return r="",n=[],t.indexOf(" ")>-1?n=t.split(" "):t.indexOf("\n")>-1?n=t.split("\n"):n.push(t),a=new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i"),e.next=9,n.map((function(e){var t=e.replace(":","");(t.indexOf("http://")>-1||t.indexOf("https://")>-1)&&a.test(t)&&(r=e)}));case 9:if(!(!z&&r&&-1===U.indexOf(r)||r&&z&&-1===U.indexOf(r)&&z.link!==r)){e.next=30;break}if(R(!0),-1!==t.indexOf("youtube.com/watch?")){e.next=29;break}return console.log("Verificando URL",r),e.prev=13,e.next=16,Sn.post("/URL_DATA",{url:r});case 16:(o=e.sent)&&o.data&&(i=o.data)&&i.title&&i.img&&i.contentSnippet?M(i):(R(!1),M(null)),e.next=29;break;case 20:e.prev=20,e.t0=e.catch(13),R(!1),M(null),(c=U).push(r),V(c),ft({message:lt("$__couldNotLoadDataFromURL",1),variant:"warning",persist:!1,horizontal:"center"}),console.log(e.t0);case 29:t.indexOf("youtube.com/watch?")>-1&&R(!1);case 30:t.indexOf("youtube.com/watch?")>-1&&R(!1);case 31:case"end":return e.stop()}}),e,null,[[13,20]])})));return function(t){return e.apply(this,arguments)}}(),me=[];r.cards[e.nodeId]&&r.cards[e.nodeId]._users&&Object.keys(r.cards[e.nodeId]._users).map((function(t){if(t&&null!==t&&void 0!==t&&t!==n._id&&r.cards[e.nodeId]._users[t].name&&(!r.users[t]||r.users[t]&&!r.users[t].deleted)){var a=r.cards[e.nodeId]._users[t]._id,o=r.cards[e.nodeId]._users[t].name?r.cards[e.nodeId]._users[t].name:r.cards[e.nodeId]._users[t].name.split(" ").length>0?r.cards[e.nodeId]._users[t].name.split(" ")[0]:r.cards[e.nodeId]._users[t].name;a&&0===Object.keys(me).filter((function(e){return me[e].id===a})).length&&me.push({id:a,display:o})}})),r.cards[e.nodeId]&&!r.cards[e.nodeId].private&&(oe&&(oe.owner||oe.planAdmin||oe.planModerate)||ie&&ie.access&&parseInt(ie.access)>3)&&Object.keys(r.users).filter((function(t){return!(r.users[t].deleted||"user"!==r.users[t].type||!(r.cards[e.nodeId]&&r.cards[e.nodeId].client&&(!r.users[t]._parent||r.users[t]._parent===r.cards[e.nodeId].client)||r.cards[e.nodeId]&&!r.cards[e.nodeId].client&&r.cards[e.nodeId]._planId&&r.cards[r.cards[e.nodeId]._planId]&&r.cards[r.cards[e.nodeId]._planId].client&&(!r.users[t]._parent||r.users[t]._parent===r.cards[r.cards[e.nodeId]._planId].client)||r.cards[e.nodeId]&&!r.cards[e.nodeId].client&&!r.users[t]._parent))})).map((function(t){t&&null!==t&&void 0!==t&&t!==n._id&&0===Object.keys(me).filter((function(e){if(me[e].id===t)return!0})).length&&me.push({id:t,display:e.nodeId&&r.cards[e.nodeId]&&r.cards[e.nodeId]._users&&r.cards[e.nodeId]._users[t]&&r.cards[e.nodeId]._users[t].name?r.cards[e.nodeId]._users[t].name:r.users[t].displayName?r.users[t].displayName:r.users[t].name})})),r.cards[e.nodeId]&&r.cards[e.nodeId]._parent&&r.cards[r.cards[e.nodeId]._parent]&&r.cards[r.cards[e.nodeId]._parent]._users&&Object.keys(r.cards[r.cards[e.nodeId]._parent]._users).map((function(t){t&&null!==t&&void 0!==t&&t!==n._id&&0===Object.keys(me).filter((function(e){if(me[e].id===t)return!0})).length&&me.push({id:t,display:r.cards[r.cards[e.nodeId]._parent]._users[t].name,image:r.cards[r.cards[e.nodeId]._parent]._users[t].image||null})})),r.cards[e.nodeId]&&r.cards[e.nodeId]._planId&&r.cards[r.cards[e.nodeId]._planId]&&r.cards[r.cards[e.nodeId]._planId]._users&&Object.keys(r.cards[r.cards[e.nodeId]._planId]._users).map((function(t){t&&null!==t&&void 0!==t&&t!==n._id&&0===Object.keys(me).filter((function(e){if(me[e].id===t)return!0})).length&&me.push({id:t,display:r.cards[r.cards[e.nodeId]._planId]._users[t].name,image:r.cards[r.cards[e.nodeId]._planId]._users[t].image||null})}));return document.getElementById("sendingInput_".concat(e.nodeId))&&document.getElementById("sendingInput_".concat(e.nodeId)).offsetHeight&&document.getElementById("sendingInput_".concat(e.nodeId)).offsetHeight,i.a.createElement(Aa.FileDrop,{ref:ne,className:e.relative?re.rootRelative:re.root,onDragOver:function(){!e.disabledSend&&y(!0)},onDrop:fe,accept:".png, .jpg, .jpeg, .bpm, .svg, .gif, .pdf, .mp4, .3gp, .ts, .mkv, .avi, .mov, .mts, m2ts, .mxf, .aac, aiff, .caf, .ogg, .mp3, .wav, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .txt, .zip, .rar"},i.a.createElement(i.a.Fragment,null,e.nodeId&&!e.disabledSend?i.a.createElement("div",{className:e.relative?re.editorRelative:re.editor,style:Object(h.a)(Object(h.a)({},e.editorStyle?e.editorStyle:{}),{},{backgroundColor:"#F0F0F0"})},i.a.createElement("div",{className:re.textEditor},G&&!z&&i.a.createElement("div",{className:re.urlPreview,style:{width:"100%",height:"150px"}},i.a.createElement("div",{style:{display:"flex"}},i.a.createElement("div",{style:{marginLeft:"7px",width:"200px",height:"110px",maxWidth:"50%"}},i.a.createElement(Ra.a,{variant:"rect",style:{width:"200px",height:"110px",maxWidth:"100%"}})),i.a.createElement("div",{style:{marginLeft:"7px",width:"100%",height:"25px"}},i.a.createElement(Ra.a,{variant:"text",height:25,style:{marginBottom:"7px"}}),i.a.createElement(Ra.a,{variant:"text",height:10}),i.a.createElement(Ra.a,{variant:"text",height:10}),i.a.createElement(Ra.a,{variant:"text",height:10}),i.a.createElement(Ra.a,{variant:"text",height:10}),i.a.createElement(Ra.a,{variant:"text",height:10}),i.a.createElement(Ra.a,{variant:"text",height:10})))),e.draft&&e.draft.reply||_&&_.length>0?i.a.createElement("div",{style:{position:"absolute",right:0,left:0,height:"auto",padding:7,bottom:ee+4,backgroundColor:"#f0f0f0",display:"flex",justifyContent:"space-between"}},e.draft&&e.draft.reply?i.a.createElement("div",{style:{position:"relative",display:"flex",justifyContent:"space-between",alignItems:"center"}},i.a.createElement("div",{style:{position:"relative",display:"flex",justifyContent:"space-between",alignItems:"center"}},i.a.createElement("div",{style:{color:dt("menu"),display:"flex",alignItems:"center"}},i.a.createElement(kt,{icon:"reply",color:dt("menu"),size:"22px"}),i.a.createElement("span",{style:{marginLeft:10}},lt("$__reply")))),i.a.createElement("div",{style:{display:"flex",margin:"auto",padding:15,alignItems:"center",width:"77%",backgroundColor:"rgba(250,250,250,0.33)",borderRadius:5,borderLeft:"5px solid ".concat(dt("menu"))}},i.a.createElement(Fc,{storie:De.getState().timeline[e.nodeId][e.draft.reply],hideCards:!0,db:e.db,nodeId:e.nodeId,showUserName:!0,noReactions:!0}),i.a.createElement("div",{style:{position:"absolute",top:0,right:0}},i.a.createElement(At,{title:lt("$__cancelReply"),color:"red",icon:"cancel",size:"17px",onClick:function(){e.reduxFunction("ASYNC","SET_CHATS",Object(h.a)(Object(h.a)({},De.getState().chats),{},{drafts:Object(h.a)(Object(h.a)({},De.getState().chats.drafts),{},Object(O.a)({},e.nodeId,Object(h.a)(Object(h.a)({},De.getState().chats.drafts[e.nodeId]||{}),{},{reply:null})))}))},transparent:!0})))):i.a.createElement(i.a.Fragment,null),_&&_.length>0?i.a.createElement("div",{style:{position:"relative",maxHeight:"100%",width:"100%"}},i.a.createElement("div",{style:{position:"relative",width:"100%",float:"left",padding:3,display:"flex",justifyContent:"flex-end"}},i.a.createElement(At,{title:lt("$__clearFiles",1),text:lt("$__clearFiles"),color:"gray",icon:"clear_all",onClick:function(){ft({message:lt("$__confirmClearFiles",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){var t;w([]),e.reduxFunction("ASYNC","SET_CHATS",Object(h.a)(Object(h.a)({},De.getState().chats),{},{drafts:Object(h.a)(Object(h.a)({},De.getState().chats.drafts),{},Object(O.a)({},e.nodeId,Object(h.a)(Object(h.a)({},(null===(t=De.getState().chats.drafts)||void 0===t?void 0:t[e.nodeId])||{}),{},{files:null})))}))}})},size:"25px"})),i.a.createElement("div",{style:{position:"relative",width:"100%",float:"left",padding:3,overflow:"auto",display:"flex"}},_.map((function(e,t){var n=e.name.split("."),a="attachment";return r.fileExtensions.filter((function(e){return e.ext.indexOf(n[n.length-1].toLowerCase())>-1})).length>0&&(a=r.fileExtensions.filter((function(e){return e.ext.indexOf(n[n.length-1].toLowerCase())>-1}))[0].icon||URL.createObjectURL(e)),i.a.createElement("div",{key:t,title:e.name,style:{position:"relative",padding:7,width:"100px",justifyContent:"center"}},i.a.createElement("div",{style:{position:"relative",width:"50px",height:"50px",margin:"auto",display:"flex",justifyContent:"center",alignItems:"center"}},"string"===typeof a&&-1===a.indexOf("blob:")&&-1===a.indexOf("svg")?i.a.createElement(kt,{icon:a,size:"50px"}):i.a.createElement("img",{src:a,style:{width:"100%",height:"100%"}})),i.a.createElement("div",{style:{position:"relative",margin:"auto",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"calc(100% - 30px)",overflow:"hidden"}},e.name),i.a.createElement("div",{style:{position:"absolute",top:0,right:3,display:"flex"}},S&&S.length>0&&S[t]?i.a.createElement(kt,{icon:"cloud_done",color:"green"}):d?i.a.createElement(i.a.Fragment,null):i.a.createElement(kt,{icon:"delete_forever",color:"red",onClick:function(){return function(e){var t=Array.from(_);t.splice(e,1),w(t)}(t)}})),P&&P.fi===t?i.a.createElement(At,{title:lt("$__uploadFiles",1),text:lt("$__fileSendErrorClickToReSend"),color:"red",icon:"upload",onClick:function(){pe({comment:P.options.comment},P.fi,S),D(null)},size:"25px"}):I&&String(I[t])&&I[t]<100?i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{minWidth:177}},i.a.createElement(Ga.a,{variant:"buffer",className:re.progressBar,value:I[t]<90?I[t]:90,valueBuffer:I[t]})),i.a.createElement("div",{style:{color:dt("color"),fontSize:10,marginLeft:15}},I[t]<90?I[t]:90,"%"))):i.a.createElement(i.a.Fragment,null))})))):i.a.createElement(i.a.Fragment,null)):i.a.createElement(i.a.Fragment,null),z&&i.a.createElement(vo,{style:{marginBottom:15,backgroundColor:"#f0f0f0",padding:7}},i.a.createElement("div",{style:{position:"absolute",right:"20px"}},i.a.createElement(At,{title:lt("$__removePreview"),color:"red",icon:"delete_forever",size:"14px",onClick:function(){M(null),R(!1)}})),z.img&&i.a.createElement(xo,{xs:12,sm:6,md:4,lg:3,xl:2},i.a.createElement("img",{style:{width:"-webkit-fill-available"},src:"".concat(z.img?z.img:on.a),alt:z.title||z.link})),i.a.createElement(xo,{xs:12,sm:6,md:8,lg:9,xl:10},i.a.createElement("div",{style:{fontSize:"14px",color:dt("menu"),fontWeight:"bold"}},z.title),z.site&&i.a.createElement("div",{style:{fontSize:"12px"}},z.site),z.contentSnippet&&i.a.createElement("div",{style:{fontSize:"12px",color:"gray"}},z.contentSnippet),i.a.createElement("a",{style:{marginTop:"15px",fontWeight:"bold",fontSize:"12px"},href:z.link,target:"_blank"},lt("$__openLink","*")))),P?i.a.createElement("div",{style:{position:"relative",height:"60px",backgroundColor:"#ffffff",width:"100%",padding:15,textAlign:"center",display:"flex",justifyContent:"center"}},i.a.createElement(At,{title:lt("$__fileSendErrorClickToReSend",1),text:lt("$__fileSendErrorClickToReSend"),color:"red",icon:"upload",onClick:function(){pe({comment:P.options.comment},P.fi,S),D(null)},size:"25px"})):d?i.a.createElement("div",{style:{position:"relative",height:"60px",backgroundColor:"#ffffff",width:"100%",padding:15}},lt("$__sending",1),i.a.createElement(Ga.a,{className:re.progressBar})):i.a.createElement("div",{ref:ae,style:{position:"relative",height:"auto",borderRadius:"7px",display:"flex",alignItems:"center",padding:"3px 0px 4px 0px"}},i.a.createElement($a.b,{id:"sendingInput_".concat(e.nodeId),value:c.trim().length>0?c:"",onChange:function(e){he(e.target.value),ae.current&&ae.current.clientHeight&&te(ae.current.clientHeight)},onBlur:function(t){t.target.value&&e.reduxFunction("ASYNC","SET_CHATS",Object(h.a)(Object(h.a)({},De.getState().chats),{},{drafts:Object(h.a)(Object(h.a)({},De.getState().chats.drafts),{},Object(O.a)({},e.nodeId,Object(h.a)(Object(h.a)({},De.getState().chats.drafts[e.nodeId]||{}),{},{message:t.target.value})))}))},onPaste:function(e){fe(e.clipboardData.files)},placeholder:lt("$__writeMessage"),style:Object(h.a)(Object(h.a)({},Ha),{},{position:"relative",width:"calc(100% - 130px)",margin:"7px",maxHeight:"150px",paddingRight:"7px",background:"none",border:"none",overflow:"auto !important"}),onKeyDown:function(e){13==e.keyCode&&(e.shiftKey?e.stopPropagation():c.length>0&&c.trim()&&c.trim().length>0?se():l(""))},autoFocus:!0,placement:"top",forceSuggestionsAboveCursor:!0,autosize:{minRows:1,maxRows:6}},i.a.createElement($a.a,{trigger:"@",data:me,renderSuggestion:function(t,n,a){var o=r.users[t.id]?r.users[t.id]:t;if(t&&t.id)return i.a.createElement("div",{style:{display:"flex",alignItems:"center",position:"relative"}},i.a.createElement(nn.a,{style:{position:"relative",width:"25px",height:"25px",marginRight:"7px"},src:t.image?t.image:r.cards&&e.nodeId&&r.cards[e.nodeId]&&r.cards[e.nodeId]._users&&r.cards[e.nodeId]._users[t.id]&&r.cards[e.nodeId]._users[t.id].image?r.cards[e.nodeId]._users[t.id].image:r.users[t.id]&&r.users[t.id].image?r.users[t.id].image:null}),i.a.createElement("div",null,i.a.createElement("div",null,a),o&&o._parent&&De.getState().db.users[o._parent]&&De.getState().db.users[o._parent].name?i.a.createElement("div",{style:{fontSize:11,color:"lightgray",marginTop:-3}},De.getState().db.users[o._parent].name):i.a.createElement(i.a.Fragment,null)),o&&o._parent&&De.getState().db.users[o._parent]&&De.getState().db.users[o._parent].image?i.a.createElement("div",{style:{position:"absolute",bottom:4,right:-7,width:15,height:15,borderRadius:"50%",backgroundImage:"url(".concat(De.getState().db.users[o._parent].image,")"),backgroundSize:"cover",backgroundRepeat:"no-repeat"}}):i.a.createElement(i.a.Fragment,null))},style:{backgroundColor:dt("color",.5),lineHeight:"17px",borderRadius:"7px",padding:"3px 2px",marginLeft:"-4px",fontWeight:"bold",maxHeight:250,overflow:"auto"}})),i.a.createElement("div",{style:{cursor:"pointer",zIndex:100,display:"flex",alignItems:"center"}},i.a.createElement(Ya,{title:lt("$__emojis",1),icon:J?"highlight_off":"sentiment_very_satisfied",color:dt("medium"),onClick:function(){K(!J)}}),!d&&i.a.createElement("div",{className:re.actionButton},i.a.createElement("input",{className:"input-text-timeline",style:{position:"absolute",marginRight:"3em",height:"24px",fontSize:"0",left:"0px",width:"24px",cursor:"pointer",border:"none",opacity:"0"},onChange:function(e){return fe(e.target.files)},multiple:!0,type:"file",accept:".png, .jpg, .jpeg, .bpm, .svg, .gif, .pdf, .mp4, .3gp, .ts, .mkv, .avi, .mov, .mts, m2ts, .mxf, .aac, aiff, .caf, .ogg, .mp3, .wav, .doc, .docx, .xls, .xlsx, .ppt, .pptx"}),i.a.createElement(kt,{icon:"attachment",color:dt("medium"),size:"22px"})),!d&&(c.trim().length>0||_.length>0)&&i.a.createElement(Ya,{title:lt("$__pressENTERtoSendorClickHere",1),icon:"send",color:dt("menu"),onClick:function(){return se()}}),e.closeOption&&i.a.createElement(kt,{title:lt("$__pressCRTL+ENTERtoSend",1),icon:"close",color:dt("color"),onClick:function(){return e.onClose()}}),J&&i.a.createElement("div",{style:{position:"absolute",bottom:"44px",right:"40px",zIndex:100}},i.a.createElement(Ma.a,{onEmojiClick:function(e,t){l("".concat(c," ").concat(t.emoji))},groupVisibility:{recently_used:!1}})))))):i.a.createElement("div",{className:e.relative?re.editorRelative:re.editor,style:{backgroundColor:"#f0f0f0"}},lt("$__avaiableForViewingOnly")),i.a.createElement("div",{className:v?re.onDropFile:re.dropFile,onDragLeave:function(){!e.disabledSend&&y(!1)}},lt("$__dropTheFileToAttach","*"))))})),Oo=Object(Lt.a)((function(e){return{backdrop:{zIndex:e.zIndex.drawer+1,color:dt("medium")},box:{width:"70vw",height:"80vh",backgroundColor:"#FFFFFF",boxShadow:"0 0 6px rgba(0,0,0,0.3)",padding:"30px",overflowY:"auto"},title:{fontSize:"20px",fontWeight:"bold",marginBottom:"7px"},iconList:{},list:{position:"relative",width:"100%",float:"left",marginBottom:"30px"},icon:{position:"relative",float:"left",width:"50px",height:"50px"}}}));function jo(e){var t=Oo(),r=i.a.useState(!1),n=Object(Be.a)(r,2),a=n[0],o=n[1],c=i.a.useState(e.icon?e.icon:"add_photo_alternate"),l=Object(Be.a)(c,2),s=l[0],u=l[1];return i.a.useEffect((function(){u(e.icon)}),[e.icon]),i.a.createElement("div",{style:Object(h.a)({},e.style?e.style:{})},a?i.a.createElement(Je.a,{className:t.backdrop,open:a,onClick:function(){return o(!1)}},i.a.createElement("div",{className:t.box},So&&Object.keys(So).map((function(r,n){return i.a.createElement("div",{key:n,className:t.list},i.a.createElement("div",{className:t.title},r),i.a.createElement("div",{className:t.iconList},So[r]&&So[r].map((function(r,n){return i.a.createElement("div",{key:n,className:t.icon},i.a.createElement(kt,{icon:r,size:"30px",color:e.color?e.color:dt("color"),onClick:function(){u(r),o(!1),e.callBack&&e.callBack(r),e.onChange&&e.onChange(r)}}))}))))})))):i.a.createElement(kt,{icon:s,color:e.color?e.color:dt("color"),size:e.size||"30px",onClick:function(){e.onChange&&o(!0)}}))}var So={Action:["3d_rotation","accessibility","accessibility_new","accessible","accessible_forward","account_balance","account_balance_wallet","account_box","account_circle","add_shopping_cart","addchart","admin_panel_settings","alarm","alarm_add","alarm_off","alarm_on","all_inbox","all_out","analytics","anchor","android","announcement","api","app_blocking","arrow_circle_down","arrow_circle_up","arrow_right_alt","article","aspect_ratio","assessment","view_comfy","view_comfy_ind","view_comfy_late","view_comfy_return","view_comfy_returned","view_comfy_turned_in","autorenew","backup","backup_table","batch_prediction","book","bookmark","bookmark_border","bookmarks","bug_report","build","build_circle","cached","calendar_today","calendar_view_day","camera_enhance","cancel_schedule_send","card_giftcard","card_membership","card_travel","change_history","check_circle","check_circle_outline","chrome_reader_mode","class","close_fullscreen","code","comment_bank","commute","compare_arrows","contact_support","contactless","copyright","credit_card","dashboard","date_range","delete","delete_forever","delete_outline","description","dns","done","done_all","done_outline","donut_large","donut_small","drag_indicator","dynamic_form","eco","eject","euro_symbol","event","event_seat","exit_to_app","explore","explore_off","extension","face","fact_check","favorite","favorite_border","feedback","filter_alt","find_in_page","find_replace","fingerprint","flaky","flight_land","flight_takeoff","flip_to_back","flip_to_front","g_translate","gavel","get_app","gif","grade","grading","group_work","help","help_center","help_outline","highlight_alt","highlight_off","history","history_toggle_off","home","horizontal_split","hourglass_disabled","hourglass_empty","hourglass_full","http","https","important_devices","info","input","integration_instructions","invert_colors","label","label_important","label_off","language","launch","leaderboard","line_style","line_weight","list","lock","lock_open","login","loyalty","markunread_mailbox","maximize","mediation","minimize","model_training","next_plan","not_accessible","not_started","note_add","offline_bolt","offline_pin","online_prediction","opacity","open_in_browser","open_in_full","open_in_new","open_with","outlet","pageview","pan_tool","payment","pending","pending_actions","perm_camera_mic","perm_contact_calendar","perm_data_setting","perm_device_information","perm_identity","perm_media","perm_phone_msg","perm_scan_wifi","pets","picture_in_picture","picture_in_picture_alt","plagiarism","play_for_work","polymer","power_settings_new","pregnant_woman","preview","print","privacy_tip","query_builder","question_answer","quickreply","receipt","record_voice_over","redeem","remove_shopping_cart","reorder","report_problem","restore","restore_from_trash","restore_page","room","rounded_corner","rowing","rule","schedule","search","search_off","settings","settings_applications","settings_backup_restore","settings_bluetooth","settings_brightness","settings_cell","settings_ethernet","settings_input_antenna","settings_input_component","settings_input_composite","settings_input_hdmi","settings_input_svideo","settings_overscan","settings_phone","settings_power","settings_remote","settings_voice","shop","shop_two","shopping_bag","shopping_basket","shopping_cart","smart_button","source","speaker_notes","speaker_notes_off","spellcheck","star_rate","stars","sticky_note_2","store","subject","subtitles_off","supervised_user_circle","supervisor_account","support","swap_horiz","swap_horizontal_circle","swap_vert","swap_vertical_circle","sync_alt","system_update_alt","tab","tab_unselected","table_view","text_rotate_up","text_rotate_vertical","text_rotation_angledown","text_rotation_angleup","text_rotation_down","text_rotation_none","theaters","thumb_down","thumb_up","thumbs_up_down","timeline","toc","today","toll","touch_app","tour","track_changes","translate","trending_down","trending_flat","trending_up","turned_in","turned_in_not","update","upgrade","verified","verified_user","vertical_split","view_agenda","view_array","view_carousel","view_column","view_day","view_headline","view_list","view_module","view_quilt","view_sidebar","view_stream","view_week","visibility","visibility_off","voice_over_off","watch_later","wifi_protected_setup","work","work_off","work_outline","wysiwyg","youtube_searched_for","zoom_in","zoom_out"],Alert:["add_alert","auto_delete","error","error_outline","notification_important","warning"],Av:["4k","5g","add_to_queue","airplay","album","art_track","av_timer","branding_watermark","call_to_action","closed_caption","closed_caption_disabled","control_camera","equalizer","explicit","fast_forward","fast_rewind","featured_play_list","featured_video","fiber_dvr","fiber_manual_record","fiber_new","fiber_pin","fiber_smart_record","forward_10","forward_30","forward_5","games","hd","hearing","hearing_disabled","high_quality","library_add","library_add_check","library_books","library_music","loop","mic","mic_none","mic_off","missed_video_call","movie","music_video","new_releases","not_interested","note","pause","pause_circle_filled","pause_circle_outline","play_arrow","play_circle_filled","play_circle_outline","playlist_add","playlist_add_check","playlist_play","queue","queue_music","queue_play_next","radio","recent_actors","remove_from_queue","repeat","repeat_one","replay","replay_10","replay_30","replay_5","shuffle","skip_next","skip_previous","slow_motion_video","snooze","sort_by_alpha","speed","stop","stop_circle","subscriptions","subtitles","surround_sound","video_call","video_label","video_library","video_settings","videocam","videocam_off","volume_down","volume_mute","volume_off","volume_up","web","web_asset"],Communication:["add_ic_call","alternate_email","business","call","call_end","call_made","call_merge","call_missed","call_missed_outgoing","call_received","call_split","cancel_presentation","chat","chat_bubble","chat_bubble_outline","clear_all","comment","contact_mail","contact_phone","contacts","desktop_access_disabled","dialer_sip","dialpad","domain_disabled","domain_verification","duo","email","forum","forward_to_inbox","hourglass_bottom","hourglass_top","import_contacts","import_export","invert_colors_off","list_alt","live_help","location_off","location_on","mail_outline","mark_chat_read","mark_chat_unread","mark_email_read","mark_email_unread","message","mobile_screen_share","more_time","nat","no_sim","pause_presentation","person_add_disabled","person_search","phone","phone_disabled","phone_enabled","phonelink_erase","phonelink_lock","phonelink_ring","phonelink_setup","portable_wifi_off","present_to_all","print_disabled","qr_code","qr_code_scanner","read_more","ring_volume","rss_feed","screen_share","sentiment_satisfied_alt","speaker_phone","stay_current_landscape","stay_current_portrait","stay_primary_landscape","stay_primary_portrait","stop_screen_share","swap_calls","textsms","unsubscribe","voicemail","vpn_key","wifi_calling"],Content:["add","add_box","add_circle","add_circle_outline","amp_stories","archive","backspace","ballot","biotech","block","calculate","clear","contant_copy","content_cut","content_paste","create","delete_sweep","drafts","dynamic_feed","file_copy","filter_list","flag","font_download","foward","gesture","how_to_reg","how_to_vote","inbox","insights","link","link_off","low_priority","mail","markunread","move_to_inbox","next_week","outlined_flag","policy","push_pin","redo","remove","remove_circle","remove_circle_outline","reply","reply_all","report","report_off","save","save_alt","select_all","send","sort","square_foot","text_format","unarchive","undo","waves","weekend","where_to_vote"],Device:["access_alarm","access_time","ad_units","add_alarm","add_to_home_screen","airplanemode_active","airplanemode_inactive","battery_alert","battery_charging_full","battery_full","battery_std","battery_unknown","bluetooth","bluetooth_connected","bluetooth_disabled","bluetooth_searching","brightness_auto","brightness_high","brightness_low","brightness_medium","data_usage","developer_mode","devices","dvr","gps_fixed","gps_not_fixed","gps_off","graphic_eq","location_disabled","location_searching","mobile_friendly","mobile_off","nfc","screen_lock_landscape","screen_lock_portrait","screen_lock_rotation","screen_rotation","sd_storage","settings_system_daydream","signal_cellular_4_bar","signal_cellular_alt","signal_cellular_connected_no_internet_4_bar","signal_cellular_no_sim","signal_cellular_null","signal_cellular_off","signal_wifi_4_bar","signal_wifi_4_bar_lock","signal_wifi_off","storage","usb","wallpaper","widgets","wifi_lock","wifi_tethering"],Editor:["add_comment","attach_file","attach_money","bar_chart","border_all","border_bottom","border_clear","border_horizontal","border_inner","border_left","border_outer","border_right","border_style","border_top","border_vertical","bubble_chart","drag_handle","format_align_center","format_align_justify","format_align_left","format_align_right","format_bold","format_clear","format_color_reset","format_indent_decrease","format_indent_increase","format_italic","format_line_spacing","format_list_bulleted","format_list_numbered","format_list_numbered_rtl","format_paint","format_quote","format_shapes","format_size","format_strikethrough","format_textdirection_l_to_r","format_textdirection_r_to_l","format_underlined","functions","height","highlight","horizontal_rule","insert_chart","insert_chart_outlined","insert_comment","insert_drive_file","insert_emoticon","insert_invitation","insert_link","insert_photo","linear_scale","merge_type","mode_comment","monetization_on","money_off","multiline_chart","notes","pie_chart","post_add","publish","scatter_plot","score","short_text","show_chart","space_bar","strikethrough_s","subscript","superscript","table_chart","table_rows","text_fields","title","vertical_align_bottom","vertical_align_center","vertical_align_top","wrap_text"],File:["attach_email","attachment","cloud","cloud_circle","cloud_done","cloud_download","cloud_off","cloud_quere","cloud_upload","create_new_folder","folder","folder_open","folder_shared","request_quote","rule_folder","snippet_folder","text_snippet","topic"],Hardware:["browser_not_supported","cast","cast_connected","cast_for_education","computer","desktop_mac","desktop_windows","developer_board","device_hub","device_unknown","devices_other","dock","gamepad","headset","headset_mic","keyboard","keyboard_arrow_down","keyboard_arrow_left","keyboard_arrow_right","keyboard_arrow_up","keyboard_backspace","keyboard_capslock","keyboard_hide","keyboard_return","keyboard_tab","keyboard_voice","laptop","laptop_chromebook","laptop_mac","laptop_windows","memory","mouse","phone_android","phone_iphone","phonelink","phonelink_off","point_of_sale","power_input","router","scanner","security","sim_card","smartphone","speaker","speaker_group","tablet","tablet_android","tablet_mac","toys","tv","videogame_asset","watch"],Home:["sensor_door","sensor_window"],Image:["add_a_photo","add_photo_alternate","add_to_photos","adjust","assistant","assistant_photo","audiotrack","bedtime","blur_circular","blur_linear","blur_off","blur_on","brightness_1","brightness_2","brightness_3","brightness_4","brightness_5","brightness_6","brightness_7","broken_image","brush","burst_mode","camera","camera_alt","camera_front","camera_rear","camera_roll","center_focus_strong","center_focus_weak","collections","collections_bookmark","color_lens","colorize","compare","control_point","control_point_duplicate","crop","crop_16_9","crop_3_2","crop_5_4","crop_7_5","crop_din","crop_free","crop_landscape","crop_original","crop_portrait","crop_rotate","crop_square","dehaze","details","edit","euro","exposure","exposure_neg_1","exposure_neg_2","exposure_plus_1","exposure_plus_2","exposure_zero","filter","filter_1","filter_2","filter_3","filter_4","filter_5","filter_6","filter_7","filter_8","filter_9","filter_9_plus","filter_b_and_w","filter_center_focus","filter_drama","filter_frames","filter_hdr","filter_none","filter_tilt_shift","filter_vintage","flare","flash_auto","flash_off","flash_on","flip","flip_camera_android","flip_camera_ios","gradient","grain","grid_off","grid_on","hdr_off","hdr_on","hdr_strong","hdr_weak","healing","image","image_aspect_ratio","image_not_supported","image_search","iso","landscape","leak_add","leak_remove","lens","linked_camera","looks","looks_3","looks_4","looks_5","looks_6","looks_one","looks_two","loupe","monochrome_photos","motion_photos_on","motion_photos_paused","movie_creation","movie_filter","music_note","music_off","nature","nature_people","navigate_before","navigate_next","palette","panorama","panorama_fish_eye","panorama_horizontal","panorama_vertical","panorama_wide_angle","photo","photo_album","photo_camera","photo_filter","photo_library","photo_size_select_actual","photo_size_select_large","photo_size_select_small","picture_as_pdf","portrait","receipt_long","remove_red_eye","rotate_90_degrees_ccw","rotate_left","rotate_right","shutter_speed","slideshow","straighten","style","switch_camera","switch_video","tag_faces","texture","timelapse","timer","timer_10","timer_3","timer_off","tonality","transform","tune","view_comfy","view_compact","vignette","wb_auto","wb_cloudy","wb_incandescent","wb_iridescent","wb_sunny"],Maps:["360","add_business","add_location","add_location_alt","add_road","agriculture","alt_route","atm","beenhere","bike_scooter","category","cleaning_services","compass_calibration","departure_board","design_services","directions","directions_bike","directions_boat","directions_bus","directions_car","directions_railway","directions_run","directions_subway","directions_transit","directions_walk","edit_attributes","edit_location","edit_road","electric_bike","electric_car","electric_moped","electric_scooter","electrical_services","ev_station","fastfood","flight","handyman","home_repair_service","hotel","hvac","layers","layers_clear","local_activity","local_airport","local_atm","local_bar","local_cafe","local_car_wash","local_convenience_store","local_dining","local_drink","local_fire_department","local_florist","local_gas_station","local_grocery_store","local_hospital","local_hotel","local_laundry_service","local_library","local_mall","local_movies","local_offer","local_parking","local_pharmacy","local_phone","local_pizza","local_play","local_police","local_post_office","local_printshop","local_see","local_shipping","local_taxi","map","maps_ugc","medical_services","menu_book","miscellaneous_services","money","moped","multiple_stop","museum","my_location","navigation","near_me","near_me_disabled","no_meals","no_transfer","not_listed_location","pedal_bike","person_pin","person_pin_circle","pest_control","pest_control_rodent","pin_drop","place","plumbing","rate_review","restaurant","restaurant_menu","run_circle","satellite","set_meal","store_mall_directory","streetview","subway","terrain","traffic","train","tram","transfer_within_a_station","transit_enterexit","trip_origin","two_wheeler","wine_bar","wrong_location","zoom_out_map"],Navigation:["app_settings_alt","apps","arrow_back","arrow_back_ios","arrow_downward","arrow_drop_down","arrow_drop_down_circle","arrow_drop_up","arrow_forward","arrow_forward_ios","arrow_left","arrow_right","arrow_upward","campaign","cancel","check","chevron_left","chevron_right","close","double_arrow","east","expand_less","expand_more","first_page","fullscreen","fullscreen_exit","home_work","last_page","legend_toggle","menu","menu_open","more_horiz","more_vert","north","north_east","north_west","payments","refresh","south","south_east","south_west","subdirectory_arrow_left","subdirectory_arrow_right","switch_left","switch_right","unfold_less","unfold_more","west"],Notification:["account_tree","adb","airline_seat_flat","airline_seat_flat_angled","airline_seat_individual_suite","airline_seat_legroom_extra","airline_seat_legroom_normal","airline_seat_legroom_reduced","airline_seat_recline_extra","airline_seat_recline_normal","bluetooth_audio","confirmation_number","directions_off","disc_full","drive_eta","enhanced_encryption","event_available","event_busy","event_note","folder_special","live_tv","mms","more","network_check","network_locked","no_encryption","ondemand_video","personal_video","phone_bluetooth_speaker","phone_callback","phone_forwarded","phone_in_talk","phone_locked","phone_missed","phone_paused","power","power_off","priority_high","sd_card","sms","sms_failed","support_agent","sync","sync_disabled","sync_problem","system_update","tap_and_play","time_to_leave","tv_off","vibration","voice_chat","vpn_lock","wc","wifi","wifi_off"],Places:["ac_unit","airport_shuttle","all_inclusive","apartment","baby_changing_station","backpack","bathtub","beach_access","bento","business_center","carpenter","casino","charging_station","checkroom","child_care","child_friendly","corporate_fare","countertops","do_not_step","do_not_touch","dry","elevator","escalator","escalator_warning","family_restroom","fence","fire_extinguisher","fitness_center","food_bank","foundation","free_breakfast","golf_course","grass","hot_tub","house","house_siding","kitchen","meeting_room","microwave","night_shelter","no_cell","no_drinks","no_flash","no_food","no_meeting_room","no_photography","no_stroller","pool","rice_bowl","roofing","room_preferences","room_service","rv_hookup","smoke_free","smoking_rooms","soap","spa","sports_bar","stairs","storefront","stroller","tapas","tty","umbrella","wash","water_damage","wheelchair_pickup"],Social:["6_ft_apart","architecture","book_online","cake","clean_hands","connect_without_contact","construction","coronavirus","deck","domain","elderly","emoji_emotions","emoji_events","emoji_flags","emoji_food_beverage","emoji_nature","emoji_objects","emoji_people","emoji_symbols","emoji_transportation","engineering","fireplace","follow_the_signs","group","group_add","history_edu","king_bed","leave_bags_at_home","location_city","masks","military_tech","mood","mood_bad","nights_stay","notifications","notifications_active","notifications_none","notifications_off","notifications_paused","outdoor_grill","pages","party_mode","people","people_alt","people_outline","person","person_add","person_add_alt_1","person_outline","person_remove","plus_one","poll","psychology","public","public_off","reduce_capacity","sanitizer","school","science","self_improvement","sentiment_dissatisfied","sentiment_satisfied","sentiment_very_dissatisfied","sentiment_very_satisfied","share","sick","single_bed","sports","sports_baseball","sports_basketball","sports_cricket","sports_esports","sports_football","sports_golf","sports_handball","sports_hockey","sports_kabaddi","sports_mma","sports_motorsports","sports_rugby","sports_soccer","sports_tennis","sports_volleyball","thumb_down_alt","thumb_up_alt","whatshot"],Toggle:["check_box","check_box_outline_blank","indeterminate_check_box","radio_button_checked","radio_button_unchecked","star","star_border","star_half","star_outline","toggle_off","toggle_on"]},ko={header:Object(h.a)(Object(h.a)({},rr),{},{display:"flex",width:"100%",justifyContent:"space-between"}),content:{position:"relative",width:"100%",height:"100%",display:"flex"},info:{display:"flex",width:"100%",alignItems:"center"},headerIcon:{display:"contents",alignItems:"center"},headerTitle:{width:"calc(100% - 33px)",overflowX:"hidden",overflowY:"hidden",fontWeight:"bold",paddingTop:"3px"},actionButtons:{right:0,display:"flex"},cancelButton:{right:"4px",position:"absolute",cursor:"pointer"},saveButton:{right:"33px",position:"absolute",cursor:"pointer"},button:{padding:"3px auto",cursor:"pointer",alignItems:"center",display:"flex",opacity:1},parent:{width:"100%",padding:"0 5px","& .title":{color:dt("medium"),fontSize:"10px",textTransform:"uppercase"},"& .info":{marginTop:"-8px",color:dt("color"),fontWeight:"500",alignItems:"center"}}};function Lo(){Lo=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Co=Object(Lt.a)(ko);var Io=Object($e.b)((function(){return{}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.session,n=t.functions.socket,a=Co(),o=i.a.useState(!1),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.useState(!1),d=Object(Be.a)(u,2),p=d[0],f=d[1],m=i.a.useState(e.title?e.title.trim():""),g=Object(Be.a)(m,2),v=g[0],y=g[1],b=i.a.useState(e.icon||null),x=Object(Be.a)(b,2),_=x[0],w=x[1],E=i.a.useState(!1),O=Object(Be.a)(E,2),j=O[0],S=O[1],k=i.a.useState(!1),L=Object(Be.a)(k,2),C=L[0],I=L[1],F=e.customButtons&&e.customButtons.filter((function(e){return!1!==e}));i.a.useEffect((function(){l||(!e.title&&e.editable&&S(!0),s(!0))}));var T=function(){var t=Object(Me.a)(Lo().mark((function t(){return Lo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:try{e._id&&n.emit("data",{module:"node",method:"put",action:"update",noLog:!0},{_id:e._id,name:v}),e.onEdit&&e.onEdit(Object(h.a)({name:v},_?{icon:_}:{}),e._id?e._id:null)}catch(r){console.log(r)}S(!1);case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return i.a.createElement("div",{className:a.header,style:Object(h.a)({minHeight:"30px",display:"flex",alignItems:"center"},e.style),onMouseEnter:function(){return f(!0)},onMouseLeave:function(){C||f(!1)}},i.a.createElement("div",{className:a.content},i.a.createElement("div",{className:a.info},e.searchText?i.a.createElement("div",{style:{marginLeft:"7px"}},yt(e.title?e.title:"",e.searchText)):i.a.createElement("div",{className:a.headerTitle,style:{fontSize:e.fontSize?e.fontSize:"16px",color:e.color?e.color:dt("colorText"),paddingRight:"7px",marginLeft:e.icon?"7px":"none",width:"100%"},onDoubleClick:function(){e.onEdit&&e.editable&&(y(e.title?e.title.trim():""),S(!0))}},i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",display:"flex",alignItems:"center"}},e.icon||e.permitIcon?i.a.createElement(jo,{icon:e.icon||"perm_media",color:e.color?e.color:dt("colorText"),onChange:e.onChangeIcon||e.editable&&e.permitIcon?function(t){e.onChangeIcon&&e.onChangeIcon(t),w(t)}:null,size:"calc(".concat(e.fontSize," + 4px)")||!1,style:{marginRight:7}}):i.a.createElement(i.a.Fragment,null),j?i.a.createElement(i.a.Fragment,null,i.a.createElement(La,{label:e.placeholder?e.placeholder:lt("$__nameOfCard",1),variant:dt("fieldVariant"),name:"name",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",onChange:function(e){y(e.target.value)},onKeyDown:function(t){13===t.keyCode&&v&&T(),27===t.keyCode&&(S(!1),y(e.title?e.title.trim():""))}},value:v,placeholder:e.placeholder?e.placeholder:lt("$__titleOfCard_placeholder",1),autoFocus:!e.noAutoFocus,multiline:!!e.multiline}),(j||e.onSave)&&i.a.createElement(At,{title:lt("$__save",1),color:"green",icon:"save",onClick:function(){j?e.noCancel?v&&T():T():e.onSave()},size:e.actionsSize||"25px",transparent:!0}),(j||e.onCancel)&&i.a.createElement(At,{title:lt("$__close",1),color:dt("colorText"),icon:"cancel",onClick:function(){j&&(e.onCancel?v&&S(!1):S(!1)),e.onCancel&&e.onCancel()},size:e.actionsSize||"25px",transparent:!0})):i.a.createElement(Qe.a,{title:e.tooltipText?e.tooltipText:e.title?e.title:""},i.a.createElement("div",{style:Object(h.a)({},e.expanded?{width:"100%"}:{width:"100%",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"})},"".concat(e.showOrder?"".concat(e.showOrder,". "):"").concat(e.title&&e.title.indexOf("$__")>-1?lt(e.title,1):e.title?function(e){var t=document.createElement("DIV");return t.innerHTML=e,t.textContent||t.innerText||""}(e.title):"")))))),e.periodFilter&&r&&r.period&&i.a.createElement("div",{style:{display:"flex",whiteSpace:"nowrap",marginRight:7}},lt(r.period),i.a.createElement(Sa,{style:{color:dt("menu"),height:"20px",width:"20px"}})),i.a.createElement("div",{className:a.actionButtons,style:Object(h.a)({},e.actionButtonsStyle?e.actionButtonsStyle:{})},e.actionsButtons&&e.onSave&&i.a.createElement(At,{title:lt("$__save",1),color:"green",icon:"save",onClick:function(){j?e.noCancel?v&&T():T():e.onSave()},size:e.actionsSize||"25px",transparent:!0}),e.actionsButtons&&e.onCancel&&i.a.createElement(At,{title:lt("$__close",1),color:"lightgrey",icon:"cancel",onClick:function(){j?e.noCancel?v&&S(!1):S(!1):e.onCancel()},size:e.actionsSize||"25px",transparent:!0}),!j&&e.timelineMessage&&p&&i.a.createElement("div",{className:a.button,style:{opacity:p?"1":"0"}},i.a.createElement(Qr,{overlap:"rectangular",onClick:function(){return I(!0)},icon:"add_comment",size:"20px",tooltipprops:C?{open:C,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,PopperProps:{disablePortal:!0},interactive:!0}:{},title:C?i.a.createElement("div",{style:{position:"relative",minWidth:"220px"}},i.a.createElement(Eo,{nodeId:e._id,onSending:function(){f(!1),I(!1)},onClose:function(){I(!1),f(!1)},relative:!0,closeOption:!0})):"$__addComment"})),!j&&F&&F.map((function(e,t){return e&&e.component?e.component:e&&!1!==e&&null!==e&&(p||"hover"!==e.show)&&i.a.createElement("div",Object.assign({key:t,className:a.button},e.provided),i.a.createElement(At,{title:e.title?lt(e.title,1):lt(e.name,1),color:dt(e.color||"colorText"),icon:e.icon,onClick:function(t){e.onClick&&e.onClick(t)},onMouseLeave:function(){C||f(!1)},onClose:e.onClose?function(){e.onClose&&e.onClose(),f(!1)}:null,size:e.actionsSize||"16px",transparent:!0,badgeContent:e.count?e.count:null}))})),e.children)))}));var Fo=function(e){var t={root:{position:"relative",width:"100%",background:"transparent !important","& .MuiLinearProgress-indeterminate":{background:"transparent !important"},"& .MuiLinearProgress-bar":{background:"".concat(dt("linearProgress")," !important")},"& .text":{position:"absolute",width:"40px",right:"-40px",top:"-9px",textAlign:"right",textSize:"11px",fontWeight:"bold",color:dt("color")}},bar:{borderRadius:7}},r=Object(Lt.a)(t)(),n=Object(h.a)({},e);return n.showText&&delete n.showText,n.customColor&&delete n.customColor,i.a.createElement("div",{className:r.root,style:e.showText?{width:"calc(100% - 40px)"}:{}},i.a.createElement(Ga.a,n),e.showText&&i.a.createElement("div",{className:"text"},Math.floor(e.value),"%"))},To=r(1797);function No(){No=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Po=function(){var e=Object(Me.a)(No().mark((function e(t){var r,n,a,o,i,c,l,s;return No().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.ids,t.searchText,n=t.page,a=void 0===n?0:n,o=t.limit,i=void 0===o?20:o,c=t.asc,void 0!==c&&c,l=t.childrens,void 0!==l&&l,e.next=3,new Promise(function(){var e=Object(Me.a)(No().mark((function e(n,o){var c,l;return No().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Sn.post("/Files_List_V2/",{ids:r,type:t.type?t.type:"cards",limit:i,skip:a*i});case 3:(c=e.sent)&&c.data&&(l=c.data,n(l)),e.next=13;break;case 7:e.prev=7,e.t0=e.catch(0),console.group("loadFiles::ERR::"),console.log(e.t0),console.groupEnd(),o(!0);case 13:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t,r){return e.apply(this,arguments)}}());case 3:if(!(s=e.sent)){e.next=6;break}return e.abrupt("return",s);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Do=function(){var e=Object(Me.a)(No().mark((function e(t){var r;return No().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise(function(){var e=Object(Me.a)(No().mark((function e(r,n){var a;return No().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Sn.post("/Files_Folders/",{ids:t&&t.ids?t.ids:[],childrens:!(!t||!t.childrens)&&t.childrens});case 3:(a=e.sent)&&a.data&&r(a.data),e.next=13;break;case 7:e.prev=7,e.t0=e.catch(0),console.group("loadFiles::ERR::"),console.log(e.t0),console.groupEnd(),n(!0);case 13:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t,r){return e.apply(this,arguments)}}());case 2:if(!(r=e.sent)){e.next=5;break}return e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ao=function(){var e=Object(Me.a)(No().mark((function e(t){var r,n,a,o,i,c,l,s,u,d,p;return No().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.ids,n=t.search,a=t.skip,o=void 0===a?null:a,i=t.limit,c=void 0===i?null:i,l=t.asc,s=void 0!==l&&l,u=t.childrens,d=void 0!==u&&u,e.next=3,new Promise(function(){var e=Object(Me.a)(No().mark((function e(a,i){var l,u;return No().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Sn.post("/Files_Nav/",{ids:r,skip:o,limit:c,search:n,asc:s,type:t.type?t.type:"cards",childrens:d});case 3:(l=e.sent)&&l.data&&(u=l.data,a(u)),e.next=13;break;case 7:e.prev=7,e.t0=e.catch(0),console.group("loadFiles::ERR::"),console.log(e.t0),console.groupEnd(),i(!0);case 13:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t,r){return e.apply(this,arguments)}}());case 3:if(!(p=e.sent)){e.next=6;break}return e.abrupt("return",p);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function $o(){$o=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var zo=Object($e.b)((function(e){return{showPrivate:e.controls.lockPrivate}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.db,n=(t.session,i.a.useState(null)),a=Object(Be.a)(n,2),o=a[0],c=a[1],l=i.a.useState(u),s=Object(Be.a)(l,2),u=s[0],d=(s[1],i.a.useState([])),p=Object(Be.a)(d,2),f=(p[0],p[1]),m=i.a.useState("created_at"),g=Object(Be.a)(m,2),v=(g[0],g[1],i.a.useState(!0)),y=Object(Be.a)(v,2),b=(y[0],y[1],i.a.useState("")),x=Object(Be.a)(b,2),_=(x[0],x[1],i.a.useState(!0)),w=Object(Be.a)(_,2),E=(w[0],w[1]),j=i.a.useState({}),S=Object(Be.a)(j,2),k=S[0],L=S[1],C=i.a.useState(""),I=Object(Be.a)(C,2),F=I[0],T=I[1],N=e.idPlan?e.idPlan:null;i.a.useEffect((function(){return P({id:N}),Do(),function(){f([]),L({}),E(!0)}}),[]);var P=function(){var e=Object(Me.a)($o().mark((function e(t,r){var n,a;return $o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Do({ids:t&&t.id?[t.id]:[],childrens:!1,type:t.type?t.type:null});case 2:(n=e.sent)&&(a=r||k,N&&(a=Object(h.a)(Object(h.a)({},a),{},Object(O.a)({},N,{name:De.getState().db.cards[N].name,parent:De.getState().db.cards[N]._parent,private:null,type:"plan",_id:N,open:!0}))),n.map((function(e){a=Object(h.a)(Object(h.a)({},a),{},Object(O.a)({},e._id,Object(h.a)(Object(h.a)({},a[e._id]?a[e._id]:{}),e)))})),L(a));case 4:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),D=function(){var e=Object(Me.a)($o().mark((function e(t){var r,n,a,o,i,c,l=arguments;return $o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=l.length>1&&void 0!==l[1]&&l[1],n=t.id,a=void 0===n?null:n,o=t.type,i=void 0===o?null:o,c=k,c=Object(h.a)(Object(h.a)({},c),{},Object(O.a)({},a,Object(h.a)(Object(h.a)({},c[a]),{},{open:r,loading:!0}))),0===Object.keys(k).filter((function(e){return k[e].parent===a})).length?P({id:a,type:i},c):L(c);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),A=function(t,n){return i.a.createElement("div",{key:n,style:{position:"relative",float:"left",clear:"both",cursor:"pointer",borderLeft:"solid 0.5px lightgray",paddingLeft:7,width:"100%"},onClick:function(r){(!t.private||t.private&&De.getState().controls.lockPrivate)&&(D({id:n},!k[n]||!k[n].open),c(n),e&&e.onSelect&&e.onSelect(k[n])),r.preventDefault(),r.stopPropagation()}},i.a.createElement(Io,{title:"".concat(t.private&&!De.getState().controls.lockPrivate?lt("$__private"):t.name),tooltipText:"".concat(t.private&&!De.getState().controls.lockPrivate?lt("$__private"):t.name),icon:(t.private&&!De.getState().controls.lockPrivate?"private_connectivity":t.type&&r&&r.dataType&&r.dataType.filter((function(e){return e.name===t.type}))[0].icon)||"$__topic",fontSize:"12px",color:t.private&&!De.getState().controls.lockPrivate?"lightgray":dt(o&&o===n?"color":"gray")}),k[n]&&k[n].open?$(n):i.a.createElement(i.a.Fragment,null))},$=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return i.a.createElement("div",{style:{marginLeft:7}},Object.keys(k).filter((function(t){return!e||e&&k[t].parent===e})).length>0?Object.keys(k).filter((function(t){return!e||e&&k[t].parent===e})).sort((function(e,t){return k[e].name.toLowerCase().trim()<k[t].name.toLowerCase().trim()?-1:k[e].name.toLowerCase().trim()>k[t].name.toLowerCase().trim()?1:0})).map((function(e){return A(k[e],e)})):i.a.createElement(i.a.Fragment,null))};return i.a.createElement("div",null,i.a.createElement("div",{style:{position:"relative",backgroundColor:"#FFFFFF",clear:"both",paddingTop:"15px"}},i.a.createElement("div",null,i.a.createElement("div",{style:{display:"flex",marginTop:-10}},i.a.createElement(La,{label:lt("$__search","*"),variant:"standard",autoFocus:!0,value:F,InputProps:{endAdornment:i.a.createElement(To.a,{position:"start"},i.a.createElement(kt,{color:dt("lightgray")},"search")),onChange:function(e){T(e.target.value)},onKeyDown:function(e){}}})),i.a.createElement("div",{style:{position:"relative",maxHeight:"40vh",overflowX:"auto",backgroundColor:"rgba(250,250,250,0.9)",borderRadius:"solid 0.5px rgba(0,0,0,0.1)",padding:15}},Object.keys(k).filter((function(e){return"chatGroup"!==k[e].type&&((!N||N&&36!==N.length)&&!k[e].parent||N&&36===N.length&&k[e]._id===N)&&(""===F||F&&k[e].name.toLowerCase().indexOf(F.toLowerCase().trim())>-1)})).sort((function(e,t){return k[e].name.toLowerCase().trim()<k[t].name.toLowerCase().trim()?-1:k[e].name.toLowerCase().trim()>k[t].name.toLowerCase().trim()?1:0})).map((function(e){return A(k[e],e)}))))))})),Mo=r(1822),Bo=Object(Ze.a)({root:{"&:hover":{backgroundColor:"transparent"},color:dt("color")}})(Mo.a),Yo=r(1798);function Go(){Go=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Ro=Object(Lt.a)((function(e){return{iconButtonStyleTransaparent:{margin:0,"&:hover":{backgroundColor:"rgba(250,250,250,0.9)"},"& .MuiAvatarGroup-avatar":{border:"none",zIndex:0}},iconButtonStyleWhite:{margin:0,backgroundColor:"#FFFFFF","&:hover":{backgroundColor:"rgba(250,250,250,0.9)"},"& .MuiAvatarGroup-avatar":{border:"none",zIndex:0}}}}));var Ho=Object($e.b)((function(e,t){return{data:e.db.cards[t._id]?e.db.cards[t._id]:{},store:{users:e.db.users}}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=Ro(),r=i.a.useRef(null),n=De.getState(),a=n.db,o=n.session,c=(n.functions,e.data),l=i.a.useState(!!e.open),s=Object(Be.a)(l,2),u=s[0],d=s[1],p=i.a.useState([]),f=Object(Be.a)(p,2),m=f[0],g=f[1],v=i.a.useState([]),y=Object(Be.a)(v,2),b=y[0],x=y[1],_=i.a.useState(""),w=Object(Be.a)(_,2),E=w[0],j=w[1],S=i.a.useState(!1),k=Object(Be.a)(S,2),L=k[0],C=k[1],I=i.a.useState(!1),F=Object(Be.a)(I,2),T=F[0],N=F[1],P=i.a.useState(ca(c._id)),D=Object(Be.a)(P,2),A=D[0];D[1],i.a.useEffect((function(){return function(){}}),[]);var $=xt(),z=ia(c._id),M=!1;z>3&&(M=!0),!M&&$.plan&&$.planAdmin&&(M=!0);var B=window.location.hash.split("/");function Y(e){"Tab"===e.key&&(e.preventDefault(),d(!1))}B[0]=B[0].replace("#","");var G=function(){var t=Object(Me.a)(Go().mark((function t(r,n){var o,i;return Go().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=1,c&&"plan"===c.type&&(o=3),n?o=n:c._planId&&a.cards[c._planId]&&a.cards[c._planId]._users&&a.cards[c._planId]._users[r]&&a.cards[c._planId]._users[r].access&&(o=c._parent&&a.cards[c._parent]&&a.cards[c._parent]._users&&a.cards[c._parent]._users[r]&&a.cards[c._parent]._users[r].access&&parseInt(a.cards[c._parent]._users[r].access)>parseInt(a.cards[c._planId]._users[r].access)?parseInt(a.cards[c._parent]._users[r].access):parseInt(a.cards[c._planId]._users[r].access)),i=!!(c&&c._users&&c._users[r]),t.next=6,ao(e,r,o,c._id,i);case 6:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),R=function(){var e=Object(Me.a)(Go().mark((function e(t){return Go().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:ot.put("cards/removeAccess/",{cardId:c._id,userIds:m}),g([]);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),H=function(){var t=Object(Me.a)(Go().mark((function t(){return Go().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:b.map((function(t){Zn(e,{_id:c._id,userId:t,option:!0})})),N(!1);case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),W=function(t){var r=t.pr,n=!1;e.permission&&(n=!0);var a=!1;c._users&&c._users[r]&&c._users[r].myDay&&c._users[r].myDay&&Ve()(1e3*parseInt(c._users[r].myDay)).tz("America/Sao_Paulo").format("DD/MM/YYYY")===Ve()(new Date).tz("America/Sao_Paulo").format("DD/MM/YYYY")&&(a=!0);var o=!!(Object.keys(A).length>1&&A[r]&&A[r].isResponsible),l=A[r]?A[r]:c._users[r];return i.a.createElement(xn.a,{onClick:n?function(){}:null,disabled:!n},i.a.createElement("div",{style:Object(h.a)({position:"relative",width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between"},n?{}:{cursor:"pointer"})},i.a.createElement("div",{style:{width:"33px",height:"33px",borderRadius:"50%",border:o?"3px deepskyblue solid":a?"2px #ff8800 solid":"none",backgroundImage:l.image?'url("'.concat(l.image,'")'):"null",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundColor:"lightgray",textAlign:"center"},src:l.image||null},!l.image&&l&&l.name?l.name.substr(0,1):""),l.name||l.name,i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},c._users[r]&&!c._users[r].isResponsible&&M?i.a.createElement(At,{title:lt("$__defineAsResponsible",1),color:"lightGray",icon:"admin_panel_settings",onClick:function(){ft({message:lt("$__confirmSetAsResponsibleCard",1),variant:"warning",persist:!1,horizontal:"left",confirm:function(){oo(e,{cardId:c._id,userId:r})}})},size:"25px"}):i.a.createElement(i.a.Fragment,null),i.a.createElement(Bo,Object.assign({},T?{checked:!!(a||b.indexOf(r)>-1)}:{checked:!!c._users[r]},{disabled:!(!T||!a),onClick:n?function(){if(T){var e=Array.from(b);-1===e.indexOf(r)?e.push(r):e.indexOf(r)>-1&&e.splice(e.indexOf(r),1),x(e)}else!function(e){var t=Array.from(m);c._users[e]&&-1===t.indexOf(e)?(t.push(e),g(t)):c._users[e]&&t.indexOf(e)>-1?(t.splice(t.indexOf(e),1),g(t)):c._users[e]||G(e)}(r)}:null,color:"default"}))),m.indexOf(r)>-1&&i.a.createElement("div",{style:{height:"2px",width:"100%",backgroundColor:"red",position:"absolute",top:"50%"}})))};return i.a.createElement("div",{onClick:function(e){e.stopPropagation()}},i.a.createElement(Nt.a,{ref:r,"aria-controls":u?"menu-list-grow":void 0,"aria-haspopup":"true","aria-label":"menu",onClick:function(t){(e.permission||c&&c._users&&c._users[o._id]&&c._users[o._id].access&&parseInt(c._users[o._id].access)>3)&&(d((function(e){return!e})),t.stopPropagation())},className:e.transparent?t.iconButtonStyleTransaparent:t.iconButtonStyleWhite},i.a.createElement(Wo,e)),i.a.createElement(mn.a,{open:u,anchorEl:r.current,transition:!0},(function(e){var t,r=e.TransitionProps,n=e.placement;return i.a.createElement(fn.a,Object.assign({},r,{style:{transformOrigin:"bottom"===n?"center top":"center bottom",maxHeight:"333px",minHeight:"333px",overflowY:"auto"}}),i.a.createElement(hn.a,null,i.a.createElement("div",{style:(t={position:"relative",width:"100%",paddingBottom:m&&m.length>0||b&&b.length>0?"50px":0},Object(O.a)(t,"width","100%"),Object(O.a)(t,"display","flex"),Object(O.a)(t,"justifyContent","space-between"),t)},i.a.createElement(pn.a,{onClickAway:function(){d(!1),N(!1),x([])}},i.a.createElement("div",null,L&&i.a.createElement("div",{style:{position:"relative",marginTop:15,width:"100%",padding:"4px 15px",fontSize:"16px",color:"lightGray"}},i.a.createElement(La,{id:"quickUser_Search",label:lt("$__searchByName",1),variant:dt("fieldVariant"),name:"fullName",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end",style:{cursor:"pointer"},onClick:function(){j(""),C(!1)}},i.a.createElement(kt,{icon:"close"})),onChange:function(e){j(e.target.value)},onBlur:function(e){}},value:E,placeholder:lt("$__searchByName",1),autoFocus:!0})),i.a.createElement(_n.a,{autoFocusItem:u,id:"menu-list-grow",onKeyDown:Y},T?i.a.createElement("div",{style:{position:"relative",overflow:"auto"}},i.a.createElement(xn.a,{disabled:!0},lt("$__selectUsersToMyDay","*")),Object.keys(c._users).filter((function(e){return e!==o._id})).sort((function(e,t){var r,n,a,o;return(null===(r=c._users[e])||void 0===r?void 0:r.name)&&(null===(n=c._users[t])||void 0===n?void 0:n.name)&&c._users[e].name.toLowerCase()<c._users[t].name.toLowerCase()?-1:(null===(a=c._users[e])||void 0===a?void 0:a.name)&&(null===(o=c._users[t])||void 0===o?void 0:o.name)&&c._users[e].name.toLowerCase()>c._users[t].name.toLowerCase()?1:0})).map((function(e){Object.keys(c._users).length>1&&c._users[e].isResponsible;return c._users[e].myDay&&c._users[e].myDay&&Ve()(1e3*parseInt(c._users[e].myDay)).tz("America/Sao_Paulo").format("DD/MM/YYYY")===Ve()(new Date).tz("America/Sao_Paulo").format("DD/MM/YYYY")&&!0,i.a.createElement(W,{pr:e,key:e})}))):i.a.createElement("div",null,i.a.createElement(xn.a,{disabled:!0},lt("$__internalUsers","*")),Object.keys(A).filter((function(e){if((!E||E&&A[e].name.toLowerCase().indexOf(E.toLowerCase())>-1)&&"user"===A[e].type&&!A[e].deleted&&!A[e]._parent)return!0})).sort((function(e,t){return A[e].name<A[t].name?-1:A[e].name>A[t].name?1:0})).map((function(e){return A&&A[e]&&A[e]._id&&i.a.createElement(W,{pr:e,key:e})})),Object.keys(A).filter((function(e){if((!E||E&&A[e].name.toLowerCase().indexOf(E.toLowerCase())>-1)&&"external"===A[e].type&&!A[e].deleted)return!0})).length>0&&i.a.createElement(xn.a,{disabled:!0},lt("$__UnityUsers","*")),Object.keys(A).filter((function(e){return(!E||E&&A[e].name.toLowerCase().indexOf(E.toLowerCase())>-1)&&"external"===A[e].type&&!A[e].deleted})).sort((function(e,t){return A[e].name<A[t].name?-1:A[e].name>A[t].name?1:0})).map((function(e){return A&&A[e]&&A[e]._id&&i.a.createElement(W,{pr:e,key:e})})),Object.keys(A).filter((function(e){if((!E||E&&A[e].name.toLowerCase().indexOf(E.toLowerCase())>-1)&&"consultant"===A[e].type&&!A[e].deleted)return!0})).length>0&&i.a.createElement(xn.a,{disabled:!0},lt("$__planningUsers","*")),Object.keys(A).filter((function(e){if((!E||E&&A[e].name.toLowerCase().indexOf(E.toLowerCase())>-1)&&"consultant"===A[e].type&&!A[e].deleted)return!0})).sort((function(e,t){return A[e].name<A[t].name?-1:A[e].name>A[t].name?1:0})).map((function(e){return A&&A[e]&&A[e]._id&&i.a.createElement(W,{pr:e,key:e})})))),L||T?i.a.createElement(i.a.Fragment,null):i.a.createElement("div",{style:{position:"absolute",right:15,top:10}},i.a.createElement(At,{title:lt("$__searchUser",1),color:dt("menu"),icon:"search",onClick:function(){C(!0)},size:"25px"})),L||T||!M?T?i.a.createElement("div",{style:{position:"absolute",right:15,top:10}},i.a.createElement(At,{title:lt("$__back",1),color:dt("menu"),icon:"arrow_back",onClick:function(){N(!1)},size:"25px"})):i.a.createElement(i.a.Fragment,null):i.a.createElement("div",{style:{position:"absolute",right:45,top:10}},i.a.createElement(At,{title:lt("$__sendToMyDay",1),color:"orange",icon:"schedule_send",onClick:function(){N(!0)},size:"25px"}))))),m&&m.length>0&&i.a.createElement("div",{style:{position:"absolute",bottom:"0px",padding:"7px",backgroundColor:"red",width:"100%",display:"flex",justifyContent:"space-between",color:"#FFFFFF",alignItems:"center",zIndex:10},onClick:function(e){e.preventDefault(),e.stopPropagation()}},lt("$__confirmSelectedUsersRemove"),i.a.createElement(At,{title:lt("$__remove",1),color:"#FFFFFF",icon:"delete_forever",onClick:function(){R()},size:"25px",transparent:!0})),T&&b&&b.length>0&&i.a.createElement("div",{style:{position:"absolute",bottom:"0px",padding:"7px",backgroundColor:"orange",width:"100%",display:"flex",justifyContent:"space-between",color:"#FFFFFF",alignItems:"center"},onClick:function(e){e.preventDefault(),e.stopPropagation()}},i.a.createElement(Yo.a,{style:{flexWrap:"wrap"}},b.map((function(e,t){return e&&De.getState().db.users[e]?i.a.createElement(Qe.a,{title:De.getState().db.users[e].name,key:e},i.a.createElement(nn.a,{alt:De.getState().db.users[e].name,src:De.getState().db.users[e].image||null,style:{width:"23px",height:"23px"}},De.getState().db.users[e].name.substr(0,1))):i.a.createElement(i.a.Fragment,null)}))),i.a.createElement(At,{title:lt("$__sendToMyDay",1),color:"#FFFFFF",icon:"schedule_send",onClick:function(){H()},size:"25px",transparent:!0}))))})))}));var Wo=function(e){var t=e.data;return i.a.createElement("div",null,0===Object.keys(t._users).length?lt("$__selectUsers"):i.a.createElement("div",{style:{display:"flex"}},Object.keys(t._users).sort((function(e,r){return t._users[e].isResponsible?-1:t._users[r].isResponsible?1:t._users[e].name<t._users[r].name?-1:t._users[e].name>t._users[r].name?1:0})).map((function(r,n){var a=!1,o=!!(Object.keys(t._users).length>1&&t._users[r].isResponsible);if(t._users[r].myDay&&t._users[r].myDay&&Ve()(1e3*parseInt(t._users[r].myDay)).tz("America/Sao_Paulo").format("DD/MM/YYYY")===Ve()(new Date).tz("America/Sao_Paulo").format("DD/MM/YYYY")&&(a=!0),t._users[r]&&t._users[r].name){var c=e.noLimit?7:e.limit?e.limit:7;if(n<c)return i.a.createElement("div",{key:r,style:{marginLeft:-7,position:"relative"}},i.a.createElement(Qe.a,{title:"".concat(t._users[r].name).concat(a?" (".concat(lt("$__inMyDay"),")"):""),key:r},i.a.createElement("div",{overlap:"circular",alt:t._users[r].name,src:t._users[r].image||null,style:{width:a||o?"30px":e.avatarSize?e.avatarSize:"24px",height:a||o?"30px":e.avatarSize?e.avatarSize:"24px",borderRadius:"50%",border:o?"3px deepskyblue solid":a?"2px #ff8800 solid":"none",backgroundImage:t._users[r].image?'url("'.concat(t._users[r].image,'")'):"null",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundColor:"lightgray",textAlign:"center"}},t._users[r].image?"":t._users[r].name.substr(0,1))),a&&i.a.createElement("div",{style:{position:"absolute",backgroundColor:"#ff8800",width:"14px",height:"14px",borderRadius:"14px",display:"flex",alignItems:"center",justifyContent:"center",right:"7px",bottom:0}},i.a.createElement(kt,{icon:"hourglass_top",size:"10px",color:"#FFFFFF"})));if(n===c){var l=Object.keys(t._users).length-c;return i.a.createElement(Qe.a,{title:i.a.createElement("ul",{style:{listingStyle:"none",padding:0}},Object.keys(t._users).sort((function(e,r){return t._users[e].isResponsible?-1:t._users[r].isResponsible?1:t._users[e].name<t._users[r].name?-1:t._users[e].name>t._users[r].name?1:0})).map((function(r,n){if(t._users[r].myDay&&t._users[r].myDay&&Ve()(1e3*parseInt(t._users[r].myDay)).tz("America/Sao_Paulo").format("DD/MM/YYYY")===Ve()(new Date).tz("America/Sao_Paulo").format("DD/MM/YYYY")&&!0,n>=c&&t._users[r]&&t._users[r].name)return i.a.createElement("li",{key:r,style:{display:"flex",alignItems:"center"}},i.a.createElement(nn.a,{overlap:"circular",alt:t._users[r].name,src:t._users[r].image||null,style:{width:e.avatarSize?e.avatarSize:"22px",height:e.avatarSize?e.avatarSize:"22px",border:t._users[r].isResponsible?"3px deepskyblue solid":t._users[r].myDay?"2px #ff8800 solid":"none",marginRight:7}},t._users[r].name.substr(0,1)),t._users[r].name)}))),key:n},i.a.createElement(nn.a,{style:{width:e.avatarSize?e.avatarSize:27,height:e.avatarSize?e.avatarSize:27,border:"none"},alt:"+".concat(l)},i.a.createElement("span",{style:{fontSize:10}},"+".concat(l))))}}}))))},Uo=r(277),Vo=r.n(Uo),qo=function(e){return{root:{position:"relative"},timeInfo:{display:"flex",alignItems:"center",color:"grey",width:"calc(100% - 15px)",position:"relative",float:"left",marginBottom:"7px","& .text":{marginLeft:"7px"}},dataSave:{padding:"7px"},fieldSet:{padding:"7px",width:"calc(100% - 50px)"},progress:{},progressPercentage:{}}};r(617);function Xo(){Xo=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}r(618);var Jo=Object($e.b)((function(e){return{}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(qo)((function(e){var t=e.classes,r=(De.getState().functions.socket,i.a.useState(!1)),n=Object(Be.a)(r,2),a=(n[0],n[1]),o=i.a.useState(""),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.useState(0),d=Object(Be.a)(u,2),p=d[0],f=d[1],m=e.timer||{},g=e.data||{},v=function(){var e=Object(Me.a)(Xo().mark((function e(t,r){var n;return Xo().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a(!0),n=String(p),(n="backspace"===t.key.toLowerCase()?n.substr(0,n.length-1):"".concat(n||"").concat(isNaN(t.key)&&(","!==t.key&&"."!==t.key||-1!==n.indexOf(",")||-1!==n.indexOf("."))?"":t.key))&&n.indexOf(",")>-1&&(n=n.substr(0,n.indexOf(",")+3)),f(n);case 5:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}();if(!g)return null;var y=function(){var t=Object(Me.a)(Xo().mark((function t(){var r,n;return Xo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.timer||l?(r=isNaN(p)?p.replace(",","."):p,n=Object(h.a)(Object(h.a)({_id:Object(Pn.a)(),cardId:g._id,idRel:g._id,value:e.PositiveValue?r:"-".concat(r),type:"kpi"},e.manualEntry?{manualEntry:!0}:{}),{},{kpi_type:g.kpi_type?g.kpi_type:null,message:l||""}),e.timer&&(n=Object(h.a)(Object(h.a)({},n),{},{value:m.diff,ini:m.created_at,fin:m.updated_at,type:"timer",kpi_type:"timer",to:m.to})),ot.post("timeline/add",Object(h.a)({},n)),e.callBack&&e.callBack(),e.timer&&!e.manualAdd&&Mn(e,g._id,m._id),f(0),s("")):ft({message:lt("$__fillDescription",1),variant:"warning",persist:!1,horizontal:"center"});case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return e.data?i.a.createElement("div",{className:t.dataSave},i.a.createElement("fieldset",null,i.a.createElement("legend",{style:{color:dt("color")}},lt("$__new",1)),!e.timer&&i.a.createElement(La,{placeholder:lt("$__value",1),value:mt(p||0,"time"===g.kpi_type?"number":g.kpi_type,g.kpi_currency?g.kpi_currency:null),InputLabelProps:{shrink:!0},InputProps:{onKeyDown:function(e){v(e,"ini")}}}),i.a.createElement(La,{multiline:!0,placeholder:lt("$__description",1),onChange:function(e){return s(e.target.value)},value:l,InputProps:{autoComplete:"new-password"}}),i.a.createElement("div",{style:{display:"flex",textAlign:"right"}},i.a.createElement(At,{title:lt("$__save",1),color:"green",icon:"save",onClick:function(){return y()},size:"25px",transparent:!0}),(!e.timer||e.manualAdd)&&i.a.createElement(At,{title:lt("$__cancel",1),color:"lightgrey",icon:"cancel",onClick:function(){e.callBack&&e.callBack()},size:"25px",transparent:!0})))):i.a.createElement("div",null,"NO DATA RECEIVED")}))),Ko=r(1799);function Zo(){Zo=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Qo=Object(Lt.a)((function(e){return{iconButtonStyleTransaparent:{margin:0,"&:hover":{backgroundColor:"rgba(250,250,250,0.9)"}},iconButtonStyleWhite:{margin:0,backgroundColor:"#FFFFFF","&:hover":{backgroundColor:"rgba(250,250,250,0.9)"}}}}));var ei=Object($e.b)((function(){return{}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t,r=Qo(),n=i.a.useState(!1),a=Object(Be.a)(n,2),o=a[0],c=a[1],l=i.a.useRef(null),s=e.data,u=De.getState(),d=u.db,p=u.session,f=(u.functions,u.sideModule),m=i.a.useState([]),g=Object(Be.a)(m,2),v=g[0],y=(g[1],i.a.useState(e.selected?e.selected:[])),b=Object(Be.a)(y,2),x=b[0],_=b[1],w=i.a.useState(""),E=Object(Be.a)(w,2),j=E[0],S=E[1],k=e.admins?function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=De.getState(),n=r.db,a={};if(Object.keys(n.users).filter((function(e){return!n.users[e]._parent&&n.users[e]._access&&n.users[e]._access.admin})).map((function(e){a=Object(h.a)(Object(h.a)({},a),{},Object(O.a)({},e,n.users[e]))})),(!e||e&&!e.isArray)&&a){var o={};return Object.keys(a).map((function(e){(!t||t&&t.indexOf(a[e].type)>-1)&&(o=Object(h.a)(Object(h.a)({},o),{},Object(O.a)({},e,a[e])))})),o}if(e&&e.isArray&&a){var i=[];return Object.keys(a).map((function(e){(!t||t&&t.indexOf(a[e].type)>-1)&&0===i.filter((function(t){return t._id===e})).length&&i.push(a[e])})),i}return{}}(s&&s._id?s._id:null,null,{onlyCard:!(!s||!s._id)}):ca(s&&s._id?s._id:null,{onlyCard:!(!s||!s._id)}),L=f&&f.id?ia(f.id):0,C=function(){var t=Object(Me.a)(Zo().mark((function t(r){var n;return Zo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=Array.from(x),e.multiple?0===n.filter((function(e){return e===r})).length?n.push(r):n.splice(n.indexOf(r),1):n=[r],_(n),e.onSelect&&e.onSelect(n),e.multiple||c(!1);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),I=function(t){var r=t.pr,n=t.selected,a=!1;(!e.data||k[r]&&k[r].access&&k[p._id]&&k[p._id].access&&parseInt(k[p._id].access)>=parseInt(k[r].access)||!k[r]&&(k[p._id]&&k[p._id].access&&parseInt(k[p._id].access)>=3||s._parent&&d.cards[s._parent]._users[p._id]&&d.cards[s._parent]._users[p._id].access&&parseInt(d.cards[s._parent]._users[p._id].access)>=3||s._planId&&d.cards[s._planId]._users[p._id]&&d.cards[s._planId]._users[p._id].access&&parseInt(d.cards[s._planId]._users[p._id].access)>=3)||L>3)&&(a=!0);var o=k[r];return o?i.a.createElement(xn.a,{autoFocus:!1,onClick:a?function(){C(r)}:null},i.a.createElement("div",{style:{position:"relative",width:"100%",display:"flex",alignItems:"center",cursor:"pointer"}},i.a.createElement(nn.a,{alt:o.name||null,src:o.image||null,style:Object(h.a)({},e.avatarSize?{width:e.avatarSize,height:e.avatarSize}:{})},o&&o.name?o.name.substr(0,1):""),i.a.createElement("div",{style:{marginLeft:"15px",color:a?"black":"lightgray"}},i.a.createElement("div",{style:{position:"relative",width:"100%",float:"left"}},o.name||o.name),i.a.createElement("div",{style:{position:"relative",width:"100%",float:"left",display:"flex",alignItems:"center"}},o._parent&&d.users[o._parent]&&d.users[o._parent].image?i.a.createElement("div",{style:{position:"relative",bottom:-4,right:-7,width:17,height:17,borderRadius:"50%",backgroundImage:"url(".concat(d.users[o._parent].image,")"),backgroundSize:"cover",backgroundRepeat:"no-repeat"}}):i.a.createElement(i.a.Fragment,null),o._parent&&d.users[o._parent]&&d.users[o._parent].name?i.a.createElement("div",{style:{position:"relative",float:"left",fontSize:11,color:"lightgray",marginLeft:7}},d.users[o._parent].name):i.a.createElement(i.a.Fragment,null)),n?i.a.createElement("div",{style:{position:"absolute",right:0,top:0,bottom:0,alignItems:"center",justifyContent:"center",display:"flex"}},0===x.indexOf(o._id)?i.a.createElement("div",null,i.a.createElement(kt,{icon:"admin_panel_settings",color:"lightgray"})):i.a.createElement(i.a.Fragment,null),i.a.createElement(kt,{icon:"check",color:"green"})):i.a.createElement(i.a.Fragment,null)))):i.a.createElement(i.a.Fragment,null)};return i.a.createElement("div",{onClick:function(e){e.stopPropagation()}},i.a.createElement(Nt.a,{ref:l,"aria-controls":o?"menu-list-grow":void 0,"aria-haspopup":"true","aria-label":"menu",onClick:function(t){(!s||e.permission||s&&k&&k[p._id]&&k[p._id].access&&parseInt(k[p._id].access)>2||L>3)&&c((function(e){return!e}))},className:e.transparent?r.iconButtonStyleTransaparent:r.iconButtonStyleWhite},0===x.length?lt("$__selectUser"):i.a.createElement("div",null,i.a.createElement(Yo.a,{max:e.noLimit?300:4,style:{flexWrap:"wrap",display:"inline-flex"}},x.map((function(t){return i.a.createElement(Qe.a,{key:t,title:k[t]&&k[t].displayName?k[t].displayName:k[t].name},i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},i.a.createElement(nn.a,{alt:k[t].name,src:k[t].image||null,style:{width:e&&e.avatarSize?e&&e.avatarSize:"none",height:e&&e.avatarSize?e.avatarSize:"none"}},k[t].name.substr(0,1)),!e.multiple&&i.a.createElement("span",{style:{marginLeft:15}},k[t].displayName?k[t].displayName:k[t].name)))})),e.multiple&&i.a.createElement(Qe.a,{title:lt("$__selectUser")},i.a.createElement(nn.a,{style:{width:e&&e.avatarSize?e&&e.avatarSize:"none",height:e&&e.avatarSize?e.avatarSize:"none"},alt:"ADD",src:null},"+"))))),i.a.createElement(Ko.a,{open:o},i.a.createElement("div",{style:(t={position:"relative",width:"100%",paddingBottom:v&&v.length?"66px":0},Object(O.a)(t,"width","100%"),Object(O.a)(t,"display","flex"),Object(O.a)(t,"justifyContent","space-between"),t)},i.a.createElement(pn.a,{onClickAway:function(e){l.current&&l.current.contains(e.target)||c(!1)}},i.a.createElement("div",{style:{position:"relative"}},i.a.createElement("div",{style:{width:"100%",padding:"4px 15px",fontSize:"16px",color:"lightGray",position:"relative"}},i.a.createElement(La,{id:"quickUser_Search",label:lt("$__searchByName",1),variant:dt("fieldVariant"),name:"searchValue",InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end",style:{cursor:"pointer"},onClick:function(){S(""),c(!1)}},i.a.createElement(kt,{icon:"close"})),onChange:function(e){S(e.target.value)}},value:j,placeholder:lt("$__searchByName",1),autoFocus:!0})),i.a.createElement("div",{style:{width:"100%",padding:"4px 15px",fontSize:"16px",color:"lightGray",position:"relative",maxHeight:250,overflowY:"auto"}},i.a.createElement(_n.a,{id:"menu-list-grow",autoFocusItem:!1,autoFocus:!1,onKeyDown:function(e){"Tab"===e.key&&(e.preventDefault(),c(!1))}},Object.keys(k).filter((function(e){return!k[e].deleted&&(""===j||j&&k[e].name&&k[e].name.toLowerCase().indexOf(j.toLowerCase())>-1)})).sort((function(e,t){return k[e].name<k[t].name?-1:k[e].name>k[t].name?1:0})).map((function(e){return k&&k[e]&&k[e]._id&&i.a.createElement(I,{pr:e,key:e,selected:-1!==x.indexOf(k[e]._id)})})))))))))})),ti=r(525);function ri(){ri=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}r(618);var ni,ai,oi=Object($e.b)((function(e,t){return{card:e.db.cards[t.data._id]}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(qo)((function(e){var t,r=e.classes,n=De.getState(),a=n.db,o=n.session,c=a.cards,l=i.a.useState(!1),s=Object(Be.a)(l,2),u=s[0],d=s[1],p=i.a.useState(!1),f=Object(Be.a)(p,2),m=f[0],g=f[1],v=i.a.useState({}),y=Object(Be.a)(v,2),b=y[0],x=y[1],_=e.data,w=i.a.useState([]),E=Object(Be.a)(w,2),O=E[0],j=E[1],S=i.a.useState(Ve()(new Date).tz("America/Sao_Paulo").format("YYYY-MM-DDT06:00")),k=Object(Be.a)(S,2),L=k[0],C=k[1],I=i.a.useState(Ve()(new Date).tz("America/Sao_Paulo").format("YYYY-MM-DDT07:00")),F=Object(Be.a)(I,2),T=F[0],N=F[1],P=i.a.useState(!1),D=Object(Be.a)(P,2),A=D[0],$=D[1],z=i.a.useState(0),M=Object(Be.a)(z,2),B=M[0],Y=M[1],G=i.a.useState(1),R=Object(Be.a)(G,2),H=R[0],W=R[1],U=i.a.useState(0),V=Object(Be.a)(U,2),q=(V[0],V[1],"time"===_.kpi_type&&_.kpi_ini?parseFloat(_.kpi_ini):0),X="time"===_.kpi_type&&_.kpi_fin?parseFloat(_.kpi_fin):0;i.a.useEffect((function(){t&&clearTimeout(t),Z(),K(e.data._id)}),[m]),i.a.useEffect((function(){t&&clearTimeout(t),Z(),K(e.data._id)}),[JSON.stringify(e.card)]);var J=[e.data._id],K=function e(t,r){var n=Object.keys(c).filter((function(e){return c[e].kpi_useParent&&c[e]._parent===t}));return n.length>0?n.map((function(t){e(t,!0),J.push(t),j(Array.from(new Set(J)))})):r||j(J),n},Z=function(){var t=Object(h.a)({},De.getState().db.cards[e.data._id]);if(t&&t._kpiTimer&&Object.keys(t._kpiTimer).filter((function(e){return t._kpiTimer[e].userId===o._id})).length>0){var r=t._kpiTimer[Object.keys(t._kpiTimer).filter((function(e){return t._kpiTimer[e].userId===o._id}))[0]];r.diff=Ve()().tz("America/Sao_Paulo").unix("x")-r.created_at,r&&r.updated_at&&(r.diff=parseInt(r.updated_at)-parseInt(r.created_at)),Q(r,!!r.updated_at)}else d(!1),x({}),g(!1);0===Object.keys(b).length&&e.manualAdd&&(x({created_at:Ve()(L).tz("America/Sao_Paulo").unix("X"),updated_at:Ve()(T).tz("America/Sao_Paulo").unix("X")}),Q({created_at:Ve()(L).tz("America/Sao_Paulo").unix("X"),updated_at:Ve()(T).tz("America/Sao_Paulo").unix("X")},!!b.updated_at))},Q=function(e,r){var n,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=Object(h.a)({},e),i=!1;if(o.diff?n=parseInt(o.diff):(n=parseInt(e.updated_at-e.created_at),e.updated_at-e.created_at<0&&(n=null)),n||A)if(n<60)o.diffText="".concat(o.diff," ").concat(lt("$__seconds",1)),a||W(0);else if(n>=3600){var c=Math.trunc(n/3600);n-=3600*c;var l=Math.trunc(n/60)>0?Math.trunc(n/60):0,s=(n-=60*l)>0?n:0;o.diffText="".concat(c," hora").concat(c>1?"s":""," ").concat(l," ").concat(lt("$__minutes",1)," ").concat(s," ").concat(lt("$__seconds",1)),a||(W(c),Y(l))}else{var p=Math.trunc(n/60)>0?Math.trunc(n/60):0,f=(n-=60*p)>0?n:0;o.diffText="".concat(p," ").concat(lt("$__minutes",1)," ").concat(f," ").concat(lt("$__seconds",1)),a||(W(0),Y(p))}else o.diffText=lt("$__theEndMustBeGreaterThanTheBeginning");x(Object(h.a)(Object(h.a)({},b),o)),e.updated_at?(o.diff=parseInt(e.updated_at)-parseInt(e.created_at),u||d(!0)):(o.diff=Ve()().tz("America/Sao_Paulo").unix("x")-parseInt(e.created_at),m||(g(!0),i=!0)),r||e.updated_at||!i||(t=setTimeout((function(){Z()}),1e3))};if(!_)return null;var ee=function(){var t=Object(Me.a)(ri().mark((function t(){var r;return ri().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,$n(e,_._id);case 2:(r=t.sent)&&(Q(r),g(!0));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),te=function(){var t=Object(Me.a)(ri().mark((function t(){var r;return ri().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return g(!1),t.next=3,zn(e,_._id);case 3:(r=t.sent)&&x(Object(h.a)(Object(h.a)({},b),r));case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),re=Object(h.a)({},ti.model),ne=[],ae=[],oe={};O.map((function(e){oe=Object(h.a)(Object(h.a)({},oe),a.cards[e]._timeline||{})})),oe=Object.keys(oe).filter((function(e){return"kpi"===oe[e].type})).map((function(e){return oe[e]}));var ie="time"!==_.kpi_type?parseFloat(q):0,ce=parseFloat(q)-parseFloat(X);ce<0&&(ce*=-1),oe&&Object.keys(oe).length>0&&Object.keys(oe).sort((function(e,t){return oe[e].created_at<oe[t].created_at?-1:1})).map((function(e,t){ie=parseFloat(ie)+parseFloat(oe[e].value),ne.push({meta:oe[e].value,total:ie,value:parseFloat(q)>parseFloat(X)?100-Math.floor(100*ie/ce):Math.floor(100*ie/ce)}),ae.push(t+1),t+1===Object.keys(oe).length&&(re=Object(h.a)(Object(h.a)({},re),{},{data:{labels:ae,series:[[].concat(ne)]},options:Object(h.a)(Object(h.a)({},re.options),{},{low:0,high:100,plugins:[Vo.a.plugins.tooltip({tooltipFnc:function(e,t){return"".concat(e>0?"+":"")+mt(e,"time"===_.kpi_type?"number":_.kpi_type)+"<br>"+mt(t,"percent")}})],axisX:{showGrid:!1},axisY:{showGrid:!1},onlyInteger:!0})}))}));var le=q<X?X-q:q-X;oe&&Object.keys(oe).length>0&&Object.keys(oe).map((function(e){le=parseFloat(le)+parseFloat(oe[e].value)}));var se=Math.ceil(q<X?X-q:q-X);return(se=100*Math.ceil(le)/se-100)<0&&(se*=-1),e.data?i.a.createElement("div",{className:r.root},i.a.createElement("fieldset",null,i.a.createElement("legend",{style:{color:dt("color")}},e.manualAdd?lt("$__timerLog",1):lt("$__timer",1)),e.manualAdd&&i.a.createElement(i.a.Fragment,null,A?i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:r.timeInfo},i.a.createElement(kt,{color:"color",icon:"schedule"}),i.a.createElement(La,{label:lt("$__initialDate",1),variant:dt("fieldVariant",1),name:"startDate",InputLabelProps:{shrink:!0},type:"date",inputProps:{max:Ve()().format("YYYY-MM-DD"),autoComplete:"start-date",onChange:function(e){Ve()(e.target.value).isValid()&&C(e.target.value);var t=b.updated_at-b.created_at;Q(Object(h.a)(Object(h.a)({},b),{},{created_at:Ve()("".concat(e.target.value," 00:00:00")).unix("X"),updated_at:Ve()("".concat(e.target.value," 00:00:00")).unix("X")+t}),!0,!0)}},value:L}))):i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:r.timeInfo},i.a.createElement(kt,{color:"color",icon:"schedule"}),i.a.createElement(La,{label:lt("$__initialDate",1),variant:dt("fieldVariant",1),name:"startDate",InputLabelProps:{shrink:!0},type:"datetime-local",inputProps:{max:T,autoComplete:"start-date",onChange:function(e){Ve()(e.target.value).isValid()&&(C(e.target.value),Q(Object(h.a)(Object(h.a)({},b),{},{created_at:Ve()(e.target.value).tz("America/Sao_Paulo").unix("X")}),!0))}},value:L})),i.a.createElement("div",{className:r.timeInfo},i.a.createElement(kt,{color:"color",icon:"watch_later"}),i.a.createElement(La,{label:lt("$__finalDate",1),variant:dt("fieldVariant",1),name:"endDate",InputLabelProps:{shrink:!0},type:"datetime-local",inputProps:{min:L,autoComplete:"new-password",onChange:function(e){Ve()(e.target.value).isValid()&&(N(e.target.value),Q(Object(h.a)(Object(h.a)({},b),{},{updated_at:Ve()(e.target.value).tz("America/Sao_Paulo").unix("X")}),!0))}},value:T}))),i.a.createElement("div",{className:r.timeInfo},i.a.createElement(kt,{color:"color",icon:"more_time"}),i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},i.a.createElement(La,{label:lt("$__hours",1),variant:dt("fieldVariant",1),name:"hours",InputLabelProps:{shrink:!0},type:"number",inputProps:{min:0,autoComplete:"hours",onChange:function(e){W(e.target.value),$(!0),L.indexOf("T")>-1&&C(L.substring(0,10)),Q(Object(h.a)(Object(h.a)({},b),{},{created_at:Ve()("".concat(L.substring(0,10)," 00:00:00")).unix("X"),updated_at:Ve()("".concat(L.substring(0,10)," 00:00:00")).unix("X")+60*e.target.value*60+60*B}),!0,!0)}},value:H,style:{paddingLeft:7,paddingRight:7}}),i.a.createElement(La,{label:lt("$__minutes",1),variant:dt("fieldVariant",1),name:"minutes",InputLabelProps:{shrink:!0},type:"number",inputProps:{min:0,max:59,autoComplete:"new-password",onChange:function(e){Y(e.target.value),$(!0),L.indexOf("T")>-1&&C(L.substring(0,10)),Q(Object(h.a)(Object(h.a)({},b),{},{created_at:Ve()("".concat(L.substring(0,10)," 00:00:00")).unix("X"),updated_at:Ve()("".concat(L.substring(0,10)," 00:00:00")).unix("X")+60*H*60+60*e.target.value}),!0,!0)}},value:B,style:{paddingLeft:7,paddingRight:7}}),i.a.createElement(At,{title:lt("$__reset",1),icon:"update_disabled",color:dt("menu"),onClick:function(){$(!1),C("".concat(L," 00:00:00"))},size:"17px",style:{marginLeft:3,marginRight:3,backgroundColor:"rgba(0,0,0,0.05)",padding:3},transparent:!0}))),i.a.createElement("div",{style:{position:"relative",width:"100%",display:"flex",alignItems:"center"}}),b&&b.diffText&&i.a.createElement("div",{className:r.timeInfo},i.a.createElement(kt,{color:"color",icon:"hourglass_full"}),i.a.createElement("div",{className:"text"},b.diffText)),parseInt(a.cards[_._id]._users[o._id].access)>=3?i.a.createElement(Ut,null,i.a.createElement(ei,{includeMe:!0,data:a.cards[_._id],avatarSize:"33px",permission:e.permission,noLimit:!0,multiple:!0,onSelect:function(e){Q(Object(h.a)(Object(h.a)({},b),{},{to:e}),!0)}})):i.a.createElement(i.a.Fragment,null)),u||e.manualAdd?i.a.createElement("div",null,!e.manualAdd&&b&&b.created_at&&b.updated_at&&b.diffText&&Ve()(1e3*b.created_at).isValid()&&i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:r.timeInfo},i.a.createElement(kt,{color:"color",icon:"schedule"}),i.a.createElement("div",{className:"text"},Ve()(1e3*b.created_at).tz("America/Sao_Paulo").format("DD/MM/YYYY HH:mm:ss"))),i.a.createElement("div",{className:r.timeInfo},i.a.createElement(kt,{color:"color",icon:"watch_later"}),i.a.createElement("div",{className:"text"},Ve()(1e3*b.updated_at).tz("America/Sao_Paulo").format("DD/MM/YYYY HH:mm:ss"))),i.a.createElement("div",{className:r.timeInfo},i.a.createElement(kt,{color:"color",icon:"hourglass_full"}),i.a.createElement("div",{className:"text"},b.diffText))),b.created_at<b.updated_at?i.a.createElement(Ut,null,i.a.createElement(Jo,{manualAdd:!!e.manualAdd,data:_,timer:b,manualEntry:A,callBack:function(){d(!1),e.callBack&&e.callBack()}})):i.a.createElement(i.a.Fragment,null)):i.a.createElement("div",{className:r.time},m?i.a.createElement("div",{className:r.timeInfo},i.a.createElement(kt,{color:"color",onClick:function(){ft({message:lt("$__confirmStopTimer",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){te()}})}},"pause_circle_filled"),i.a.createElement("div",{className:"text"},b.diffText)):i.a.createElement(i.a.Fragment,null,X&&ie?i.a.createElement("div",{className:r.timeInfo},i.a.createElement(kt,{color:60*X<ie?"red":"color",icon:"schedule"}),i.a.createElement("div",{className:"text",style:{color:60*X<ie?"red":"grey"}},lt("$__timeLeft",1),": ",60*X-ie>-60&&60*X-ie<60?"".concat(60*X-ie," ").concat(lt("$__seconds",1)," "):"".concat(Math.trunc((60*X-ie)/60)," ").concat(lt("$__minutes",1)," ").concat(60*X-ie-60*Math.trunc((60*X-ie)/60)," ").concat(lt("$__seconds",1)," "))):i.a.createElement(i.a.Fragment,null),i.a.createElement("div",{className:r.timeInfo},i.a.createElement(kt,{color:"color",onClick:function(){ee()},title:"playRegisterLogWork"},"play_circle_outline"),i.a.createElement("span",{style:{marginLeft:7,color:dt("color")}},lt("$__startStopWatch"))))))):i.a.createElement("div",null,"NO DATA RECEIVED")}))),ii=r(1730),ci={containerNoShadow:Object(h.a)(Object(h.a)({},rr),{},(ni={position:"relative",border:"0.5px solid ".concat(dt("light")),borderRadius:"2px",padding:"0px",backgroundColor:"#FFFFFF"},Object(O.a)(ni,"padding","3px"),Object(O.a)(ni,"display","flow-root"),ni)),container:Object(h.a)(Object(h.a)({},rr),{},(ai={position:"relative",border:"0.5px solid ".concat(dt("light")),borderRadius:"2px",padding:"0px",backgroundColor:"#FFFFFF"},Object(O.a)(ai,"padding","3px"),Object(O.a)(ai,"display","flow-root"),Object(O.a)(ai,"boxShadow","0px 0px 10px rgba(0,0,0,0.1)"),ai)),parent:{width:"100%",padding:"0 5px","& .title":{color:dt("medium"),fontSize:"10px",textTransform:"uppercase"},"& .info":{marginTop:"-8px",color:dt("color"),fontWeight:"500",alignItems:"center"}},infos:{position:"relative",float:"left",width:"100%",height:"auto",display:"block"},indicators:{position:"relative",float:"left",height:"auto",zIndex:"0 !important"},indicatorsIcon:{position:"relative",float:"left",margin:"0px 0px","& MuiBadge-badge":{position:"relative",float:"left"}},image:{position:"relative",float:"left",width:"100%",marginTop:"7px",maxWidth:"100%",display:"none"},imagePreview:{backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center",paddingTop:"48%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative",float:"left",width:"100%"},imagePreviewList:{backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center",display:"flex",justifyContent:"center",alignItems:"center",position:"relative",float:"left",width:"100%",paddingTop:"48%","@media screen and (max-width: 800px)":{width:"100%"}},PreLoader:{top:"calc(50% - 25px)",left:"calc(50% - 25px)",position:"absolute"},description:{position:"relative",float:"left",padding:"5px",minHeight:"75px",width:"100%",overflow:"hidden",textOverflow:"ellipses"},dates:{position:"relative",float:"left",width:"100%",marginTop:"7px",padding:"0 5px",marginRight:"15px",color:dt("medium"),fontSize:"10px",display:"flex"},lateDates:{position:"relative",float:"left",width:"100%",marginTop:"7px",padding:"0 5px",marginRight:"15px",color:"red",fontSize:"10px",display:"flex"},dateInfo:{marginRight:"15px",display:"flex",alignItems:"center"},usersContent:{minHeight:"20px",minWidth:"40px",zIndex:"0 !important"},users:{position:"absolute",bottom:"0px",right:"2px",fontSize:"10px","& .MuiAvatarGroup-root":{justifyContent:"flex-end"},"& .MuiAvatar-root":{width:"25px",height:"25px",fontSize:"10px"}}};var li,si,ui=Object(Ze.a)(ci)((function(e){var t=e.classes;return i.a.createElement("div",null,i.a.createElement("div",{className:t.infos},i.a.createElement("div",{className:t.imagePreview,style:{background:e.backgroundColor?e.backgroundColor:dt("AvatarBackground"),display:"flex",alignItems:"center",justifyContent:"center"}},i.a.createElement("div",{style:{marginTop:"calc(-48% - 10px)",display:"flex",justifyContent:"center",alignItems:"center"}},i.a.createElement(kt,{icon:"lock",size:"39px",color:e.avatarIconColor?e.avatarIconColor:dt("AvatarIconColor")})))))})),di=r(47),pi={container:Object(h.a)(Object(h.a)({},rr),{},(li={position:"relative",border:"0.5px solid ".concat(dt("light")),borderRadius:"2px",padding:"0px",backgroundColor:"#FFFFFF",boxShadow:"0px 0px 10px rgba(0,0,0,0.1)"},Object(O.a)(li,"padding","3px"),Object(O.a)(li,"minWidth","150px"),Object(O.a)(li,"display","flow-root"),li)),cardContainer:Object(h.a)(Object(h.a)({},rr),{},{position:"relative",minWidth:"150px",display:"flow-root"}),parent:{width:"100%",padding:"0 5px","& .title":{color:dt("medium"),fontSize:"10px",textTransform:"uppercase"},"& .info":{marginTop:"-8px",color:dt("color"),fontWeight:"500",alignItems:"center"}},infos:{position:"absolute",float:"left",width:"100%",height:"auto",display:"block"},description:{position:"relative",float:"left",padding:"5px",width:"100%",overflow:"hidden"},dates:{position:"relative",float:"left",width:"100%",marginTop:"7px",padding:"0 5px",marginRight:"15px",color:dt("medium"),fontSize:"10px",display:"flex"},dateInfo:{marginRight:"15px",display:"flex",alignItems:"center"},usersContent:{position:"relative",minHeight:"20px",minWidth:"40px",float:"right"},users:{position:"absolute",bottom:"7px",right:"2px",fontSize:"10px","& .MuiAvatarGroup-root":{justifyContent:"flex-end"},"& .MuiAvatar-root":{width:"25px",height:"25px",fontSize:"10px"}}};function fi(){fi=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var hi=Xe.default.div(si||(si=Object(ze.a)(["\n","\n","\n","\n","\n","\n","\n width:calc(100%) !important\n"])),(function(e){return e.selectable&&e.selected?"\n opacity:1":e.selectable?"\n opacity:0.5":""}),(function(e){return e.locked?"cursor:no-drop !important":"cursor:pointer"}),(function(e){return e.priority&&e.showCard,""}),(function(e){return!e.selectable&&e.selected?"border-bottom:solid 5px ".concat(dt("color")):""}),(function(e){return e.isDragDisable?"":e.isDragging?"\n opacity:0.88\n max-width:320px":""}),(function(e){return e.inLine?"position:relative\n float:left\n margin:1px\n width:calc(20% - 7px)\n // maxWidth:320px\n ":"\n width:calc(100%) !important\n margin:1px 0px 1px 0px\n "})),mi=Object($e.b)((function(){return{}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(pi)((function(e){var t=e.classes,r=De.getState().db,n=e.data&&e.data._id?De.getState().db.cards[e.data._id]:{},a=i.a.useState(n.name?n.name:""),o=Object(Be.a)(a,2),c=o[0],l=o[1],s=i.a.useState(!1),u=Object(Be.a)(s,2),d=u[0],p=u[1],f=i.a.useState(!1),m=Object(Be.a)(f,2),g=m[0],v=m[1],y=function(){var t=Object(Me.a)(fi().mark((function t(r){return fi().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:pa(Object(h.a)(Object(h.a)({},e),{},{data:{_id:n._id}}),r),p(!1);case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),b=function(){var e=Object(Me.a)(fi().mark((function e(){return fi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:ft({message:lt("$__confirmDeleteThisFullDescription",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){y({deleted:!0})}});case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return i.a.createElement(hi,Object.assign({},e.provided&&e.provided.draggableProps,e.key?{key:e.key}:{},{ref:e.provided&&e.provided.innerRef,isDragging:e.snapshot&&e.snapshot.isDragging,isDragDisable:n.isDragDisable||e.isDragDisable||!1,inLine:e.inLine,selectable:e.showSelected,selected:n._selected,priority:n.priority?r.priority.filter((function(e){return String(e.value)===String(n.priority)}))[0].color:null,locked:e.locked||!1,className:e.showCard?t.cardContainer:t.container}),i.a.createElement("div",e.provided&&e.provided.dragHandleProps,d?i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",padding:"7px",display:"flex",alignItems:"center"}},i.a.createElement("div",{style:{width:"calc(100% - 50px)",display:"flex"}},i.a.createElement(La,{label:lt("$__taskTitle"),variant:dt("fieldVariant"),name:"name",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",onChange:function(e){l(e.target.value)},onBlur:function(e){""===e.target.value&&p(!d)},onKeyDown:function(e){13===e.keyCode&&c&&y({name:c}),27===e.keyCode&&(p(!d),l())}},autoFocus:!0,value:c,placeholder:lt("$__taskTitlePlaceholder")})),i.a.createElement("div",{style:{display:"flex"}},i.a.createElement("div",{onClick:function(){return y({name:c})}},i.a.createElement(kt,{color:"green",icon:"save",title:lt("$__save","*"),size:e.actionsSize||"25px"})),i.a.createElement("div",{onClick:function(){p(!d),l("")}},i.a.createElement(kt,{color:dt("medium"),icon:"cancel",title:lt("$__cancel","*"),size:e.actionsSize||"25px"}))))):i.a.createElement("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},onMouseOver:function(){v(!0)},onMouseLeave:function(){v(!1)}},i.a.createElement("div",Object.assign({style:{width:"100%",padding:"0px 7px",wordBreak:"break-word"},onDoubleClick:function(){p(!d)}},e.provided?{provided:e.provided}:{},e.snapshot?{snapshot:e.snapshot}:{}),e.showCard?i.a.createElement(oc,{db:"cards",data:e.data,viewTimer:!0,viewAllName:!0}):n.name?n.name:lt("$__new",1)),"completed"!==n.status||e.showCard?i.a.createElement(i.a.Fragment,null):i.a.createElement("div",{style:{position:"absolute",top:0,bottom:0,left:0,right:0,backgroundColor:"rgba(0,0,0,0.05)",display:"flex",alignItems:"center"}},i.a.createElement("div",{style:{position:"absolute",top:"50%",marginLeft:15,height:1,width:"calc(100% - 50px)",backgroundColor:"rgba(0,0,0,0.1)"}}),n.completed_at?i.a.createElement("div",{style:{position:"absolute",right:33,top:"calc(50% - 15px)",fontSize:10,textAlign:"right",backgroundColor:"#f1f1f1",paddingLeft:7}},Ot(n.completed_at)):i.a.createElement(i.a.Fragment,null)),g&&e.permission&&!e.noDelete&&(!e.showCard||!e.dragStatus&&e.showCard)&&i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},i.a.createElement(At,{title:lt("$__undoConclude",1),color:"lightgrey",icon:"delete_forever",onClick:function(){return b()},transparent:!0}),n.checklist?i.a.createElement(At,{title:lt("$__turnIntoActivity",1),color:"lightgrey",icon:"change_circle",onClick:function(){ft({message:lt("$__confirmTurnIntoActivity",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){y({checklist:null})}})},transparent:!0}):i.a.createElement(i.a.Fragment,null)),(!e.showCard||!e.dragStatus&&e.showCard)&&i.a.createElement(At,{title:"completed"!==n.status?lt("$__conclude",1):lt("$__undoConclude",1),color:"completed"!==n.status?"lightgrey":"grey",icon:"completed"!==n.status?"radio_button_unchecked":"check_circle",onClick:function(){ya(e,n)},transparent:!0}))),e.locked?i.a.createElement("div",{style:{position:"absolute",backgroundColor:"rgba(233,233,233,0.88)",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"}},i.a.createElement("div",{style:{display:"flex"}},i.a.createElement(kt,{color:"lightgray",icon:"lock",size:"22px"}))):i.a.createElement(i.a.Fragment,null))}))),gi=r(1800),vi=Object(Ze.a)({switchBase:{color:dt("medium"),"&$checked":{color:dt("color")},"&$checked + $track":{backgroundColor:dt("color")}},checked:{},track:{}})(gi.a),yi=r(497);function bi(){bi=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var xi=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=De.getState(),n=(r.session,r.db),a=Object(h.a)({},e);Object.keys(a).map((function(e){a[e]||delete a[e]}));var o=a.name.trim().split("\n"),i=t,c={},l={};return a.users.map((function(e,t){var r=n.users[e];l=Object(h.a)(Object(h.a)({},l),{},Object(O.a)({},e,Object(h.a)({_id:e,name:r.name,image:r.image||null},0===t?{isResponsible:!0}:{})))})),o.map(function(){var e=Object(Me.a)(bi().mark((function e(t,r){var n,o;return bi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t&&t.trim()&&(o=Object(Pn.a)(),ot.post("card/add",Object(h.a)(Object(h.a)({_id:o},a),{},{name:t},"step"===a.type?{step:"".concat(i)}:{order:"".concat(i)})),c=Object(h.a)(Object(h.a)({},c),{},Object(O.a)({},o,Object(h.a)(Object(h.a)({_id:o},a),{},{name:t,_users:l},"step"===a.type?{step:"".concat(i)}:{order:"".concat(i)}))),(null===(n=c[o])||void 0===n?void 0:n.users)&&delete c[o].users,i+=1);case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()),c};function _i(){_i=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var wi,Ei=Object($e.b)(null,(function(e){return Object(u.b)(n,e)}))((function(e){De.getState().session;var t=[],r=De.getState().db.cards[e.nodeId]||{};if(r.automationUsers&&"doNotChange"!==r.automationUsers&&"remove"!==r.automationUsers&&r._users&&Object.keys(r._users).length>0){var n=De.getState().db.users[De.getState().session._id]||{},a=Object(h.a)(Object(h.a)({},"add"===r.automationUsers?Object(O.a)({},n._id,{_id:n._id,name:n.name,image:n.image||null}):{}),r._users);Object.keys(a).sort((function(e,t){return a[e].isResponsible?-1:1})).map((function(e,r){-1===t.indexOf(e)&&t.push(e)}))}var o=i.a.useState(t.length>0?t:[De.getState().session._id]),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.createRef(),d=i.a.createRef({}),p=function(){var t=Object(Me.a)(_i().mark((function t(n){var a,o;return _i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:d&&(!d.current||d.current&&!d.current.loading)&&(d.current=Object(h.a)(Object(h.a)({},d.current),{},{loading:!0}),a=Object(h.a)({name:u.current.value,_parent:e.nodeId,myDay:!!e.myDay,type:e.type?e.type:"task",status:e.status?e.status:"notStarted",users:l},e.checklist&&n?{checklist:!0}:{}),r&&r.automationDueDateType&&"add"===r.automationDueDateType&&(a=Object(h.a)(Object(h.a)({},a),{},{startDate:Ve()("".concat(Ve()().format("YYYY-MM-DD")," 00:00:00")).unix("X"),endDate:Ve()("".concat(Ve()().format("YYYY-MM-DD")," 23:59:59")).add((null===r||void 0===r?void 0:r.automationDueDate)||1,"days").unix("X")})),r&&r.automationStatusType&&"replace"===r.automationStatusType&&(a=Object(h.a)(Object(h.a)({},a),{},{status:r.automationStatus||"notStarted"},r.automationStatus&&"completed"===r.automationStatus?{completed_at:Ve()().unix("x")}:{})),(o=xi(a,e.rows||0,e))&&(console.log(o),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),o)})))),d.current=Object(h.a)(Object(h.a)({},d.current),{},{loading:!1}),e.onCancel&&e.onCancel();case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return i.a.createElement("div",{style:Object(h.a)({position:"absolute",top:0,left:0,bottom:0,right:0,backgroundColor:"rgba(250,250,250,0.77)",width:"100%",padding:"7px",display:"flex",alignItems:"center"},e.styles?e.styles:{})},i.a.createElement("div",{style:{width:"calc(100% - 50px)"}},i.a.createElement(yi.a,{ref:u,style:{width:"100%",padding:7,border:"none",borderBottom:"solid 1px ".concat(dt("color")),background:"none",resize:"none",fontFamily:"inherit",fontSize:14},onKeyDown:function(t){var r=t.which||t.keyCode;return 13!==r||t.shiftKey?13===r&&t.shiftKey&&u.current&&u.current.value&&0===u.current.value.trim().length?(t.preventDefault(),void(u.current.value="")):void(27===r&&e.onCancel&&e.onCancel()):(t.preventDefault(),void(u.current&&u.current.value&&u.current.value.trim().length>0&&p()))},autoFocus:!0}),i.a.createElement(ei,{includeMe:!0,defineResponsible:!0,avatarSize:"23px",permission:!0,noLimit:!0,multiple:!0,onSelect:function(e){s(e)},selected:l,transparent:!0})),i.a.createElement("div",{style:{display:"flex"}},e.checklist&&!e.myDay&&i.a.createElement(At,{id:"sideModule_saveButton",title:lt("$__saveWithChecklist",1),color:dt("color"),icon:"playlist_add",onClick:function(){!u.current.value||u.current.value&&""===u.current.value.trim()?u.current.focus():p(!0)},size:"25px"}),i.a.createElement(At,{id:"sideModule_saveButton",title:lt("$__save",1),color:"green",icon:"save",onClick:function(){!u.current.value||u.current.value&&""===u.current.value.trim()?u.current.focus():p()},size:"25px"}),i.a.createElement(At,{id:"sideModule_saveButton",title:lt("$__cancel",1),color:dt("medium"),icon:"cancel",onClick:function(){e.onCancel&&e.onCancel()},size:"25px"})))}));function Oi(){Oi=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var ji=Xe.default.div(wi||(wi=Object(ze.a)(["\n background-color:none\n ","\n "])),(function(e){return e.isDragDisable?"":e.isDragging?"opacity:0.88":""})),Si=Object($e.b)((function(e){return{cards:e.db.cards}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.db,n=t.session,a=De.getState().functions.socket,o=i.a.useState(e.name?e.name:""),c=Object(Be.a)(o,2),l=(c[0],c[1],i.a.useState(!1)),s=Object(Be.a)(l,2),u=s[0],d=s[1],p=i.a.useState(!1),f=Object(Be.a)(p,2),m=f[0],g=(f[1],i.a.useState(!1)),v=Object(Be.a)(g,2),y=v[0],b=v[1],x=Ve()().tz("America/Sao_Paulo").format("YYYY/MM/DD"),_=window.location.hash.split("/");_[0]=_[0].replace("#",""),36!==_[0].length&&(_[0]=null);var w={};De.getState().db[e.db]&&De.getState().db[e.db][e.nodeId]&&(w=De.getState().db[e.db][e.nodeId]);var E=Object.keys(De.getState().db.cards).filter((function(t){return!(e.myDay||"step"===De.getState().db.cards[t].type||!(!e.noChecklist&&De.getState().db.cards[t]&&!De.getState().db.cards[t].deleted&&De.getState().db.cards[t]._parent===e.nodeId||e.noChecklist&&!De.getState().db.cards[t].deleted&&De.getState().db.cards[t]._parent===e.nodeId))||(!(!(e.myDay&&r.cards[t]._users&&r.cards[t]._users[n._id]&&r.cards[t]._users[n._id].myDay&&Ve()(new Date(1e3*r.cards[t]._users[n._id].myDay)).tz("America/Sao_Paulo").format("YYYY/MM/DD")===x&&De.getState().db.cards[t])||De.getState().db.cards[t].deleted)||void 0)})).sort((function(e,t){var n=r.cards[e]&&r.cards[e].order&&!r.cards[e].order.low?parseInt(r.cards[e].order):r.cards[e].order&&r.cards[e].order.low?parseInt(r.cards[e].order.low):0,a=r.cards[t]&&r.cards[t].order&&!r.cards[t].order.low?parseInt(r.cards[t].order):r.cards[t].order&&r.cards[t].order.low?parseInt(r.cards[t].order.low):0;return n<a?-1:n>a?1:0})).map((function(e){return e})),j=function(){var t=Object(Me.a)(Oi().mark((function t(n){var o,i,c,l,s;return Oi().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(b(!1),o=n.destination,i=n.source,c=n.draggableId,o){t.next=4;break}return t.abrupt("return",!1);case 4:if(o.droppableId!==i.droppableId||o.id!==i.index){t.next=6;break}return t.abrupt("return",!1);case 6:return(l=Array.from(E.filter((function(e){return"completed"!==r.cards[e].status})).sort((function(e,t){var n=r.cards[e].order||0;String(n.low)&&(n=parseInt(n.low));var a=r.cards[t].order||0;return String(a.low)&&(a=parseInt(a.low)),n<a?-1:n>a?1:0})).map((function(e){return e})))).splice(i.index,1),t.next=10,setTimeout(500);case 10:return l.splice(o.index,0,c),t.next=13,setTimeout(500);case 13:return a.emit("data",{module:"cards",method:"put",action:"reorder"},{cards:l}),s=Object(h.a)({},De.getState().db.cards),t.next=17,new Promise((function(e,t){l.map((function(t,r){s=Object(h.a)(Object(h.a)({},s),{},Object(O.a)({},t,Object(h.a)(Object(h.a)({},s[t]),{},{order:"".concat(r+1)}))),r+1===l.length&&e(!0)}))}));case 17:return t.sent&&e.reduxFunction("IMMEDIATE","SET_DB",Object(h.a)(Object(h.a)({},r),{},{cards:Object(h.a)(Object(h.a)({},r.cards),s)})),t.abrupt("return");case 20:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),S=function(){var e=Object(Me.a)(Oi().mark((function e(t){return Oi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:b(!0);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),k=function(){var e=Object(Me.a)(Oi().mark((function e(t){return Oi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),L=E.filter((function(e){return"completed"!==r.cards[e].status})).sort((function(e,t){var n=r.cards[e]&&r.cards[e].order&&!r.cards[e].order.low?parseInt(r.cards[e].order):r.cards[e].order&&r.cards[e].order.low?parseInt(r.cards[e].order.low):0,a=r.cards[t]&&r.cards[t].order&&!r.cards[t].order.low?parseInt(r.cards[t].order):r.cards[t].order&&r.cards[t].order.low?parseInt(r.cards[t].order.low):0;return n<a?-1:n>a?1:0}));return i.a.createElement("div",{style:{width:"100%"},onClick:function(e){return e.stopPropagation()}},e.permission?i.a.createElement("div",{style:{width:"100%",position:"relative",display:"flex",alignItems:"center",padding:"3px 10px",justifyContent:"center"}},i.a.createElement("div",{style:{marginRight:15}},lt("$__requireConcludedByStep")),i.a.createElement(vi,{checked:!!w.listStepLock,onChange:function(){pa(Object(h.a)(Object(h.a)({},e),{},{data:{_id:w._id}}),{listStepLock:!w.listStepLock})},name:"listStepLock",inputProps:{"aria-label":"secondary checkbox"}}),i.a.createElement(At,{title:lt("$__openBoard"),text:lt("$__openBoard"),color:"lightgrey",textColor:"lightgrey",icon:"open_in_new",onClick:function(){e.reduxFunction("ASYNC","SET_CONTROL",Object(h.a)(Object(h.a)({},De.getState().control),{},{board:e.nodeId})),e.reduxFunction("ASYNC","CLEAR_MODULE")},size:"25px"})):i.a.createElement(i.a.Fragment,null),e.showProgress&&E.length>0?i.a.createElement("div",{style:{position:"relative",width:"100%"}},i.a.createElement("div",{style:{position:"absolute",right:7,bottom:0,fontSize:9,color:dt("menu"),fontWeight:"bold"}},E.filter((function(e){return"completed"===r.cards[e].status})).length,"/",i.a.createElement("span",{style:{fontWeight:"normal"}},E.length)),i.a.createElement("div",{style:{position:"relative",width:"100%",height:5,backgroundColor:"lightGray"}},i.a.createElement("div",{style:{position:"absolute",top:0,left:0,bottom:0,backgroundColor:dt("menu"),width:"".concat(100/E.length*E.filter((function(e){return"completed"===r.cards[e].status})).length,"%")}}))):i.a.createElement(i.a.Fragment,null),E.filter((function(e){return"completed"!==r.cards[e].status})).length>0?i.a.createElement(di.a,{onDragEnd:j,onDragStart:S,onDragUpdate:k},i.a.createElement(di.c,{droppableId:"Drop_tasks",type:"column",direction:"vertical"},(function(t,n){return i.a.createElement(ji,Object.assign({ref:t.innerRef},t.droppableProps,{isDraggingOver:n.isDraggingOver}),L.map((function(t,n){return i.a.createElement(di.b,{draggableId:t,index:n,key:"".concat(t).concat(n)},(function(a,o){return i.a.createElement(mi,{dragStatus:y,provided:a,snapshot:o,data:r.cards[t],db:"cards",selectable:!0,noDelete:!!e.noDelete&&e.noDelete,showCard:!(r.cards[t].checklist&&(!r.cards[t].checklist||!e.showCard&&!r.cards[t].showCard)),permission:e.permission,locked:w.listStepLock&&n>0&&"completed"!==r.cards[L[n-1]].status})}))})),t.placeholder)}))):i.a.createElement(i.a.Fragment,null),E.filter((function(e){return"completed"===r.cards[e].status})).length>0?i.a.createElement(i.a.Fragment,null,E.filter((function(e){return"completed"===r.cards[e].status})).sort((function(e,t){var n=0,a=0;return r.cards[e].completed_at&&r.cards[e].completed_at.low&&(n=parseInt(r.cards[e].completed_at.low)),r.cards[t].completed_at&&r.cards[t].completed_at.low&&(a=parseInt(r.cards[t].completed_at.low)),n>a?-1:n<a?1:0})).map((function(t,n){return i.a.createElement("div",{key:"".concat(t).concat(n)},i.a.createElement(mi,{dragStatus:y,data:r.cards[t],db:"cards",selectable:!0,noDelete:!!e.noDelete&&e.noDelete,showCard:!(r.cards[t].checklist&&(!r.cards[t].checklist||!e.showCard&&!r.cards[t].showCard)),permission:e.permission,locked:w.listStepLock&&n>0&&"completed"!==r.cards[L[n-1]].status}))}))):i.a.createElement(i.a.Fragment,null),!u&&!m&&(e.permission||e.myDay)&&i.a.createElement("div",{style:{position:"relative",float:"right",width:"100%",padding:"7px",display:"flex",alignContent:"flex-end",justifyContent:"center"}},i.a.createElement("div",null,i.a.createElement(rn,{reverse:!0,text:lt("$__add","*"),icon:"add_box",iconColor:dt("medium"),onClick:function(){d(!u)}}))),u&&!m?i.a.createElement(Ei,{nodeId:w._id,checklist:!0,onCancel:function(){return d(!1)},rows:E.length,myDay:e.myDay||!1}):m?i.a.createElement("div",{style:{position:"relative",float:"right",width:"100%",padding:"7px",display:"flex",alignContent:"flex-end",justifyContent:"center",color:dt("menu")}},lt("$__saving")):i.a.createElement(i.a.Fragment,null))}));var ki=function(e){var t=De.getState(),r=t.db,n=t.session,a=function e(t){var r=De.getState(),n=r.db,a=r.session,o=De.getState().db.cards[t];if(De.getState().db.cards[t]){var i={};return(!De.getState().db.cards[t].private||De.getState().db.cards[t].private&&De.getState().db.cards[t]._users&&De.getState().db.cards[t]._users[a._id])&&(i=Object(O.a)({},t,{_id:o._id,type:o.type,name:o.name,icon:o.type&&n&&n.dataType?n.dataType.filter((function(e){return e.name===o.type}))[0].icon:"topic"})),o._parent&&(i=Object(h.a)(Object(h.a)({},e(o._parent)),i)),i}return{}}(e.id),o=xt();if(0===Object.keys(a).length)return null;var c=Object.keys(a).map((function(t,c){var l=ia(t);if(a[t].icon&&a[t].type&&a[t].name)return i.a.createElement("div",{style:{marginRight:"10px",width:"100%"},key:c},i.a.createElement("div",{style:{display:"flex",cursor:"pointer"},onClick:e.open&&((o.planAdmin||o.planModerate)&&("plan"!==r.cards[a[t]._id].type||"plan"===r.cards[a[t]._id].type&&ga(a[t]._id))||l>=1)&&(!r.cards[a[t]._id].private||r.cards[a[t]._id].private&&r.cards[a[t]._id]._users&&r.cards[a[t]._id]._users[n._id])?function(r){e.open(a[t]._id),r.stopPropagation()}:null},i.a.createElement(Qr,{overlap:"rectangular",icon:a[t].icon,title:"".concat(lt("$__".concat(a[t].type),"*"),": ").concat(a[t].name),size:"16px",color:dt("color")}),i.a.createElement("span",{style:{marginLeft:"5px"}},a[t].name)),i.a.createElement("div",{style:{clear:"both"}}))}));return i.a.createElement("div",{style:{width:"calc(100% - 5px)"},onClick:function(e){e.stopPropagation()}},e.showLegend?i.a.createElement("fieldset",{style:{marginBottom:"14px",width:"100%"}},i.a.createElement("legend",null,lt("$__connectedIn",1)),c):c,i.a.createElement("div",{style:{clear:"both"}}))},Li=r(981),Ci=r.n(Li),Ii=Object(Lt.a)((function(e){return{iconButtonStyleTransaparent:{margin:0,"&:hover":{backgroundColor:"rgba(250,250,250,0.9)"}},iconButtonStyleWhite:{margin:0,backgroundColor:"#FFFFFF","&:hover":{backgroundColor:"rgba(250,250,250,0.9)"}}}}));var Fi=function(e){var t=Ii(),r=i.a.useState(!1),n=Object(Be.a)(r,2),a=n[0],o=n[1],c=i.a.useRef(null),l=function(e){c.current&&c.current.contains(e.target)||o(!1)};return i.a.createElement("div",{onClick:function(e){e.stopPropagation()},style:{zIndex:100}},i.a.createElement(Qe.a,{title:lt("$__options",1)},i.a.createElement(Tt.a,{ref:c,"aria-controls":a?"menu-list-grow":void 0,"aria-haspopup":"true","aria-label":"menu",onClick:function(t){o((function(e){return!e})),e.onClick&&e.onClick(),t.stopPropagation()},className:e.transparent?t.iconButtonStyleTransaparent:t.iconButtonStyleWhite},i.a.createElement(kt,{usePropagation:!0,size:e.size?e.size:"20px",color:e.iconColor?e.iconColor:dt("menu"),icon:e.icon?e.icon:"design_services",title:e.title?e.title:"NO_ALIAS"}))),i.a.createElement(mn.a,{open:a,anchorEl:c.current,role:void 0,transition:!0},(function(t){var r=t.TransitionProps,n=t.placement;return i.a.createElement(fn.a,Object.assign({},r,{style:{transformOrigin:"bottom"===n?"center top":"center bottom"}}),i.a.createElement(hn.a,null,i.a.createElement(pn.a,{onClickAway:l},i.a.createElement("div",{onClick:function(e){e.stopPropagation(),e.preventDefault()}},i.a.cloneElement(e.children,{callBack:function(e){o(!1)}})))))})))};function Ti(){Ti=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}r(618);var Ni=Object($e.b)((function(e){return{store:{timeline:e.timeline,cards:e.db.cards}}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(qo)((function(e){var t=e.classes,r=e.data,n=De.getState(),a=n.db,o=n.timeline,c=a.cards,l=i.a.useState(!1),s=Object(Be.a)(l,2),u=s[0],d=s[1],p=i.a.useState(!0),f=Object(Be.a)(p,2),m=(f[0],f[1]),g=i.a.useState(!0),v=Object(Be.a)(g,2),y=v[0],b=v[1],x=i.a.useState([]),_=Object(Be.a)(x,2),w=_[0],E=_[1],O=parseFloat(r.kpi_ini),j=parseFloat(r.kpi_fin);i.a.useEffect((function(){u||(d(!0),L(e.data._id),S())}),[]),i.a.useEffect((function(){L(e.data._id)}),[c]);var S=function(){var t=Object(Me.a)(Ti().mark((function t(){return Ti().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!o||o[r._id]&&(!o[r._id]||0!==Object.keys(o[r._id]).filter((function(e){return"kpi"===o[r._id][e].type})).length)){t.next=7;break}return t.next=3,uo(Object(h.a)(Object(h.a)({},e),{},{fnIdentification:"Timeline/Index/init()"}),{ids:[r._id],db:"cards",reqChildrens:!0,type:"kpi",limit:!0});case 3:t.sent&&b(!1),t.next=8;break;case 7:b(!1);case 8:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),k=[e.data._id],L=function(){var e=Object(Me.a)(Ti().mark((function e(t,r){var n;return Ti().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=Object.keys(c).filter((function(e){return c[e].kpi_useParent&&c[e]._parent===t}))).length>0?n.map(function(){var e=Object(Me.a)(Ti().mark((function e(t){return Ti().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:L(t,!0),k.push(t),E(Array.from(new Set(k)));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()):r||E(k),e.abrupt("return",n);case 3:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}();if(!r)return null;var C=Object(h.a)({},ti.model),I=[],F=[],T={};w.map((function(e){T=Object(h.a)(Object(h.a)({},T),o[e]||{})})),T=Object.keys(T).filter((function(e){return"kpi"===T[e].type&&T[e].kpi_type===r.kpi_type})).map((function(e){return T[e]}));var N="time"!==r.kpi_type?parseFloat(O):0,P=parseFloat(O)-parseFloat(j),D=0;P<0&&(P*=-1),T&&Object.keys(T).length>0&&Object.keys(T).sort((function(e,t){return T[e].created_at<T[t].created_at?-1:1})).map((function(e,t){N=parseFloat(N)+parseFloat(T[e].value),D+=parseFloat(T[e].value),I.push({meta:T[e].value,total:N,value:parseFloat(O)>parseFloat(j)?100-Math.floor(100*N/P):Math.floor(100*N/P)}),F.push(t+1),t+1===Object.keys(T).length&&(C=Object(h.a)(Object(h.a)({},C),{},{data:{labels:F,series:[[].concat(I)]},options:Object(h.a)(Object(h.a)({},C.options),{},{low:0,high:100,plugins:[Vo.a.plugins.tooltip({tooltipFnc:function(e,t,n){return"".concat(e>0?"+":"")+mt(e,"time"===r.kpi_type?"number":r.kpi_type,r.kpi_currency?r.kpi_currency:null)+"<br>"+mt(t,"percent")}})],axisX:{showGrid:!1},axisY:{showGrid:!1},onlyInteger:!0})}))}));var A=O<j?j-O:O-j,$=A;T&&Object.keys(T).length>0&&Object.keys(T).map((function(e){A=parseFloat(A)+parseFloat(T[e].value)}));var z=$-(A-$),M=$-($-A),B=Math.ceil(O<j?j-O:O-j);if((B=100*Math.ceil(A)/B-100)<0&&(B*=-1),!e.data)return i.a.createElement("div",null,"NO DATA RECEIVED");if(y)return i.a.createElement("div",{style:{position:"absolute",bottom:0,left:"7px",right:"7px"}},i.a.createElement(Fo,null));return i.a.createElement("div",{className:t.root},i.a.createElement(i.a.Fragment,null,e.chartShow&&"time"!==r.kpi_type&&"task"!==r.kpi_type&&T.length>0&&i.a.createElement("div",{style:{backgroundColor:dt("color")}},i.a.createElement(Ci.a,{className:"ct-chart-white-colors",data:C.data,type:"Line",options:C.options,listener:C.animation})),"task"!==r.kpi_type&&i.a.createElement("fieldset",{style:{position:"relative"}},i.a.createElement("legend",{style:{color:dt("color")}},lt("$__progress",1)),i.a.createElement("div",{className:t.progress},i.a.createElement(Fo,{variant:"determinate",size:100,value:B,showText:!0,onClick:function(){}})),i.a.createElement("div",{style:{position:"relative",textSize:"11px",fontWeight:"bold",color:dt("color")}},function(){var e=O&&parseInt(O)?parseInt(O):0,t=j&&parseInt(j)?parseInt(j):0;r&&"time"===r.kpi_type&&({},parseInt(e)<parseInt(t)&<("$__maxTime",1),parseInt(e)>parseInt(t)&<("$__minTime",1)),e>0&&"".concat(lt("$__initial",1),": ").concat(mt(e,"time"===r.kpi_type?"number":r.kpi_type,r.kpi_currency?r.kpi_currency:null)," / ");return["decimal","currency","percentage"].indexOf(r.kpi_type)>-1&<("$__targetValue",1),i.a.createElement(i.a.Fragment,null,lt("".concat(e>t?"$__balance":"$__targetValue"),1),": ",mt(e<t?z:M||0,"time"===r.kpi_type?"number":r.kpi_type,r.kpi_currency?r.kpi_currency:null),"time"===r.kpi_type?i.a.createElement("span",{style:{marginLeft:5,fontSize:10,textTransform:"lowercase"}},lt("$__minutes")):"")}()),i.a.createElement("div",{style:{position:"relative",textSize:"11px",fontWeight:"bold",color:D>0?dt("green"):"red"}},lt("$__accomplished",1),": ",D&&parseInt(D)>0?mt(D,"time"===r.kpi_type?"number":r.kpi_type,r.kpi_currency?r.kpi_currency:null):0),i.a.createElement("div",{style:{position:"absolute",right:"0px",top:"-33px",display:"flex"}},(B>=0&&B<100&&j>O||B>0&&B<=100&&j<O)&&i.a.createElement(Fi,{icon:"add_circle",title:lt("$__increase"),iconColor:dt("blue"),onClick:function(){m(!0)},transparent:!0},i.a.createElement(Jo,{data:r,PositiveValue:!0,callBack:function(){}})),(B>=0&&B<100&&j<O||B>0&&B<=100&&j>O)&&i.a.createElement(Fi,{icon:"remove_circle",iconColor:"orange",title:lt("$__decrease"),onClick:function(){m(!1)},transparent:!0},i.a.createElement(Jo,{data:r,PositiveValue:!1,callBack:function(){}})))),"task"===r.kpi_type&&i.a.createElement("div",{className:t.time},"TASK")))}))),Pi=r(1826),Di={root:Object(h.a)({},rr),aspectsTitle:{width:"100%",fontWeight:"bold",padding:"3px",color:dt("color"),display:"flex",alignItems:"center"}},Ai=Object(Lt.a)(Di);var $i,zi,Mi=Object($e.b)((function(e){return{}}),(function(e){return Object(u.b)(n,e)}))((function(e){console.log(e.data);var t=De.getState().db,r=Ai(),n=i.a.useState(!1),a=Object(Be.a)(n,2),o=(a[0],a[1],i.a.useState([])),c=Object(Be.a)(o,2),l=c[0],s=c[1];i.a.useEffect((function(){var r=[];return e.data&&e.data.length>0&&e.data.map((function(e){r.push(t.cards[e])})),s(r),function(){}}),[e.data]);var u="guidelineD"===e.type||"guidelineR"===e.type?l.filter((function(e){return e&&"strength"===e.type})):l.filter((function(e){return e&&"weakness"===e.type})),d="guidelineD"===e.type||"guidelineE"===e.type?l.filter((function(e){return e&&"threat"===e.type})):l.filter((function(e){return e&&"opportunity"===e.type})),p="guidelineD"===e.type||"guidelineR"===e.type?"strength":"weakness",f="guidelineD"===e.type||"guidelineE"===e.type?"threat":"opportunity",h="guidelineD"===e.type||"guidelineR"===e.type?"forces":"weaknesses",m="guidelineD"===e.type||"guidelineE"===e.type?"threats":"opportunities";return i.a.createElement("div",{className:r.root},i.a.createElement("div",{className:r.aspectsTitle},i.a.createElement(kt,{icon:"guidelineD"===e.type||"guidelineR"===e.type?t.dataType.filter((function(e){return"strength"===e.name}))[0].icon:t.dataType.filter((function(e){return"weakness"===e.name}))[0].icon,color:dt("color"),title:lt(p,1)}),i.a.createElement("span",{style:{marginLeft:"5px"}},lt("$__internalAspects",1)," - ",lt("$__".concat(h),1))),u&&u.length>0&&u.sort((function(e,t){return e.name-t.name})).map((function(e,t){return i.a.createElement(Pi.a,{size:"small",label:e.name,title:e.name,style:{margin:"3px",maxWidth:"100%",overflow:"hidden"},key:e._id})})),i.a.createElement("div",{className:r.aspectsTitle},i.a.createElement(kt,{icon:"guidelineD"===e.type||"guidelineE"===e.type?t.dataType.filter((function(e){return"threat"===e.name}))[0].icon:t.dataType.filter((function(e){return"opportunity"===e.name}))[0].icon,color:dt("color"),title:lt(f,1)}),i.a.createElement("span",{style:{marginLeft:"5px"}},lt("$__externalAspects",1)," - ",lt("$__".concat(m),1))),d&&d.length>0&&d.sort((function(e,t){return e.name-t.name})).map((function(e,t){return i.a.createElement(Pi.a,{size:"small",label:e.name,title:e.name,style:{margin:"3px",maxWidth:"100%",overflow:"hidden"},key:e._id})})))})),Bi={containerNoShadow:Object(h.a)(Object(h.a)({},rr),{},($i={position:"relative",border:"0.5px solid ".concat(dt("light")),borderRadius:"2px",padding:"0px",backgroundColor:"#FFFFFF"},Object(O.a)($i,"padding","3px"),Object(O.a)($i,"minWidth","150px"),Object(O.a)($i,"display","flow-root"),$i)),container:Object(h.a)(Object(h.a)({},rr),{},(zi={position:"relative",border:"0.5px solid ".concat(dt("light")),borderRadius:"2px",padding:"0px",backgroundColor:"#FFFFFF"},Object(O.a)(zi,"padding","3px"),Object(O.a)(zi,"minWidth","150px"),Object(O.a)(zi,"display","flow-root"),Object(O.a)(zi,"boxShadow","0px 0px 10px rgba(0,0,0,0.1)"),zi)),parent:{width:"100%",padding:"0 5px","& .title":{color:dt("medium"),fontSize:"10px",textTransform:"uppercase"},"& .info":{marginTop:"-8px",color:dt("color"),fontWeight:"500",alignItems:"center"}},infos:{position:"relative",float:"left",width:"100%",height:"auto",display:"block"},indicators:{position:"relative",float:"left",height:"auto",zIndex:"0 !important"},indicatorsIcon:{position:"relative",float:"left",margin:"0px 0px","& MuiBadge-badge":{position:"relative",float:"left"}},image:{position:"relative",float:"left",width:"100%",marginTop:"7px",maxWidth:"100%",display:"none"},imagePreview:{backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center",paddingTop:"48%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative",float:"left",width:"100%"},imagePreviewList:{backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center",display:"flex",justifyContent:"center",alignItems:"center",position:"relative",float:"left",width:"100%",paddingTop:"48%","@media screen and (max-width: 800px)":{width:"100%"}},PreLoader:{top:"calc(50% - 25px)",left:"calc(50% - 25px)",position:"absolute"},description:{position:"relative",float:"left",padding:"5px",minHeight:"75px",width:"100%",overflow:"hidden",textOverflow:"ellipses"},dates:{position:"relative",float:"left",width:"100%",marginTop:"7px",padding:"0 5px",marginRight:"15px",color:dt("medium"),fontSize:"10px",display:"flex"},lateDates:{position:"relative",float:"left",width:"100%",marginTop:"7px",padding:"0 5px",marginRight:"15px",color:"red",fontSize:"10px",display:"flex"},dateInfo:{marginRight:"15px",display:"flex",alignItems:"center"},usersContent:{minHeight:"20px",minWidth:"40px",zIndex:"0 !important"},users:{position:"absolute",bottom:"0px",right:"2px",fontSize:"10px","& .MuiAvatarGroup-root":{justifyContent:"flex-end"},"& .MuiAvatar-root":{width:"25px",height:"25px",fontSize:"10px"}}},Yi=r(704),Gi=r.n(Yi);function Ri(){Ri=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Hi=Object($e.b)((function(e,t){return{card:e.db.cards[t.data._id]}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Bi)((function(e){var t=e.classes,r=De.getState(),n=r.db,a=r.session,o=r.timeline,c=i.a.useState(null),l=Object(Be.a)(c,2),s=l[0],u=l[1],d=i.a.useState(!0),p=Object(Be.a)(d,2),f=p[0],m=p[1],g=i.a.useState(!1),v=Object(Be.a)(g,2),y=(v[0],v[1],i.a.useState(!1)),b=Object(Be.a)(y,2),x=b[0],_=b[1],w=i.a.useState(!1),E=Object(Be.a)(w,2),O=E[0],j=E[1],S=e.data&&e.data._id?De.getState().db.cards[e.data._id]:{},k=(xt(),window.location.hash.split("/"));k[0]=k[0].replace("#",""),i.a.useEffect((function(){var e=!0;return e&&(S._parent&&(!k[0]||k[0]&&36!==k[0].length)?L():j(!1)),function(){e=!1}}),[]);var L=function(){var t=Object(Me.a)(Ri().mark((function t(){var r;return Ri().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(!S._loadTimeline||S._loadTimeline&&!S._loadTimeline.kpi)&&S.kpi_type&&"task"!==S.kpiType&&"timer"!==S.kpiType&&"time"!==S.kpiType&&uo(Object(h.a)(Object(h.a)({},e),{},{fnIdentification:"Card/index/init()"}),{ids:[S._id],db:"cards",type:"kpi"}),r=function(){var t=Object(Me.a)(Ri().mark((function t(a){return Ri().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.cards[a]){t.next=8;break}return j(!0),t.next=4,In(Object(h.a)(Object(h.a)({},e),{},{ignoreLoader:!0}),{idRel:[a],cardLoad:"parents"});case 4:t.sent&&j(!1),t.next=9;break;case 8:n.cards[a]&&n.cards[a]._parent?r(n.cards[a]._parent)&&j(!1):j(!1);case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),function(){var e=Object(Me.a)(Ri().mark((function e(){return Ri().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r(S._parent);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()(),e.onExpand&&e.onExpand();case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();if(O)return i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%"}},i.a.createElement("span",{style:{color:dt("menu"),fontSize:"12px",paddingRight:"15px",whiteSpace:"nowrap"}},lt("$__loadingData")),i.a.createElement(Fo,null));if(!S||!e.data||!e.data._id)return null;var C=function(){var t=Object(Me.a)(Ri().mark((function t(){var r,n=arguments;return Ri().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.length>0&&void 0!==n[0]?n[0]:"cardEdit",e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},e.store.sideModule),{},{db:e.db,id:S._id,module:"cardEdit",activeModule:r,data:S}));case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),I=!1,F=i.a.createElement(i.a.Fragment,null);if(S&&S.url&&S.url.indexOf(".youtube.com/watch?")>-1){var T=S.url.split("?")[1].split("v=")[1].split("&")[0];T&&(F=i.a.createElement("iframe",{width:"560",height:"315",style:{top:0,width:"100%",maxWidth:"500px",height:"100%",alignSelf:"center",position:"absolute",overflow:"hidden"},src:"https://www.youtube.com/embed/".concat(T),title:"YouTube video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}),I=!0)}if(S&&S.url&&S.url.indexOf("youtu.be/")>-1){var N=S.url.split("youtu.be/")[1];N&&(F=i.a.createElement("iframe",{width:"560",height:"315",style:{top:0,width:"100%",maxWidth:"500px",height:"100%",alignSelf:"center",position:"absolute",overflow:"hidden"},src:"https://www.youtube.com/embed/".concat(N),title:S.name,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}),I=!0)}return i.a.createElement("div",null,i.a.createElement("div",null,i.a.createElement("div",Object.assign({},e.provided&&e.provided.dragHandleProps,{style:{display:"none"}})),i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:t.infos,onClick:function(t){e.onClick&&e.onClick()}},S.image&&(S.image||e.Avatar||S.image||e.Avatar)&&!a.cards.hide.image?i.a.createElement("div",{className:t.imagePreview,style:s?{backgroundImage:'url("'.concat(s||on.a,'")')}:{background:dt("AvatarBackground"),display:"flex",alignItems:"center",justifyContent:"center"}},I?F:S.image&&!s?i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{marginTop:"calc(-48% - ".concat("insight"===S.type||"link"===S.type?"10px":"0px",")"),display:"flex",justifyContent:"center",alignItems:"center"}},"insight"===S.type||"link"===S.type?i.a.createElement(kt,{icon:U.a,size:"39px",color:"rgba(250,250,250,0.77)"}):i.a.createElement("img",{src:Gi.a,style:{width:"25%"}}),i.a.createElement("div",{style:{clear:"both"}})),!f&&i.a.createElement("div",{style:{position:"absolute",marginTop:"calc(-48% + 0px)",zIndex:1}},i.a.createElement(Xr,null),i.a.createElement("div",{style:{clear:"both"}}))):i.a.createElement(i.a.Fragment,null),!I&&(!s||e.Avatar||S.image!==s)&&i.a.createElement(i.a.Fragment,null,i.a.createElement("img",{className:t.image,src:"".concat(S.image?S.image:on.a),onError:function(e){S.image?u(null):m(!0)},onLoad:function(t){u("".concat(e.Avatar&&!S.image?on.a:S.image))},width:"100%"})),i.a.createElement("div",{style:{clear:"both"}})):e.Avatar&&!a.cards.hide.image&&i.a.createElement("div",{className:n.viewList?t.imagePreviewList:t.imagePreview,style:{background:dt("AvatarBackground"),display:"flex",alignItems:"center",justifyContent:"center"}},i.a.createElement("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"}},"insight"===S.type||"link"===S.type?i.a.createElement(kt,{icon:U.a,size:"39px",color:"rgba(250,250,250,0.77)"}):i.a.createElement("img",{src:Gi.a,style:{width:"25%"}}),i.a.createElement("div",{style:{clear:"both"}})),i.a.createElement("div",{style:{clear:"both"}})),"swot"!==n.dataType.filter((function(e){return e.name===S.type}))[0].module&&(S._parent&&S._parent!==S._id||S._planId&&S._planId!==S._id)&&i.a.createElement("div",{style:{position:"relative",width:"100%",display:"flex",paddingTop:"7px"}},"SQUASH"===S.name&&console.log(S),n.cards[S._parent]?i.a.createElement(ki,{id:S._parent&&De.getState().db.cards[S._parent]?S._parent:S._planId&&De.getState().db.cards[S._planId]?S._planId:null,loading:O,showLegend:!e.Resume}):i.a.createElement(i.a.Fragment,null),i.a.createElement("div",{style:{clear:"both"}})),i.a.createElement("div",{style:!n.viewList||e.ignoreList?{}:{position:"relative",float:"left",width:"100%"}},S.type.indexOf("guideline")>-1&&(S._aspects&&S._aspects.length>0||S._aspects&&S._aspects.length>0)?i.a.createElement(Mi,{data:S._aspects,type:S.type}):i.a.createElement(i.a.Fragment,null),!e.searchText&&S.description&&i.a.createElement(Qe.a,{title:S.description||""},e.Resume?i.a.createElement("div",{className:t.description,style:{height:90}},S.description?"".concat(S.description.substr(0,150),"..."):""):i.a.createElement("div",{className:t.description,style:{wordBreak:"break-word",height:90},dangerouslySetInnerHTML:{__html:S.description?st(S.description):""}})),S.kpi_type&&!a.cards.hide.kpi&&i.a.createElement(Ni,{data:S,chartShow:!a.cards.hide.kpiChart}),i.a.createElement(Yo.a,{max:100,className:t.indicators},(S._timelineCount&&S._timelineCount>0||o[S._id]&&Object.keys(o[S._id]).filter((function(e){return"comment"===o[S._id][e].type})).length>0)&&i.a.createElement(Qr,{overlap:"rectangular",className:t.indicatorsIcon,icon:"timeline",title:"$__timeline",size:"16px",onClick:function(){return!e.onlyOption&&C("timeline")},disabled:!0,count:o[S._id]&&Object.keys(o[S._id]).filter((function(e){return"comment"===o[S._id][e].type})).length>0?Object.keys(o[S._id]).filter((function(e){return"comment"===o[S._id][e].type})).length:S._timelineCount}),(S._logCount&&S._logCount>0||o[S._id]&&Object.keys(o[S._id]).filter((function(e){return"log"===o[S._id][e].type})).length>0)&&i.a.createElement(Qr,{overlap:"rectangular",className:t.indicatorsIcon,icon:"history",title:"$__log",size:"16px",onClick:function(){return!e.onlyOption&&C("log")},disabled:!0}),(S._kpiCount&&S._kpiCount>0||o[S._id]&&Object.keys(o[S._id]).filter((function(e){return"kpi"===o[S._id][e].type})).length>0)&&i.a.createElement(Qr,{overlap:"rectangular",className:t.indicatorsIcon,icon:"analytics",title:"$__kpi",size:"16px",onClick:function(){return!e.onlyOption&&C("kpi")},disabled:!0,count:o[S._id]&&Object.keys(o[S._id]).filter((function(e){return"kpi"===o[S._id][e].type})).length>0?Object.keys(o[S._id]).filter((function(e){return"kpi"===o[S._id][e].type})).length:S._kpiCount}),(S._timerCount&&S._timerCount>0||o[S._id]&&Object.keys(o[S._id]).filter((function(e){return"timer"===o[S._id][e].type})).length>0)&&i.a.createElement(Qr,{overlap:"rectangular",className:t.indicatorsIcon,icon:"timer",title:"$__timeSheet",size:"16px",onClick:function(){return!e.onlyOption&&C("timeLog")},disabled:!0,count:o[S._id]&&Object.keys(o[S._id]).filter((function(e){return"timer"===o[S._id][e].type})).length>0?Object.keys(o[S._id]).filter((function(e){return"timer"===o[S._id][e].type})).length:S._timerCount}),S&&S._id&&De.getState().db.cards&&Object.keys(De.getState().db.cards).length>0&&Object.keys(De.getState().db.cards).filter((function(e){return S&&S._id&&De.getState().db.cards[e]&&De.getState().db.cards[e].checklist&&De.getState().db.cards[e]._parent===S._id})).length>0&&i.a.createElement(Qr,{overlap:"rectangular",className:t.indicatorsIcon,icon:"checklist",title:"$__list",size:"16px",onClick:function(){return!e.onlyOption&&_(!x)},disabled:!0,count:De.getState().db.cards&&Object.keys(De.getState().db.cards).length>0&&Object.keys(De.getState().db.cards).filter((function(e){return S&&S._id&&De.getState().db.cards[e]&&De.getState().db.cards[e].checklist&&De.getState().db.cards[e]._parent===S._id})).length})),("link"===S.type||"insight"===S.type)&&i.a.createElement("div",{className:t.dates},i.a.createElement("div",{className:t.dateInfo},i.a.createElement(Qr,{overlap:"rectangular",className:t.dateIco,icon:"event_available",title:"$__pubDate",size:"14px",disabled:!0}),Ve()(1e3*S.created_at).tz("America/Sao_Paulo").format("DD/MM/YYYY HH:mm"))),i.a.createElement("div",{style:{clear:"both"}})),i.a.createElement("div",{style:{clear:"both"}}))),(x||"plan"!==S.type&&Object.keys(De.getState().db.cards).filter((function(e){return De.getState().db.cards[e]&&De.getState().db.cards[e].checklist&&De.getState().db.cards[e]._parent===S._id})).length>0&&0===Object.keys(De.getState().db.cards).filter((function(e){return De.getState().db.cards[e]&&"step"===De.getState().db.cards[e].type&&De.getState().db.cards[e]._parent===S._id})).length)&&i.a.createElement("div",{style:{position:"relative",width:"calc(100%)",top:"16px",clear:"both",marginBottom:"16px"}},i.a.createElement("div",{style:{padding:"7px",backgroundColor:"rgba(0,0,0,0.05)",fontSize:"16px",borderTopLeftRadius:7,borderTopRightRadius:7}},lt("$__list",1)),i.a.createElement(Si,{nodeId:S._id,db:"cards",noDelete:!0,showProgress:!0}),i.a.createElement("div",{style:{clear:"both"}})),(x||Object.keys(De.getState().db.cards).filter((function(e){return De.getState().db.cards[e]&&"step"===De.getState().db.cards[e].type&&De.getState().db.cards[e]._parent===S._id})).length>0)&&i.a.createElement("div",{style:{position:"relative",width:"calc(100%)",top:"16px",clear:"both",marginBottom:"16px"}},i.a.createElement(At,{title:lt("$__openTaskList"),text:lt("$__openTaskList"),color:"lightgrey",textColor:"lightgrey",icon:"open_in_new",onClick:function(){e.reduxFunction("ASYNC","SET_CONTROL",Object(h.a)(Object(h.a)({},De.getState().control),{},{board:S._id}))},size:"25px"}),i.a.createElement("div",{style:{clear:"both"}})),i.a.createElement("div",{style:{clear:"both"}})),i.a.createElement("div",{style:{clear:"both"}}))}))),Wi=r(982),Ui=r.n(Wi),Vi=r(983),qi=r.n(Vi),Xi=(r(1227),function(){return{root:{},viewer:{alignItems:"center",justifyContent:"center",display:"flex"},image:{width:"100%",backgroundRepeat:"no-repeat",backgroundSize:"cover"},avatarImage:{marginTop:"7px",width:"170px",height:"170px",borderRadius:"50%",boxShadow:"0px 0px 7px 7px rgba(0,0,0,0.2)"},addImage:{width:"100%",padding:"15px","&:hover":{}},cropper:{overflow:"hidden","& .cropper-container":{width:"100% !important",overflow:"hidden !important"}},circleCropper:{overflow:"hidden","& .cropper-container":{width:"100% !important",overflow:"hidden !important"},"& .cropper-view-box":{borderRadius:"50%"}}}});function Ji(){Ji=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Ki=i.a.createRef(null);var Zi=Object($e.b)((function(e){return{store:e}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Xi)((function(e){var t=i.a.useState(null),r=Object(Be.a)(t,2),n=r[0],a=r[1],o=i.a.useState(!1),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.useState(null),d=Object(Be.a)(u,2),p=d[0],f=d[1],h=i.a.useState([]),m=Object(Be.a)(h,2),g=m[0],v=m[1],y=i.a.useRef(null),b=e.classes;i.a.useEffect((function(){x()}),[]),i.a.useEffect((function(){x()}),[e.files,e.img]);var x=function(){var t=g;e.files&&(Object.keys(e.files).map((function(r){0===t.filter((function(e){return e._id===r})).length&&t.push(e.files[r])})),v(t))},_=function(){var t=Object(Me.a)(Ji().mark((function t(r){var n,o,i,c,l,u;return Ji().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=Ki.current.getCroppedCanvas().toDataURL(),a(n),f(null),s(!1),o=y.current.files[0].name,i=y.current.files[0].type,t.next=8,w(n,o,i);case 8:return c=t.sent,{maxSizeMB:.5,maxWidthOrHeight:e.maxWidthOrHeight?e.maxWidthOrHeight:600,useWebWorker:!0},t.prev=10,l=new Promise((function(t){return qi.a.imageFileResizer(c,e.maxWidthOrHeight?e.maxWidthOrHeight:600,e.maxWidthOrHeight?e.maxWidthOrHeight:600,c.type.replace("image/",""),50,0,(function(e){t(w(e,o,i))}))})),t.next=14,l.then((function(e){return e}));case 14:(u=t.sent)&&e.onChange&&e.onChange(n,u),t.next=21;break;case 18:t.prev=18,t.t0=t.catch(10),console.log(t.t0);case 21:case"end":return t.stop()}}),t,null,[[10,18]])})));return function(e){return t.apply(this,arguments)}}(),w=function(e,t,r){return fetch(e).then((function(e){return e.arrayBuffer()})).then((function(e){return new File([e],t,{type:r})}))};return i.a.createElement("div",{className:b.root},i.a.createElement("div",{className:b.viewer,style:{}},!n&&!e.img&&e.avatar&&e.avatarIcon&&i.a.createElement("div",{style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",marginTop:"15px"}},i.a.createElement("div",{style:{width:"133px",height:"133px",top:"-4px",left:"-13px",borderRadius:"50%",border:"solid 2px ".concat(dt("color")),zIndex:"5 !important",background:e.transparent?"none":dt("AvatarBackground"),display:"flex",alignItems:"center",justifyContent:"center"}},i.a.createElement(kt,{size:"40px",color:"rgba(250,250,250,0.77)"},e.avatarIcon))),e.avatar||!n&&!e.img?e.avatar&&(n||e.img)?i.a.createElement("div",{style:{width:"133px",height:"133px",top:"-4px",left:"-13px",borderRadius:"50%",border:"solid 2px ".concat(dt("color")),zIndex:"5 !important",background:e.transparent?"none":dt("AvatarBackground"),backgroundImage:'url("'.concat(n||e.img,'")'),backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundSize:"cover",display:"flex",alignItems:"center",justifyContent:"center"}}):i.a.createElement(i.a.Fragment,null):i.a.createElement("img",{className:e.avatar?b.avatarImage:b.image,src:"".concat(n||e.img),style:{cursor:"pointer"},onError:function(t){return t.target.src=n||e.img},width:"100%",alt:"",onClick:function(){!function(){if(g&&g.length>0){var t=g.filter((function(t){return e.img&&e.img.indexOf(t.file)>-1}));t.length>0&&e.reduxFunction("ASYNC","LIGHTBOX",{open:!0,files:t,file:t[0]._id})}}()}})),i.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},e.onChange?i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{padding:"7px"},onClick:function(){y.current.click()}},i.a.createElement(rn,{text:lt(n||e.img?"$__changeImage":"$__addImage",1),icon:n||e.img?"image":"add_a_photo",textColor:"color",iconColor:"color"})),i.a.createElement("input",{type:"file",onChange:function(e){!function(e){s(!0);var t=new FileReader;if(null!=e.files[0]){var r=e.files[0];t.onloadend=function(){f(t.result),s(!0)},t.readAsDataURL(r)}else s(!1)}(e.target)},ref:y,id:"file-picker",name:"image",accept:e.accept||".jpg,.jpeg,.png,.gif",style:{display:"none"}})):i.a.createElement(i.a.Fragment,null),e.onDelete&&(n||e.img)?i.a.createElement("div",{style:{padding:"7px"},onClick:function(){e.onDelete()}},i.a.createElement(rn,{text:lt("$__removeImage",1),icon:"hide_image",textColor:"color",iconColor:"color"})):i.a.createElement(i.a.Fragment,null)),i.a.createElement(Ko.a,{fullWidth:!0,onClose:function(){return s(!1)},"aria-labelledby":"simple-dialog-title",open:l},i.a.createElement("div",{style:{position:"relative",marginLeft:"10px",width:"calc(100% - 10px)",height:"45px",display:"flex"}},i.a.createElement(Io,{title:lt("$__cropImage",1),icon:"crop",onSave:function(){_()},onCancel:function(){s(!1)},actionsButtons:!0,actionButtonsStyle:{top:0,height:45,display:"flex",alignItems:"center"}})),i.a.createElement(Ui.a,{className:e.avatar?b.circleCropper:b.cropper,ref:Ki,src:p||null,style:{height:"50vh",width:"100%",margin:"auto",padding:"0px"},aspectRatio:e.ignoreAspect?null:e.aspectRatio?e.aspectRatio:e.avatar?1:16/9,guides:!e.noGuides,viewMode:String(e.viewMode)?e.viewMode:2,checkOrientation:e.checkOrientation||!1})))})));function Qi(){Qi=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var ec,tc=Object($e.b)((function(){return{}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Bi)((function(e){e.classes;var t=De.getState(),r=t.db,n=(t.session,t.timeline,t.functions,i.a.useState({})),a=Object(Be.a)(n,2),o=a[0],c=a[1];i.a.useEffect((function(){c(Object(h.a)(Object(h.a)(Object(h.a)({},e.toTemplate&&r.cards[e.cardId].name?{name:"".concat(lt("$__template")," - ").concat(r.cards[e.cardId].name)}:{}),e.toTemplate&&r.cards[e.cardId].description?{description:r.cards[e.cardId].description}:{}),e.toTemplate&&r.cards[e.cardId].image?{image:r.cards[e.cardId].image}:{}))}),[]);var l=i.a.useState({}),u=Object(Be.a)(l,2),d=u[0],p=u[1],f=i.a.useState(0),m=Object(Be.a)(f,2),g=m[0],v=m[1],y=De.getState().db.cards[e.cardId]&&De.getState().db.cards[e.cardId].type?r.dataType.filter((function(t){return t.name===De.getState().db.cards[e.cardId].type}))[0]:{},b=function(){var t=Object(Me.a)(Qi().mark((function t(){var n,a;return Qi().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!o||o.name){t.next=4;break}p(Object(h.a)(Object(h.a)({},d),{},{name:!0})),t.next=15;break;case 4:return v(1),t.prev=5,n=Object(h.a)(Object(h.a)(Object(h.a)({},r.cards[e.cardId]),o),{},{templateId:r.cards[e.cardId]._id,created_at:null,isTemplate:!!e.toTemplate||null,order:null,updated_at:null,_id:null,_planId:null}),t.next=9,An(e,!0,n);case 9:(a=t.sent)&&a._id&&(v(2),setTimeout((function(){x(a._id)}),1500)),t.next=15;break;case 13:t.prev=13,t.t0=t.catch(5);case 15:case"end":return t.stop()}}),t,null,[[5,13]])})));return function(){return t.apply(this,arguments)}}(),x=function(){var t=Object(Me.a)(Qi().mark((function t(r){return Qi().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,sa(e,e.cardId,r);case 3:t.sent&&(v(3),setTimeout((function(){_(r)}),1500)),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.log(t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e){return t.apply(this,arguments)}}(),_=function(){var t=Object(Me.a)(Qi().mark((function t(r){var n,a;return Qi().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,In(e,{idRel:[r],cardLoad:"plans"});case 2:return n=t.sent,t.next=5,In(e,{idRel:[r],cardLoad:"plans",completed:!0});case 5:a=t.sent,n&&a&&(v(4),setTimeout((function(){e.onComplete&&e.onComplete(),e.toTemplate?s.push("sp#tab/templates"):s.push("sp#".concat(r,"/dashboard"))}),500));case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return g>0?i.a.createElement(hn.a,{style:{padding:"7px"}},i.a.createElement(Fa,{title:"".concat(o.name?o.name:r.cards[e.cardId].name," "),icon:y&&y.icon?y.icon:"help",iconTitle:"$__".concat(r.cards[e.cardId].type),color:dt("medium"),fontSize:"16px"}),1===g&&i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",clear:"both"}},i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%"}},lt("$__installingTemplate")),i.a.createElement(Fo,null)),2===g&&i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",display:"flex"}},i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%"}},lt("$__templateInstalled")),i.a.createElement(kt,{icon:"done_all",color:"green"})),i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",marginTop:"15px"}},i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%"}},lt("$__copyingData")),i.a.createElement(Fo,null))),3===g&&i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",display:"flex"}},i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%"}},lt("$__templateInstalled")),i.a.createElement(kt,{icon:"done_all",color:"green"})),i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",display:"flex",marginTop:"15px"}},i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%"}},lt("$__copiedData")),i.a.createElement(kt,{icon:"done_all",color:"green"})),i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",marginTop:"15px"}},i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%"}},lt("$__preparingToRedirect")),i.a.createElement(Fo,null))),4===g&&i.a.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center"}},i.a.createElement("div",{style:{position:"relative",float:"left",padding:"15px",display:"flex",justifyContent:"center",borderRadius:"50%",border:"solid 1px green"}},i.a.createElement(kt,{icon:"done_all",color:"green",size:"50px"}))),i.a.createElement("div",{style:{clear:"both"}})):i.a.createElement(hn.a,{style:{padding:"7px"}},i.a.createElement(Fa,{title:"".concat(lt("$__template",1),": ").concat(r.cards[e.cardId].name),icon:y&&y.icon?y.icon:"help",iconTitle:"$__".concat(r.cards[e.cardId].type),color:dt("medium"),fontSize:"16px"}),i.a.createElement("div",null,i.a.createElement(Zi,{img:e.toTemplate&&r.cards[e.cardId].image?r.cards[e.cardId].image:null,onChange:function(e,t){c(Object(h.a)(Object(h.a)({},o),{},{image:e,file:t}))},placeholder:""}),i.a.createElement(La,{error:d&&d.name,helperText:lt("$__youMustDefineAName"),label:"".concat(lt("$__customName",1)),variant:dt("fieldVariant"),name:"name",defaultValue:e.toTemplate&&r.cards[e.cardId].name?"".concat(lt("$__template")," - ").concat(r.cards[e.cardId].name):null,InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"start"},i.a.createElement(kt,{icon:"view_headline"})),onChange:function(e){c(Object(h.a)(Object(h.a)({},o),{},{name:e.target.value})),d&&d.name&&p(Object(h.a)(Object(h.a)({},d),{},{name:!1}))}},placeholder:lt(e.toTemplate?"$__templateName_placeholder":"$__planName_placeholder",1)}),i.a.createElement(La,{label:"".concat(lt("$__customDescription",1)),variant:dt("fieldVariant"),name:"description",defaultValue:e.toTemplate&&r.cards[e.cardId].description?r.cards[e.cardId].description:null,InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"start"},i.a.createElement(kt,{icon:"toc"})),onChange:function(e){c(Object(h.a)(Object(h.a)({},o),{},{description:e.target.value}))}},placeholder:lt(e.toTemplate?"$__templateDescription_placeholder":"$__planDescription_placeholder",1),multiline:!0})),i.a.createElement("div",{style:{position:"relative",width:"100%",clear:"both",padding:"7px",backgroundColor:"#4caf50",marginTop:"7px",cursor:"pointer"},onClick:function(e){b(),e.stopPropagation()}},i.a.createElement(rn,{text:lt("$__ready","*"),icon:"done_all",iconColor:"#FFFFFF",textColor:"#FFFFFF"})),i.a.createElement("div",{style:{position:"relative",width:"100%",clear:"both",padding:"7px",backgroundColor:"lightgrey",cursor:"pointer"},onClick:function(t){e.onComplete(),t.stopPropagation()}},i.a.createElement(rn,{text:lt("$__cancel","*"),icon:"close",iconColor:"#FFFFFF",textColor:"#FFFFFF",onClick:e.onComplete?function(){e.onComplete()}:null})))})));function rc(){rc=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var nc=Object(Lt.a)(Bi),ac=Xe.default.div(ec||(ec=Object(ze.a)(["\n minWidth:200px;\n background-color:#fff;\n marginBottom:7px;\n\n ","\n ","\n ","\n ","\n ","\n ","\n width:calc(100%) !important;\n\n ","\n ","\n "])),(function(e){return e.separator?"marging-top:30px;":""}),(function(e){return e.selectable&&e.selected?"\n opacity:1;":e.selectable?"\n opacity:0.5;":""}),(function(e){return e.locked?"cursor:no-drop !important;":"cursor:pointer;"}),(function(e){return e.selected?"border-bottom:solid 5px ".concat(dt("color")," !important;"):""}),(function(e){return e.isDragDisable?"":e.isDragging?"opacity:0.88;\n max-width:320px;\n border:solid 10px red;":""}),(function(e){return e.inLine?"position:relative;\n float:left;\n margin:3.5px;\n width:calc(20% - 7px);\n // maxWidth:320px;\n ":"\n width:calc(100%) !important;\n margin:7px 0px 12px 0px;\n "}),(function(e){return e.priority?"border-left:5px solid ".concat(e.priority," !important;"):""}),(function(e){return e.isCombining?"border:solid 3px ".concat(dt("menu")," !important;"):""})),oc=Object($e.b)((function(e){return{cardsExpanded:e.db.cardsExpanded,showPrivate:e.controls.lockPrivate,cards:e.db.cards,unlockedPrivates:e.controls.unlockedPrivates,controls:e.controls}}),(function(e){return Object(u.b)(n,e)}))((function e(t){var r,n=nc(),a=De.getState(),c=a.db,l=a.session,u=t.data,d=i.a.useState(!1),p=Object(Be.a)(d,2),f=p[0],m=p[1],g=i.a.useState(t.cardsExpanded),v=Object(Be.a)(g,2),y=v[0],b=v[1],x=i.a.useState(!1),_=Object(Be.a)(x,2),w=_[0],E=_[1],j=i.a.useState(!1),S=Object(Be.a)(j,2),k=S[0],L=S[1],C=i.a.useState(!1),I=Object(Be.a)(C,2),F=I[0],T=I[1],N=i.a.useState(t.cardColorPicker?aa(u):{}),P=Object(Be.a)(N,2),D=P[0],A=P[1],$=i.a.useState(!1),z=Object(Be.a)($,2),M=z[0],B=z[1],Y=i.a.useState(!1),G=Object(Be.a)(Y,2),R=G[0],H=(G[1],i.a.useState((null===u||void 0===u?void 0:u.name)||"")),W=Object(Be.a)(H,2),U=W[0],V=W[1],q=i.a.useState(!1),X=Object(Be.a)(q,2),J=X[0],K=(X[1],i.a.useState({})),Z=Object(Be.a)(K,2),Q=Z[0],ee=Z[1],te=i.a.useState(!1),re=Object(Be.a)(te,2),ne=re[0],ae=re[1],oe=i.a.useState(!1),ie=Object(Be.a)(oe,2),ce=ie[0],le=ie[1],se=i.a.useState(!1),ue=Object(Be.a)(se,2),de=ue[0],pe=ue[1],fe=Object(o.useRef)({});Object(o.useRef)({}),Object(o.useEffect)((function(){if(fe.current&&t.onResize){var e=fe.current.clientHeight;t.separator&&(e+=55),t.onResize(e,f),fe.current.addEventListener("DOMNodeInserted",(function(){var e=fe.current.clientHeight;t.separator&&(e+=55),t.onResize(e,f)}))}}),[fe,f,t.manualExpanded,de]),Object(o.useEffect)((function(){var e,r;(null===t||void 0===t||null===(e=t.snapshot)||void 0===e?void 0:e.combineTargetFor)&&pe(!0),!(null===t||void 0===t||null===(r=t.snapshot)||void 0===r?void 0:r.combineTargetFor)&&de&&pe(!1)}),[null===t||void 0===t||null===(r=t.snapshot)||void 0===r?void 0:r.combineTargetFor]),i.a.useEffect((function(){var e=!0;return e&&"0"===String(t.unlockedPrivates)&&F&&T(!1),function(){e=!1}}),[t.unlockedPrivates]),i.a.useEffect((function(){var e=!0;return e&&b(t.cardsExpanded),function(){e=!1}}),[t.cardsExpanded]),i.a.useEffect((function(){t.onExpand&&t.onExpand(y)}),[y]);var he=window.location.hash.split("/");if(he[0]=he[0].replace("#",""),i.a.useEffect((function(){var e=!0;return e&&t.cardColorPicker&&he&&"overview"===he[1]&&A(aa(u)),function(){e=!1}}),[t.cards]),u==={}||!u)return i.a.createElement(i.a.Fragment,null);var me=xt(),ge=ia(u._id);if(!u||!t.data||!t.data._id)return null;var ve=function(){var e=Object(Me.a)(rc().mark((function e(){var r,n,a;return rc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r={},Object.keys(c.cards).filter((function(e){return c.cards[e]&&!c.cards[e].deleted&&(c.cards[e]._planId===he[0]||c.cards[e]._parent===he[0])})).map((function(e){r=Object(h.a)(Object(h.a)({},r),{},Object(O.a)({},e,c.cards[e]))})),n=Object(h.a)({},De.getState().db.cards),a=!u._selected,"swot"!==c.dataType.filter((function(e){return e.name===u.type}))[0].module&&Object.keys(r).filter((function(e){return r[e]._id!==u._id&&r[e].type&&r[e].type===u.type})).map((function(e){r[e]._selected&&(r[e]._selected=!1)})),u.type.indexOf("guideline")>-1&&Object.keys(r).map((function(e){r[e]._selected&&(r[e]._selected=!1)})),u.type.indexOf("objective")>-1&&Object.keys(r).filter((function(e){return"goal"===r[e].type})).map((function(e){r[e]._selected&&(r[e]._selected=!1)})),t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)(Object(h.a)({},n),r),{},Object(O.a)({},u._id,Object(h.a)(Object(h.a)(Object(h.a)({},De.getState().db.cards[u._id]),r[u._id]),{},{_selected:a})))})),"swot"===De.getState().db.dataType.filter((function(e){return e.name===u.type}))[0].module&&Bn(t),a&&"matrix"===De.getState().db.dataType.filter((function(e){return e.name===u.type}))[0].module&&Xn(t,u._id);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ye=function(){var e=Object(Me.a)(rc().mark((function e(){var r,n=arguments;return rc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=n.length>0&&void 0!==n[0]?n[0]:"cardEdit",t.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{db:t.db,id:u._id,module:"cardEdit",activeModule:De.getState().db.dataType.filter((function(e){return e.name===u.type}))[0].iniModule||r,data:u}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),be=function(){var e=Object(Me.a)(rc().mark((function e(){var r;return rc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Sn.post("/Card_Count",{id:u._id});case 2:r=e.sent,parseInt(r.data)>0?ft({message:lt("$__concludeWithChildrensNotConcludedConfirm",1),autoClose:5e4,buttons:[{shadow:!0,title:lt("$__concludeAll"),text:lt("$__concludeAll"),color:"green",icon:"close",size:"25px",onClick:function(){da(Object(h.a)(Object(h.a)({},t),{},{data:{_id:u._id}}),{status:"completed"===u.status?"inProgress":"completed"}),r&&parseInt(r.data)>0&&ha(t,u._id,"completed"===u.status?"inProgress":"completed")},style:{marginLeft:15}},{shadow:!0,title:lt("$__cancel"),text:lt("$__cancel"),color:"red",icon:"close",size:"25px",onClick:function(){},style:{marginLeft:15}}],variant:"warning",persist:!1,horizontal:"right"}):(da(Object(h.a)(Object(h.a)({},t),{},{data:{_id:u._id}}),{status:"completed"===u.status?"inProgress":"completed"}),r&&parseInt(r.data)>0&&ha(t,u._id,"completed"===u.status?"inProgress":"completed"));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),xe=function(){var e=Object(Me.a)(rc().mark((function e(t){return rc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:parseInt(ge)>2||me.owner||me.plan&&(me.planAdmin||me.planModerate)?s.push("sp#".concat(t,"/dashboard")):ye("timeline");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),_e=function(){var e=Object(Me.a)(rc().mark((function e(){return rc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:ft({message:lt("$__confirmDeleteThis",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){Wn(t,{_id:u._id},!1),t.directDeletion||t.reduxFunction("ASYNC","CLEAR_MODULE")}});case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),we=function(){var e=Object(Me.a)(rc().mark((function e(){return rc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:ft({message:lt("$__confirmRestoreThis",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){Hn(t,{_id:u._id})}});case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ee=Object.keys(De.getState().db.cards).filter((function(e){return De.getState().db.cards[e]&&!0===De.getState().db.cards[e]._selected&&De.getState().db.cards[e].type&&De.getState().db.cards[e].type.indexOf("guideline")>-1})).length>0,Oe=f||!t.notGlobalExpanded&&!!(t.manualExpanded||t.expanded||u._expanded||t.cardsExpanded),je=!!(me&&(me.owner||me.plan&&(me.planAdmin||me.planModerate))||ge>2),Se=function(){var e=Object(Me.a)(rc().mark((function e(){var r,n;return rc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return le(!0),r={},Object.keys(u).map((function(e){-1===e.indexOf("_")&&"created_at"!==e&&"updated_at"!==e&&(r=Object(h.a)(Object(h.a)({},r),{},Object(O.a)({},e,u[e])))})),r=Object(h.a)(Object(h.a)(Object(h.a)({},r),{},{idRel:Q&&Q._id?Q._id:u._parent?u._parent:null,name:U},J?{isModel:!0}:{}),{},{status:"notStarted"}),e.prev=4,e.next=7,An(t,!0,r,r.idRel);case 7:if(!(n=e.sent)||!n._id){e.next=13;break}return e.next=11,sa(t,u._id,n._id);case 11:e.sent&&(B(!1),ee({}),V(u.name),ae(!1),le(!1));case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(4),console.log("ERROR",e.t0);case 18:case"end":return e.stop()}}),e,null,[[4,15]])})));return function(){return e.apply(this,arguments)}}(),ke=function(){var e=Object(Me.a)(rc().mark((function e(){var t;return rc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t={},Object.keys(u).map((function(e){-1===e.indexOf("_")&&"created_at"!==e&&"updated_at"!==e&&(t=Object(h.a)(Object(h.a)({},t),{},Object(O.a)({},e,u[e])))})),t=Object(h.a)(Object(h.a)(Object(h.a)({},t),{},{idRel:Q&&Q._id?Q._id:u._parent?u._parent:null,name:U},J?{isModel:!0}:{}),{},{status:"notStarted"});case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Le={button:!1,date:null};if(Le=u&&u._users&&Object.keys(u._users).filter((function(e){return e===l._id})).length>0&&c.dataType.filter((function(e){return e.name===u.type})).length>0&&c.dataType.filter((function(e){return e.name===u.type}))[0].modules.indexOf("myDay")>-1?u._users[Object.keys(u._users).filter((function(e){return e===l._id}))[0]].myDay?{button:!0,date:u._users[Object.keys(u._users).filter((function(e){return e===l._id}))[0]].myDay}:{button:!0,date:null}:{button:!1,date:null},u&&u.private&&(!u._users||u._users&&!u._users[l._id]))return i.a.createElement(i.a.Fragment,null);if(w)return i.a.createElement(tc,{cardId:u._id,toTemplate:!u.isTemplate,onComplete:function(){E(!1)}});var Ce=["guideline","guidelineD","guidelineR","guidelineC","guidelineE","objective","goal"];return i.a.createElement(ac,{ref:fe,separator:t.separator||!1,plan:!(!Oe||"plan"!==u.type),isDragging:t.snapshot&&t.snapshot.isDragging,isDragDisable:u.isDragDisable||t.isDragDisable||!1,inLine:!("plan"===u.type||!t.inLine),className:t.noShadow?n.containerNoShadow:n.container,selectable:t.showSelected,selected:u._selected,priority:u.priority&&c.priority.filter((function(e){return String(e.value)===String(u.priority)})).length>0?c.priority.filter((function(e){return String(e.value)===String(u.priority)}))[0].color:null,locked:t.locked||!1,snapshot:t.snapshot||null,isCombining:!(!t.snapshot||!t.snapshot.combineTargetFor),onMouseOver:function(){L(!0)},onMouseLeave:function(){setTimeout((function(){L(!1)}),100)},onClick:function(e){t.selectable||!t.onClick&&(!t.locked&&t.showSelected&&Ee||t.selectable)?ve():!t.onClick||t.selectable||t.locked?t.locked||t.onlyOption||"plan"!==u.type?t.locked||ye():xe(u._id):t.onClick()},onContextMenu:function(e){}},("completed"===u.status||t.cardColorPicker&&D.color)&&i.a.createElement("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",cursor:"pointer"}},i.a.createElement("div",{style:{position:"absolute",backgroundColor:t.cardColorPicker&&D.color?D.color:"rgba(0,0,0,1)",opacity:D.color?.2:.1,top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",cursor:"pointer"}})),i.a.createElement(i.a.Fragment,null,t.snapshot&&t.snapshot.combineTargetFor&&i.a.createElement("div",{style:{backgroundColor:dt("menu"),padding:"7px 3px",color:"#FFFFFF",fontWeight:"bold",textAlign:"center"}},lt("$__dropHereToLink")),("insight"===u.type||"link"===u.type)&&u._createdBy&&c.users[u._createdBy]&&i.a.createElement("div",{style:{width:"calc(100% - 0px)",alignItems:"center",padding:"7px",display:"inline-flex",borderBottom:"solid 1px rgba(0,0,0,0.03)"}},i.a.createElement("div",{style:{position:"relative",float:"left"}},i.a.createElement(Qe.a,{title:c.users[u._createdBy].name},i.a.createElement(nn.a,{alt:c.users[u._createdBy].name,src:c.users[u._createdBy].image||null},c.users[u._createdBy].name.substr(0,1)))),i.a.createElement("div",{style:{position:"relative",float:"left",width:"calc(100% - 70px)",flexDirection:"column",paddingLeft:"7px"}},i.a.createElement("div",{style:{color:dt("menu"),fontWeight:"bold",fontSize:"16px"}},c.users[u._createdBy].displayName?c.users[u._createdBy].displayName:c.users[u._createdBy].name.split(" ")[0]),i.a.createElement("div",null,Ve()(new Date).tz("America/Sao_Paulo").format("DD/MM/YYYY")===Ve()(1e3*u.created_at).tz("America/Sao_Paulo").format("DD/MM/YYYY")?"".concat(Ve()(1e3*u.created_at).tz("America/Sao_Paulo").format("H:mm")):Ve()(new Date).tz("America/Sao_Paulo").format("YYYY")===Ve()(1e3*u.created_at).tz("America/Sao_Paulo").format("YYYY")?"".concat(Ve()(1e3*u.created_at).tz("America/Sao_Paulo").format("DD/MM H:mm")):"".concat(Ve()(1e3*u.created_at).tz("America/Sao_Paulo").format("DD/MM/YYYY H:mm")))),i.a.createElement("div",{style:{width:"24px",float:"right"}},i.a.createElement(kt,{icon:u.type&&c&&c.dataType&&c.dataType.filter((function(e){return e.name===u.type}))[0]&&c.dataType.filter((function(e){return e.name===u.type}))[0].icon||"$__topic"}))),i.a.createElement(Fa,{private:!(!u.private&&!u.parentPrivate),unlockedPrivates:t.unlockedPrivates,setPrivate:function(e){var r=e?1:-1;e||0!==t.unlockedPrivates||(r=0),t.reduxFunction("ASYNC","SET_CONTROL",Object(h.a)(Object(h.a)({},De.getState().controls),{},{unlockedPrivates:De.getState().controls.unlockedPrivates+r})),T(e),t.setPrivate&&t.setPrivate(e)},viewAllName:t.viewAllName,title:"".concat((null===u||void 0===u?void 0:u.name)||lt("$__new",1)," "),searchText:(null===t||void 0===t?void 0:t.searchText)||null,icon:(null===u||void 0===u?void 0:u.icon)||u.type&&c&&c.dataType&&c.dataType.filter((function(e){return e.name===u.type}))[0]&&c.dataType.filter((function(e){return e.name===u.type}))[0].icon||"$__topic",iconTitle:"$__".concat(u.type),color:dt("medium"),editable:!(u.name||t.onlyOption&&!t.editable),_id:u._id,locked:!("link"!==u.type&&!t.locked),colorPicker:je&&t.cardColorPicker&&D&&!D.parent?function(e){(!D.color&&e||D.color&&D.color!==e)&&t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},u._id,Object(h.a)(Object(h.a)({},De.getState().db.cards[u._id]),{},{color:e})))}))}:null,onEdit:"completed"!==u.status&&ge&&parseInt(ge)>1||me&&me.plan&&(me.owner||me.planAdmin||me.planEdit||me.planModerate)?function(e){t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},u._id,Object(h.a)(Object(h.a)({},De.getState().db.cards[u._id]),{},{name:e})))}))}:null,moreButton:k,options:u.deleted?[{name:lt("$__restoreThis",1),icon:"restore_from_trash",onClick:function(){we()},show:"hover",color:dt("medium")}]:t.onlyOption||t.showSelected||t.locked?[]:[u.url&&{name:"$__openLinkinNewTab",icon:"launch",onClick:function(){window.open(u.url,"_blank")}},!u.archived&&!u.isTemplate&&"plan"===u.type&&{name:u._isFavorite?"$__removeFromFavorite":"$__addToFavorite",icon:u._isFavorite?"favorite":"favorite_border",color:dt("medium"),onClick:function(){var e=Object(Me.a)(rc().mark((function e(){return rc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:_t(t,u._id,!!u._isFavorite),t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},u._id,Object(h.a)(Object(h.a)({},De.getState().db.cards[u._id]),{},{_isFavorite:!u._isFavorite})))}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},!u.archived&&"completed"!==u.status&&Le&&Le.button&&{name:Ve()(new Date(1e3*Le.date)).format("YYYY/MM/DD")===Ve()().format("YYYY/MM/DD")?"$__removeOfMyDate":"$__addOnMyDay",icon:Ve()(new Date(1e3*Le.date)).format("YYYY/MM/DD")===Ve()().format("YYYY/MM/DD")?"auto_delete":"alarm_add",color:Ve()(new Date(1e3*Le.date)).format("YYYY/MM/DD")===Ve()().format("YYYY/MM/DD")?"red":"lightblue",show:"hover",onClick:function(){var e=!(Le&&Le.date&&(!Le||!Le.date||Ve()(new Date(1e3*Le.date)).format("YYYY/MM/DD")===Ve()().format("YYYY/MM/DD")));Zn(t,{_id:u._id,userId:l._id,option:e}),t.myDayClick&&t.myDayClick()}},!u.archived&&!t.onlyOption&&(ge&&parseInt(ge)>1||me.owner||me.planAdmin||me.planEdit||me.planModerate)&&{name:"$__edit",icon:"edit",onClick:function(){t.onAction&&t.onAction(),ye()},show:"hover"},!u.archived&&!u.isTemplate&&u._users&&"completed"!==u.status&&u._users[l._id]&&(!u._kpiTimer||0===Object.keys(u._kpiTimer).length||u._kpiTimer&&Object.keys(u._kpiTimer).length>0&&0===Object.keys(u._kpiTimer).filter((function(e){return l&&l._id&&e&&u._kpiTimer[e]&&u._kpiTimer[e].userId&&u._kpiTimer[e].userId===l._id})).length)&&{name:"$__timerStart",icon:"play_circle_outline",color:"blue",show:"hover",onClick:function(){ft({message:lt("$__confirmStartTimer",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){$n(t,u._id),!(Le&&Le.date&&(!Le||!Le.date||Ve()(new Date(1e3*Le.date)).format("YYYY/MM/DD")===Ve()().format("YYYY/MM/DD")))&&Zn(t,{_id:u._id,userId:l._id,option:!0}),t.myDayClick&&t.myDayClick()}})}},u._users&&"completed"!==u.status&&u._users[l._id]&&{name:"$__complete",icon:"check_circle",color:"green",show:"hover",onClick:function(){var e=Object(Me.a)(rc().mark((function e(){return rc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:be();case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},!u.archived&&!t.onlyOption&&(t.selectOption||t.viewButton)&&(u.type.indexOf("guideline")>-1||u.type.indexOf("objective")>-1||u.type.indexOf("goal")>-1)&&{name:u._selected?"$__removeSelection":"$__selectThis",icon:u._selected?"visibility_off":"visibility",hide:!0,onClick:function(){ve()}},{name:"$__duplicate",icon:"content_copy",onClick:function(){B(!0),V(u.name)}},!u.isTemplate&&"plan"===u.type&&{name:"$__copyToTemplates",icon:"copy_all",onClick:function(){E(!0)}},u&&!u.isTemplate&&"plan"===u.type&&!u.archived&&(u._users&&u._users[l._id]&&u._users[l._id].access&&5===parseInt(u._users[l._id].access)||me&&me.planAdmin)&&{name:lt("$__shelve"),icon:"archive",onClick:function(){Gn(t,{_id:u._id,archived:!0})}},(ge&&5===parseInt(ge)||me.owner||me.planAdmin||me.planEdit)&&!t.disableDelete&&{name:"$__delete",icon:"delete_forever",color:"red",onClick:function(){t.directDeletion||u.archived||0===c.dataType.filter((function(e){return e.name===u.type})).length||c.dataType.filter((function(e){return e.name===u.type})).length>0&&"swot"===c.dataType.filter((function(e){return e.name===u.type}))[0].module?_e():ye("delete"),t.onAction&&t.onAction()},show:"hover"},u&&!u.isTemplate&&"plan"===u.type&&u.archived&&(u._users&&u._users[l._id]&&u._users[l._id].access&&parseInt(5===u._users[l._id])||me&&me.planAdmin)&&{name:lt("$__unarchive"),icon:"archive",onClick:function(){Gn(t,{_id:u._id,archived:null})}},!u.isTemplate&&!u.archived&&(t.my||t.showCompleteOption)&&{name:"$__completed"!==u.status?"$__markasdone":"$__concluded",icon:"check_circle_outline",color:"completed"!==u.status?"lightgray":"green",onClick:function(){var e=Object(Me.a)(rc().mark((function e(){return rc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:be();case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}],isExpanded:Oe,noExpanding:t.expanded||De.getState().db.cardsExpanded||!1,onExpanding:function(){t.onExpand&&t.onExpand(!Oe),t.expanded||De.getState().db.cardsExpanded||m((function(e){return!e}))},onClick:function(e){}}),u._kpiTimer&&Object.keys(u._kpiTimer).length>0&&0!==Object.keys(u._kpiTimer).filter((function(e){return u._kpiTimer[e].userId===l._id})).length&&i.a.createElement("div",{style:{position:"relative",width:"100%",float:"left"},onClick:function(e){e.stopPropagation()}},i.a.createElement(oi,{data:u})),Oe&&(!u.private||u.private&&(F||De.getState().controls.lockPrivate))?i.a.createElement(i.a.Fragment,null,i.a.createElement(Hi,Object.assign({},t,{private:!!u.private,expanded:!0,onClick:function(e){},Resume:!0})),i.a.createElement("div",null,t.searchText&&u.description&&i.a.createElement("div",{className:n.description},yt(u.description,t.searchText)))):Oe?i.a.createElement(i.a.Fragment,null,i.a.createElement(ui,null)):i.a.createElement(i.a.Fragment,null),u.isTemplate?i.a.createElement(i.a.Fragment,null):i.a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%"}},u.startDate&&Ve()(u.startDate).isValid()||u.endDate&&Ve()(u.endDate).isValid()?i.a.createElement("div",{style:Object(h.a)({position:"relative",display:"flex",width:"100%"},Oe?{height:"45px"}:{})},i.a.createElement("div",{className:u.endDate&&Ve()(new Date(1e3*u.endDate)).tz("America/Sao_Paulo").format("YYYY-MM-DD")<Ve()().format("YYYY-MM-DD")?n.lateDates:n.dates},u.startDate&&Ve()(u.startDate).isValid()&&i.a.createElement("div",{className:n.dateInfo},i.a.createElement(Qr,{overlap:"rectangular",className:n.dateIco,icon:"insert_invitation",title:"$__startDate",size:"14px",disabled:!0}),new Date(1e3*u.startDate)instanceof Date&&!isNaN(new Date(1e3*u.startDate))?Ve()(new Date(1e3*u.startDate)).tz("America/Sao_Paulo").format("DD/MM/YYYY"):Ve()(u.startDate).tz("America/Sao_Paulo").format("DD/MM/YYYY")),u.endDate&&Ve()(u.endDate).isValid()?i.a.createElement("div",{className:n.dateInfo},i.a.createElement(Qr,{overlap:"rectangular",className:n.dateIco,icon:"event_available",title:"$__endDate",size:"14px",disabled:!0}),new Date(1e3*u.endDate)instanceof Date&&!isNaN(new Date(1e3*u.endDate))?Ve()(new Date(1e3*u.endDate)).tz("America/Sao_Paulo").format("DD/MM/YYYY"):Ve()(u.endDate).tz("America/Sao_Paulo").format("DD/MM/YYYY")):i.a.createElement(i.a.Fragment,null))):i.a.createElement(i.a.Fragment,null)),u._tags&&u._tags.filter((function(e){return e.value})).length>0?i.a.createElement("div",{style:{marginBottom:33}},i.a.createElement(bn,{options:u._tags,expanded:!!(t.showTags||Oe&&"plan"!==u.type&&"link"!==u.type&&"insight"!==u.type)})):i.a.createElement(i.a.Fragment,null),u._recurrenceId&&i.a.createElement("div",{style:{position:"absolute",width:"100%",bottom:"3px",left:"3px",display:"flex",fontSize:"11px",color:"lightgrey",alignItems:"center"}},i.a.createElement(Qr,{overlap:"rectangular",className:n.indicatorsIcon,icon:"history",color:"lightgrey",size:"25px",title:t.noShowRecurrenceCard?"".concat(lt("$__recurrence")).concat(u.recurrenceCreatedDate?": ".concat(Ve()(u.recurrenceCreatedDate).format("DD/MM/YYYY")):""):i.a.createElement("div",{style:{maxWidth:"280px"}},lt("$__recurrentActivityFrom"),":",i.a.createElement(e,{db:"cards",data:c.cards[u._recurrenceId],Avatar:!0,ignoreList:!0,onlyOption:!0}))}),u.recurrenceCreatedDate?Ve()(u.recurrenceCreatedDate).format("DD/MM/YYYY"):""),Object.keys(u._users).length>0&&(!u._users[l._id]||u._users[l._id]&&Object.keys(u._users).length>1)?i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{width:"100%",marginTop:Oe?37:7}},i.a.createElement("div",{className:n.usersContent},i.a.createElement("div",{className:n.users},i.a.createElement(Wo,{_id:u._id,data:u,permission:je,transparent:!0,myDay:!0,limit:3})))),i.a.createElement("div",{style:{clear:"both"}})):i.a.createElement(i.a.Fragment,null)),u.isTemplate&&i.a.createElement("div",{style:{position:"relative",width:"100%",clear:"both",padding:"7px",backgroundColor:dt("menu"),marginTop:"7px",cursor:"pointer"},onClick:function(e){e.stopPropagation(),E(!0)}},i.a.createElement(rn,{text:lt("$__useThisTemplate","*"),icon:"auto_awesome",iconColor:"#FFFFFF",textColor:"#FFFFFF"})),!k&&"completed"===u.status&&i.a.createElement("div",{style:{backgroundColor:"rgba(0,0,0,0.4)",position:"absolute",height:"2px",left:0,right:0,top:"20px"}},i.a.createElement("div",{style:{position:"absolute",right:0,bottom:-12,color:"#FFF",fontSize:10,padding:3,backgroundColor:"rgba(0,0,0,0.66)"}},lt("$__completeDate"),":",Ot(u.completed_at||u.updated_at))),"plan"!==u.type&&u.deleted?i.a.createElement("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",cursor:"pointer"}},i.a.createElement("div",{style:{position:"absolute",backgroundColor:"#71389da6",top:0,left:0,right:0,bottom:0,paddingRight:7,display:"flex",alignItems:"center",cursor:"pointer",justifyContent:"right"}},i.a.createElement(At,{title:lt("$__restoreThis",1),text:lt("$__restoreThis",1),color:"#FFFFFF",icon:"restore_from_trash",onClick:function(){we()},size:"17px",textSize:"17px",transparent:!0}))):i.a.createElement(i.a.Fragment,null),i.a.createElement(i.a.Fragment,null),M||R?i.a.createElement(ii.a,{open:!0,onClose:function(){B(!1),B(!1)},"aria-labelledby":"simple-modal-title","aria-describedby":"simple-modal-description"},i.a.createElement(pn.a,{onClickAway:function(){B(!1)}},i.a.createElement("div",{style:{position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px",display:"flex",justifyContent:"center",alignItems:"center"},onClick:function(e){e.preventDefault(),e.stopPropagation()}},i.a.createElement("div",{style:{position:"relative",width:"400px",backgroundColor:"#FFFFFF",margin:"auto",boxShadow:"0px 0px 10px 3px rgba(0,0,0,0.2)"}},i.a.createElement("div",{style:{position:"relative",width:"400px",backgroundColor:"#FFFFFF",padding:"9px",height:"40px",margin:"auto",background:dt("ColumnTitleColor")}},i.a.createElement("div",{style:{fontSize:"14px",color:dt("color")}},lt("$__duplicate")),i.a.createElement("div",{style:{position:"absolute",right:5,top:5}},i.a.createElement(At,{id:"close_duplicate",title:lt("$__close","*"),color:dt("color"),icon:"close",onClick:function(){B(!1)},size:"25px",transparent:!0}))),i.a.createElement("div",{style:{position:"relative",padding:"9px"}},ne?i.a.createElement("div",{style:{position:"relative",float:"left",width:"370px",marginBottom:"15px"}},i.a.createElement(zo,{onSelect:function(e){ee(e)},ignoreTypes:["chatGroup"]})):i.a.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},i.a.createElement(At,{title:lt("$__selectTarget",1),text:lt("$__selectTarget",1),color:dt("menu"),icon:"assistant_navigation",onClick:function(){ae(!0)},size:"14px",textSize:"14px"})),i.a.createElement("div",{style:{position:"relative",width:"100%",display:"grid"}},R?i.a.createElement(i.a.Fragment,null,Q&&Q.type&&Ce.indexOf(Q.type)>-1&&(Q.type.indexOf(u.type)>-1||u.type.indexOf(Q.type)>-1)?i.a.createElement("div",{style:{color:"red",fontSize:12,marginBottom:15,textTransform:"uppercase",textAlign:"center"}},lt("$__youAreMove"),": ",lt("$__".concat(Q.type))," ",lt("$__for"),": ",lt("$__".concat(Q.type)),".",lt("$__thisWillBeTurnedIntoAnActivity")):i.a.createElement(i.a.Fragment,null)):i.a.createElement(i.a.Fragment,null,Q&&Q.type&&Ce.indexOf(Q.type)>-1&&(Q.type.indexOf(u.type)>-1||u.type.indexOf(Q.type)>-1)?i.a.createElement("div",{style:{color:"red",fontSize:12,marginBottom:15,textTransform:"uppercase",textAlign:"center"}},lt("$__youAreDuplicating"),": ",lt("$__".concat(Q.type))," ",lt("$__for"),": ",lt("$__".concat(Q.type)),".",lt("$__thisWillBeTurnedIntoAnActivity")):i.a.createElement(i.a.Fragment,null),i.a.createElement(La,{label:lt("$__copyAs",1),variant:dt("fieldVariant"),name:"copyAs",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"clear",onClick:function(){V(u.name)}})),onChange:function(e){V(e.target.value)}},value:U,placeholder:lt("$__copyAs_placeholder",1)})),ce?i.a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:40}},i.a.createElement(Fo,null)):i.a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:40}},i.a.createElement(At,{title:lt("$__cancel",1),text:lt("$__cancel",1),color:"lightgray",icon:"cancel",onClick:function(){B(!1),B(!1)},size:"12px",textSize:"12px"}),M?i.a.createElement(At,{title:lt("$__duplicateAllLinkedItems",1),text:lt("$__duplicateAllLinkedItems",1),color:dt("menu"),icon:"dynamic_feed",onClick:function(){Se(!0)},size:"12px",textSize:"12px",transparent:!0}):i.a.createElement(At,{title:lt("$__confirmMoveCard",1),text:lt("$__confirmMoveCard",1),color:dt("menu"),icon:"dynamic_feed",onClick:function(){ke(!0)},size:"12px",textSize:"12px",transparent:!0})))))))):i.a.createElement(i.a.Fragment,null),i.a.createElement("div",{style:{clear:"both"}}))})),ic=Object(Ze.a)((function(e){return{badge:{backgroundColor:"#44b700",color:"#44b700",boxShadow:"0 0 0 2px ".concat(e.palette.background.paper),"&::after":{position:"absolute",top:0,left:0,width:"100%",height:"100%",borderRadius:"50%",animation:"$ripple 1.2s infinite ease-in-out",border:"1px solid currentColor",content:'""'}},"@keyframes ripple":{"0%":{transform:"scale(.8)",opacity:1},"100%":{transform:"scale(2.4)",opacity:0}}}}))(Pt.a),cc=Object(Ze.a)((function(e){return{badge:{backgroundColor:"#ffb100",color:"#ffb100",boxShadow:"0 0 0 2px ".concat(e.palette.background.paper),"&::after":{position:"absolute",top:0,left:0,width:"100%",height:"100%",borderRadius:"50%",animation:"$ripple 1.2s infinite ease-in-out",border:"1px solid currentColor",content:'""'}},"@keyframes ripple":{"0%":{transform:"scale(.8)",opacity:1},"100%":{transform:"scale(2.4)",opacity:0}}}}))(Pt.a),lc=Object(Lt.a)((function(e){return{root:{display:"flex","& > *":{margin:e.spacing(1)}}}}));var sc=Object($e.b)((function(e,t){return{status:e.usersStatus&&e.usersStatus.users&&e.usersStatus.users[t.userId]&&e.usersStatus.users[t.userId].status?e.usersStatus.users[t.userId].status:null}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=lc(),r=i.a.useState(e.status),n=Object(Be.a)(r,2),a=n[0],o=n[1],c=i.a.useState(e.userId),l=Object(Be.a)(c,2);return l[0],l[1],i.a.useEffect((function(){return e.status!==a&&o(e.status),function(){}}),[e.status]),i.a.createElement("div",{className:t.root},e.status&&"online"!==e.status?i.a.createElement(cc,{overlap:"circular",anchorOrigin:e.anchorOrigin?e.anchorOrigin:{vertical:"bottom",horizontal:"left"},variant:e.status?"dot":"standard"},e.children):i.a.createElement(ic,{overlap:"circular",anchorOrigin:e.anchorOrigin?e.anchorOrigin:{vertical:"bottom",horizontal:"left"},variant:e.status?"dot":"standard"},e.children))})),uc=function(e){return{root:{position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px",overflowY:"auto"},content:{position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px",overflowY:"auto",backgroundColor:"rgba(249,249,249,1)"},timeline:{listStyle:"none",padding:"0",position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px",display:"flex",width:"100%","& .file-drop-target":{width:"100%"}},scrollEnd:{marginTop:"160px",position:"relative",width:"100%",height:"0px",marginBottom:"-100px"},scrollEndNoEditor:{marginTop:"30px",position:"relative",width:"100%",height:"0px",marginBottom:"-100px"},timelineSimple:{position:"relative",overflow:"hidden",marginTop:"0px",padding:"0",width:"-webkit-fill-available","&:before":{left:"15px"}},timelineSimpleWithHeader:{position:"relative",overflowX:"auto",marginTop:"60px",padding:"0 0 0",width:"-webkit-fill-available","&:before":{left:"15px"}},item:{marginBottom:"15px",paddingBottom:"33px",position:"relative",paddingLeft:"15px",width:"calc(100% - 15px)","&:before,&:after":{content:'" "',display:"table"},"&:after":{clear:"both"}},timelineBadge:{color:"#FFF",width:"30px",height:"30px",lineHeight:"25px",fontSize:"12px",textAlign:"center",position:"absolute",bottom:"23px",left:"50%",marginLeft:"-7px",zIndex:"1",borderTopRightRadius:"50%",borderTopLeftRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"},timelineSimpleBadge:{left:"7px"},timelineBadgeInverted:{color:"#FFF",width:"30px",height:"30px",lineHeight:"25px",fontSize:"12px",textAlign:"center",position:"absolute",bottom:"23px",right:"50%",marginRight:"-7px",zIndex:"1",borderTopRightRadius:"50%",borderTopLeftRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"},timelineSimpleBadgeInverted:{right:"7px"},custom:{backgroundColor:dt("color"),boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt("#000")+", 0.4)"},info:{backgroundColor:cr[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(cr[0])+", 0.4)"},success:{backgroundColor:ir[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(ir[0])+", 0.4)"},danger:{backgroundColor:or[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(or[0])+", 0.4)"},warning:{backgroundColor:ar[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(ar[0])+", 0.4)"},primary:{backgroundColor:nr[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(nr[0])+", 0.4)"},badgeIcon:{width:"14px",height:"14px"},timelinePanel:{maxWidth:"calc(100% - 70px)",float:"right",padding:"7px",marginBottom:"5px",marginRight:"40px",position:"relative",boxShadow:"0 1px 4px 0 rgba("+Zt("#000")+", 0.14)",borderRadius:"6px",color:"rgba("+Zt("#000")+", 0.87)",background:dt("timelineMyMessage")},timelinePanelInverted:{maxWidth:"calc(100% - 70px)",float:"left",padding:"7px",marginLeft:"40px",marginBottom:"5px",position:"relative",boxShadow:"0 1px 4px 0 rgba("+Zt("#000")+", 0.14)",borderRadius:"6px",color:"rgba("+Zt("#000")+", 0.87)",background:"#ffffff"},timelineHeading:{marginBottom:"0px",display:"flex",alignItems:"center"},timelineDate:{display:"flex",alignItems:"center",padding:"5px",backgroundColor:"#CCCCCC"},timelineBody:{overflowWrap:"anywhere",fontSize:"12px",lineHeight:"21px",position:"relative",width:"100%",float:"left"},timelineLog:{fontSize:"12px",lineHeight:"21px"},timelineFooter:{zIndex:"1",position:"relative",float:"left",width:"100%",display:"inline-flex",justifyContent:"space-between"},footerUser:{display:"flex",alignItems:"center",fontSize:"12px",fontWeight:"bold",color:dt("medium"),padding:"0 7px"},footerLine:{position:"relative",marginTop:"10px",marginBottom:"5px"},dropFile:{display:"none"},onDropFile:{position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px",display:"flex",alignItems:"center",justifyContent:"center",color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.77)",zIndex:1},editor:Object(O.a)({position:"absolute",bottom:"0px",padding:"10px",height:"auto",width:"calc(100% - 0px)",zIndex:10},"padding","7px"),files:{display:"inline-table",position:"relative"},textEditorIcon:{cursor:"pointer",color:dt("color")},progressBar:{backgroundColor:"".concat(dt("color","0.1")," !important"),"& .MuiLinearProgress-indeterminate":{backgroundColor:"".concat(dt("color")," !important")},"& .MuiLinearProgress-bar":{backgroundColor:"".concat(dt("color")," !important")}},actionButton:{alignItems:"center",cursor:"pointer",float:"left",height:"30px",position:"relative",textAlign:"center",width:"30px"},sendingMessage:{width:"100%"},valuePositive:{positive:"relative",float:"left",color:"blue"},valueNegative:{positive:"relative",float:"left",color:"red"},lastValue:{positive:"relative",float:"right",color:"grey"},timeInfo:{display:"flex",alignItems:"center",color:"grey",width:"100%",position:"relative",float:"left",marginBottom:"7px","& .text":{marginLeft:"7px"}},urlPreview:{position:"relative",float:"left",marginBottom:"33px","& img":{maxWidth:"20%",minWidth:"177px",height:"auto",marginTop:"30px",marginRight:"7px"},"& .data":{"& .title":{fontSize:"16px",fontWeight:"bold"},"& .siteName":{fontSize:"14px",fontWeight:"bold",color:"#909090"},"& .contentSnippet":{fontSize:"12px",color:"#909090"}}},users:{position:"relative",bottom:"0px",right:"2px",fontSize:"10px","& .MuiAvatarGroup-root":{justifyContent:"flex-end"},"& .MuiAvatar-root":{width:"25px",height:"25px",fontSize:"10px"}}}},dc=r(567),pc=r.n(dc),fc=r(568),hc=r.n(fc),mc=r(569),gc=r.n(mc),vc=r(984),yc=r.n(vc),bc=r(570),xc=r.n(bc),_c=r(1801),wc=function(e){return{popperClose:{pointerEvents:"none",display:"none !important"},popperNav:Object(O.a)({},e.breakpoints.down("sm"),{position:"static !important",left:"unset !important",top:"unset !important",transform:"none !important",willChange:"unset !important","& > div":{boxShadow:"none !important",marginLeft:"0rem",marginRight:"0rem",transition:"none !important",marginTop:"0px !important",marginBottom:"0px !important",padding:"0px !important",backgroundColor:"transparent !important","& ul li":{color:"#FFF !important",margin:"10px 15px 0!important",padding:"10px 15px !important","&:hover":{backgroundColor:"hsla(0,0%,78%,.2)",boxShadow:"none"}}}}),manager:{"& > div > button:first-child > span:first-child, & > div > a:first-child > span:first-child":{width:"100%"}},innerManager:{"& > div > button,& > div > a":{margin:"0px !important",color:"inherit !important",padding:"10px 20px !important","& > span:first-child":{width:"100%",justifyContent:"flex-start"}}},target:{"& > button:first-child > span:first-child, & > a:first-child > span:first-child":{display:"inline-block"},"& $caret":{marginLeft:"0px"}},dropdown:{borderRadius:"3px",border:"0",boxShadow:"0 2px 5px 0 rgba("+Zt("#000")+", 0.26)",top:"100%",zIndex:"1000",minWidth:"160px",padding:"5px 0",margin:"2px 0 0",fontSize:"12px",textAlign:"left",listStyle:"none",backgroundColor:"#FFF",backgroundClip:"padding-box"},menuList:{padding:"0"},popperResponsive:Object(O.a)({zIndex:"1200"},e.breakpoints.down("sm"),{zIndex:"1640",position:"static",float:"none",width:"auto",marginTop:"0",backgroundColor:"transparent",border:"0",boxShadow:"none",color:"black"}),dropdownItem:Object(h.a)(Object(h.a)({},rr),{},{fontSize:"13px",padding:"10px 20px",margin:"0 5px",borderRadius:"2px",position:"relative",transition:"all 150ms linear",display:"block",clear:"both",fontWeight:"400",height:"100%",color:sr[7],whiteSpace:"nowrap",minHeight:"unset"}),darkHover:{"&:hover":{boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(sr[16])+", 0.4)",backgroundColor:sr[16],color:"#FFF"}},primaryHover:{"&:hover":Object(h.a)({backgroundColor:nr[0],color:"#FFF"},dr)},infoHover:{"&:hover":Object(h.a)({backgroundColor:cr[0],color:"#FFF"},pr)},successHover:{"&:hover":Object(h.a)({backgroundColor:ir[0],color:"#FFF"},fr)},warningHover:{"&:hover":Object(h.a)({backgroundColor:ar[0],color:"#FFF"},hr)},dangerHover:{"&:hover":Object(h.a)({backgroundColor:or[0],color:"#FFF"},mr)},roseHover:{"&:hover":Object(h.a)({backgroundColor:lr[0],color:"#FFF"},gr)},dropdownItemRTL:{textAlign:"right"},dropdownDividerItem:{margin:"5px 0",backgroundColor:"rgba("+Zt("#000")+", 0.12)",height:"1px",overflow:"hidden"},buttonIcon:{width:"20px",height:"20px"},caret:{transition:"all 150ms ease-in",display:"inline-block",width:"0",height:"0",marginLeft:"4px",verticalAlign:"middle",borderTop:"4px solid",borderRight:"4px solid transparent",borderLeft:"4px solid transparent"},caretActive:{transform:"rotate(180deg)"},caretDropup:{transform:"rotate(180deg)"},caretRTL:{marginRight:"4px"},dropdownHeader:{display:"block",padding:"0.1875rem 1.25rem",fontSize:"0.75rem",lineHeight:"1.428571",color:sr[1],whiteSpace:"nowrap",fontWeight:"inherit",marginTop:"10px",minHeight:"unset","&:hover,&:focus":{backgroundColor:"transparent",cursor:"auto"}},noLiPadding:{padding:"0"}}},Ec=Object(Lt.a)(wc);function Oc(e){var t,r,n,a=i.a.useState(null),o=Object(Be.a)(a,2),c=o[0],l=o[1],s=Ec(),u=function(e){c.contains(e.target)||l(null)},d=function(t){l(null),e&&e.onClick&&e.onClick(t)},p=e.buttonText,f=e.buttonIcon,h=e.dropdownList,m=e.buttonProps,g=e.dropup,v=e.dropdownHeader,y=e.caret,b=e.hoverColor,x=e.dropPlacement,_=e.rtlActive,w=e.noLiPadding,E=e.innerDropDown,j=e.navDropdown,S=We()((t={},Object(O.a)(t,s.caret,!0),Object(O.a)(t,s.caretDropup,g&&!c),Object(O.a)(t,s.caretActive,Boolean(c)&&!g),Object(O.a)(t,s.caretRTL,_),t)),k=We()((r={},Object(O.a)(r,s.dropdownItem,!0),Object(O.a)(r,s[b+"Hover"],!0),Object(O.a)(r,s.noLiPadding,w),Object(O.a)(r,s.dropdownItemRTL,_),r)),L=i.a.createElement(_n.a,{role:"menu",className:s.menuList},void 0!==v?i.a.createElement(xn.a,{onClick:function(){return d(v)},className:s.dropdownHeader},v):null,h.map((function(e,t){return e.divider?i.a.createElement(_c.a,{key:t,onClick:function(){return d("divider")},className:s.dropdownDividerItem}):void 0!==e.props&&"multi"===e.props["data-ref"]?i.a.createElement(xn.a,{key:t,className:k,style:{overflow:"visible",padding:0}},e):i.a.createElement(xn.a,{key:t,onClick:function(){return d(e)},className:k},e)})));return i.a.createElement("div",{className:E?s.innerManager:s.manager},i.a.createElement("div",{className:void 0!==p?"":s.target},i.a.createElement(Cr,Object.assign({"aria-label":"Notifications","aria-owns":c?"menu-list":null,"aria-haspopup":"true"},m,{onClick:function(e){c&&c.contains(e.target)?l(null):l(e.currentTarget)}}),void 0!==f?i.a.createElement(e.buttonIcon,{className:s.buttonIcon}):null,void 0!==p?p:null,y?i.a.createElement("b",{className:S}):null)),i.a.createElement(mn.a,{open:Boolean(c),anchorEl:c,transition:!0,disablePortal:!0,placement:x,className:We()((n={},Object(O.a)(n,s.popperClose,!c),Object(O.a)(n,s.popperResponsive,!0),Object(O.a)(n,s.popperNav,Boolean(c)&&j),n))},(function(){return i.a.createElement(fn.a,{in:Boolean(c),id:"menu-list",style:g?{transformOrigin:"0 100% 0"}:{transformOrigin:"0 0 0"}},i.a.createElement(hn.a,{className:s.dropdown},E?L:i.a.createElement(pn.a,{onClickAway:u},L)))})))}Oc.defaultProps={caret:!0,dropup:!1,hoverColor:"primary"};pc.a,hc.a,gc.a,xc.a,pc.a,hc.a,gc.a,xc.a;var jc=[{inverted:!0,badgeColor:"danger",badgeIcon:pc.a,title:"Some Title",titleColor:"danger",body:i.a.createElement("p",null,"Wifey made the best Father","'","s Day meal ever. So thankful so happy so blessed. Thank you for making my family We just had fun with the \u201cfuture\u201d theme !!! It was a fun night all together ... The always rude Kanye Show at 2am Sold Out Famous viewing @ Figueroa and 12th in downtown."),footerTitle:"11 hours ago via Twitter"},{badgeColor:"success",badgeIcon:hc.a,title:"Another One",titleColor:"success",body:i.a.createElement("p",null,"Thank God for the support of my wife and real friends. I also wanted to point out that it\u2019s the first album to go number 1 off of streaming!!! I love you Ellen and also my number one design rule of anything I do from shoes to music to homes is that Kim has to like it....")},{inverted:!0,badgeColor:"info",badgeIcon:gc.a,title:"Another Title",titleColor:"info",body:i.a.createElement("div",null,i.a.createElement("p",null,"Called I Miss the Old Kanye That\u2019s all it was Kanye And I love you like Kanye loves Kanye Famous viewing @ Figueroa and 12th in downtown LA 11:10PM"),i.a.createElement("p",null,"What if Kanye made a song about Kanye Roy\xe8re doesn","'","t make a Polar bear bed but the Polar bear couch is my favorite piece of furniture we own It wasn\u2019t any Kanyes Set on his goals Kanye")),footer:i.a.createElement(Oc,{buttonIcon:xc.a,buttonProps:{round:!0,style:{marginBottom:"0"},color:"info"},dropdownList:["Action","Another action","Something else here",{divider:!0},"Separated link"]})},{badgeColor:"warning",badgeIcon:yc.a,title:"Another One",titleColor:"warning",body:i.a.createElement("p",null,"Tune into Big Boy","'","s 92.3 I","'","m about to play the first single from Cruel Winter also to Kim\u2019s hair and makeup Lorraine jewelry and the whole style squad at Balmain and the Yeezy team. Thank you Anna for the invite thank you to the whole Vogue team")}],Sc=new Date,kc=Sc.getFullYear(),Lc=Sc.getMonth(),Cc=Sc.getDate(),Ic=(new Date(kc,Lc,1),new Date(kc,Lc,1),new Date(kc,Lc,Cc-1,10,30),new Date(kc,Lc,Cc-1,11,30),new Date(kc,Lc,Cc+7,12,0),new Date(kc,Lc,Cc+7,14,0),new Date(kc,Lc,Cc-2),new Date(kc,Lc,Cc-2),new Date(kc,Lc,Cc+1,19,0),new Date(kc,Lc,Cc+1,22,30),new Date(kc,Lc,21),new Date(kc,Lc,22),new Date(kc,Lc,21),new Date(kc,Lc,22),Object(Lt.a)(uc)),Fc=Object($e.b)((function(){return{}}),(function(e){return Object(u.b)(n,e)}))(Object(o.memo)((function(e){var t=Ic(),r=De.getState(),n=r.db,a=r.session,c=r.functions,l=r.timeline,s=c.socket,u=i.a.useState(!1),d=Object(Be.a)(u,2),p=d[0],f=d[1],m=i.a.useState(!1),g=Object(Be.a)(m,2),v=g[0],y=g[1],b=i.a.useState(null),x=Object(Be.a)(b,2),_=x[0],w=x[1],E=i.a.useState(null),j=Object(Be.a)(E,2),S=j[0],k=j[1],L=i.a.useState(!1),C=Object(Be.a)(L,2),I=C[0],F=C[1],T=i.a.useState(!1),N=Object(Be.a)(T,2),P=N[0],D=N[1],A=i.a.useState(null),$=Object(Be.a)(A,2),z=$[0],M=$[1],B=e.storie,Y=Object(o.useRef)();Object(o.useEffect)((function(){if(Y.current&&e.onResize){var t=Y.current.clientHeight;e.separator&&(t+=50),e.onResize(t),Y.current.addEventListener("DOMNodeInserted",(function(){e.onResize(t)}))}}),[Y]);var G=null;if(B&&B._parent&&n.cards[B._parent]?B._parent:B&&B.idRel&&n.cards[B.idRel]&&B.idRel,B.filesCount&&B.filesCount>0&&jc.user&&jc.user._id&&jc.user._id!==a._id&&(!jc.files||jc.files&&jc.files.length<B.filesCount))return i.a.createElement(i.a.Fragment,null);var R=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];y(!0),e&&clearTimeout(G)},H=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;G=setTimeout((function(){y(!1)}),e)},W=function(t){var r=e.storie.idRel?e.storie.idRel:e.storie._parent?e.storie._parent:e.nodeId?e.nodeId:null,n={chatId:De.getState().chat.id,react:t,user:a._id,db:e.db,nodeId:r,message:e.storie._id};lo(e,n),s.emit("data",{module:"timeline",method:"post",action:"interact"},n)};if(!B)return null;var U="";"timer"===B.type&&String(B.ini)&&String(B.fin)&&(U=B.fin-B.ini);var V=null;B.urlPreview&&(V=JSON.parse(B.urlPreview));var q,X=lt(function(e){var t,r;if(B&&B._parent&&n.cards[B._parent]?t=B._parent:B&&B.idRel&&n.cards[B.idRel]&&(t=B.idRel),r=e,e){var a=e.split("@[");a.length>0&&a.map((function(e){if(e){var a="@[".concat(e.split(")")[0],")"),o=e.split("](")[1];if(o)if((o=o.split(")")[0])&&36===o.length&&n.cards[t]&&n.cards[t]._users&&n.cards[t]._users[o]){var i=n.cards[t]._users&&n.cards[t]._users[o]&&n.cards[t]._users[o].name||n.cards[t]._users&&n.cards[t]._users[o]&&n.cards[t]._users[o].name?n.cards[t]._users[o].name:e.split("](")[0];r=r.replace(a,'<span style="color:'.concat(dt("menu"),'"><b>').concat(i,"</b></span>"))}else if(o&&36===o.length&&n.users[o]){var c=n.users[o]&&n.users[o].name?n.users[o].name:e.split("](")[0];r=r.replace(a,'<span style="color:'.concat(dt("menu"),'"><b>').concat(c,"</b></span>"))}else{var l=e.split("](")[0];r=r.replace(a,'<span style="color:'.concat(dt("menu"),'"><b>').concat(l,"</b></span>"))}}return!0}))}return r}(B.message));B._reactions&&Object.keys(B._reactions).length>0&&Object.keys(B._reactions).map((function(e){Object.keys(B._reactions[e]).length>0&&Object.keys(B._reactions[e]).map((function(t){t===a._id&&(q=e)}))}));var J=!1;e.storie&&e.storie.user&&e.storie.user._id===a._id&&(J=!0);var K=function(){ft({message:lt("$__confirmCancel",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){fo(e,{id:B._id,idRel:B.idRel,deletedReason:_,deleted:!0}),B.deleted=!0,k(!1),w(null)}})};if(!B.filesCount&&""===B.message&&B.cardId&&B.cardId!==e.nodeId&&!De.getState().db.cards[B.cardId])return null;var Z=function(t){var r=t.name.split("."),a=r[r.length-1],o="attachment";n.fileExtensions.filter((function(e){return e.ext.indexOf(a.toLowerCase())>-1})).length>0&&(o=n.fileExtensions.filter((function(e){return e.ext.indexOf(a.toLowerCase())>-1}))[0].icon||"https://fl.machen.ai/?arq=".concat(t.file.replace("&","||MCH-ECOM||"),"&name=").concat(t.name.replace("&","||MCH-ECOM||")));var c="img";return n.fileExtensions.filter((function(e){return e.ext.indexOf(a.toLowerCase())>-1})).length>0&&n.fileExtensions.filter((function(e){return e.ext.indexOf(a.toLowerCase())>-1}))[0].viewer&&(c=n.fileExtensions.filter((function(e){return e.ext.indexOf(a.toLowerCase())>-1}))[0].viewer),i.a.createElement("div",{key:t._id,style:Object(h.a)({position:"relative",display:"flex",marginBottom:"5px",whiteSpace:"nowrap",textOverflow:"ellipsis",cursor:"pointer",overflow:"hidden",padding:"7px",zIndex:"10 !important",borderRadius:"15px",alignItems:"center",justifyContent:"center"},"audio"===c?{width:"350px",height:"50px"}:"movie"===c?{width:"350px",height:"280px"}:{width:"150px",height:"150px"}),onClick:function(r){e.openLightBox&&e.openLightBox(t._id),r.preventDefault()},title:t.name},("img"===c||"movie"!==c&&"audio"!==c&&"string"===typeof o&&-1===o.indexOf("blob:")&&-1===o.indexOf("svg")||"movie"!==c&&"audio"!==c&&!("img"===c&&o&&o.indexOf("svg")>-1))&&i.a.createElement(Qe.a,{title:t.name},i.a.createElement("div",{style:{position:"absolute",bottom:"7px",left:"7px",right:"7px",padding:"3px",background:"rgba(0,0,0,0.8)",color:"#FFFFFF",borderRadius:"0px 0px 15px 15px",overflow:"hidden",textOverflow:"ellipsis"}},t.name)),"img"===c&&"attachment"===o&&i.a.createElement(kt,{icon:o,size:"50px"}),"img"===c&&"string"===typeof o&&o.indexOf("https")>-1&&-1===o.indexOf("svg")&&i.a.createElement("img",{src:"".concat(o),style:{borderRadius:"15px",boxShadow:"0 1px 2px 2px rgba(0,0,0,0.1)",maxWidth:"100%",height:"100%",maxHeight:"33vh"},onError:function(e){B.created_at&&"string"===typeof B.created_at&&parseInt(B.created_at)>Ve()().unix("X")-60&&(e.target.src=o)}}),"movie"!==c&&"img"!==c&&"string"===typeof o&&-1===o.indexOf("blob:")&&-1===o.indexOf("svg")?i.a.createElement(kt,{icon:o,size:"50px"}):"movie"===c||"img"===c||"img"===c&&o&&o.indexOf("svg")>-1?i.a.createElement(i.a.Fragment,null):i.a.createElement("img",{src:o,style:{width:"100%",height:"100%"}}),"img"===c&&o&&o.indexOf(".svg")>-1?i.a.createElement("img",{src:Rr.a,style:{borderRadius:"15px",boxShadow:"0 1px 2px 2px rgba(0,0,0,0.1)",maxWidth:"100%",height:"100%",maxHeight:"33vh"}}):i.a.createElement(i.a.Fragment,null),"movie"===c&&i.a.createElement("video",{style:{width:"100%"},controlsList:"nodownload",src:"https://machen.azureedge.net/".concat(t.file)}),"audio"===c&&i.a.createElement(Mr.a,{src:"https://machen.azureedge.net/".concat(t.file),controls:!0}),i.a.createElement("div",{style:{clear:"both"}}))};return i.a.createElement("div",{style:Object(h.a)(Object(h.a)({maxWidth:"calc(100% - 15px)",marginLeft:"7px"},e.messageClick?{cursor:"pointer"}:{}),e.boxStyle?e.boxStyle:{}),onClick:e.messageClick?function(t){e.messageClick(),t.preventDefault()}:null,ref:Y},i.a.createElement("div",{className:"message",style:Object(h.a)(Object(h.a)({position:"relative",maxWidth:"calc(88% - 15px)",float:J?"right":"left"},J?{marginRight:"15px"}:{marginLeft:"15px"}),{},{width:"auto",minWidth:"303px",marginBottom:"20px"}),onMouseLeave:function(){H(1e3)},onMouseOver:function(){e.isReply||R(!0)},onClick:function(){e.isReply||R(!0)}},e.showUserName&&!J&&i.a.createElement("div",{style:{position:"relative",width:"100%",fontWeight:"bold",fontSize:"12px",color:dt("menu")}},B.user.name?B.user.name:B.user.fullName),i.a.createElement("div",{style:{position:"relative",float:J?"right":"left",padding:"7px 15px",width:"100%",background:J?"linear-gradient(33deg, rgba(237, 237, 237, 1), rgba(196, 196, 196, 1))":"linear-gradient(33deg, rgba(250, 250, 250, 1), rgba(240,240,240, 1))",borderRadius:"15px",boxShadow:"rgb(0 0 0 / 5%) 0px 2px 2px 2px"}},B&&B.filesCount&&B&&B.user&&B.user._id===a._id&&parseInt(B.filesCount)>0&&B.files&&0===Object.keys(B.files).length?i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{position:"relative",justifyContent:"center",alignItems:"center",color:"lightgray"}},lt("$__transferringFile".concat(parseInt(B.filesCount)>1?"s":""))),i.a.createElement("div",{className:"files",style:{position:"relative",maxWidth:"calc(100% - 15px)",width:"100%",display:"flex"}},(parseInt(B.created_at),Ve()().unix("x"),i.a.createElement(i.a.Fragment,null)))):i.a.createElement(i.a.Fragment,null),B.files&&Object.keys(B.files).length>0?i.a.createElement("div",{className:"files",style:Object(h.a)(Object(h.a)({position:"relative",maxWidth:"calc(100% - 15px)",float:J?"right":"left"},J?{marginRight:"15px"}:{marginLeft:"15px"}),{},{width:"100%",display:"flex",justifyContent:J?"flex-end":"none",flexWrap:"wrap"})},Object.keys(B.files).map((function(e,t){return Z(B.files[e])}))):B.files&&B.files.length>0?i.a.createElement("div",{className:"files",style:Object(h.a)(Object(h.a)({position:"relative",maxWidth:"calc(100% - 15px)",float:J?"right":"left"},J?{marginRight:"15px"}:{marginLeft:"15px"}),{},{width:"100%",display:"flex",justifyContent:J?"flex-end":"none",flexWrap:"wrap"})},B.files.map((function(e,t){return Z(e)}))):i.a.createElement(i.a.Fragment,null),!e.isReply&&e.storie&&e.storie.reply&&l&&(l[e.nodeId]&&l[e.nodeId][e.storie.reply]||l[a._id]&&l[a._id][e.storie.reply])&&i.a.createElement("div",{style:{position:"relative",width:"calc(100% - 20px)",opacity:.66,display:"flex",justifyContent:"center",marginBottom:"7px"}},i.a.createElement(Fc,{isReply:!0,storie:l[e.nodeId]&&l[e.nodeId][e.storie.reply]?l[e.nodeId][e.storie.reply]:l[a._id][e.storie.reply],db:e.db,nodeId:e.nodeId,openLightBox:function(t){e.openLightBox&&e.openLightBox(t)},messageClick:function(){e.replyClick&&e.replyClick()}})),B.deleted&&"timer"!==B.type?i.a.createElement("div",{style:{color:"lightGray",height:33,padding:7}},lt("$__removed","*"),"*"):function(){if("comment"===B.type&&B.message)return i.a.createElement("div",null,B.urlPreview&&V.img&&V.title&&V.contentSnippet?i.a.createElement(vo,{style:{marginBottom:15}},!p&&V.img&&i.a.createElement(xo,{xs:12,sm:6,md:4,lg:3,xl:2},i.a.createElement("img",{style:{width:"-webkit-fill-available"},src:"".concat(V.img),onError:function(e){f(!0)},alt:V.title||V.link})),i.a.createElement(xo,{xs:12,sm:6,md:8,lg:9,xl:10},i.a.createElement("div",{style:{fontSize:"14px",color:dt("menu"),fontWeight:"bold"}},V.title),V.site&&i.a.createElement("div",{style:{fontSize:"12px"}},V.site),V.contentSnippet&&i.a.createElement("div",{style:{fontSize:"12px",color:"gray"}},V.contentSnippet),i.a.createElement("a",{style:{marginTop:"15px",fontWeight:"bold",fontSize:"12px"},href:V.link,target:"_blank"},lt("$__openLink","*")))):i.a.createElement(i.a.Fragment,null),i.a.createElement(xo,{xs:12,sm:12,md:12,lg:12,xl:12},yt(bt(X),e.searchText)),i.a.createElement("div",{style:{clear:"both"}}));if("comment"===B.type&&!B.message&&B.cardId!==e.nodeId&&De.getState().db.cards[B.cardId])return i.a.createElement(oc,{db:"cards",data:De.getState().db.cards[B.cardId],Avatar:!0,expanded:!0,ignoreList:!0});if("log"===B.type){var r={};return"$__updated"===B.message?(r=JSON.parse(B.newData),i.a.createElement("div",null,i.a.createElement("div",{style:{position:"relative",width:"100%",display:"flex"}},i.a.createElement(kt,{color:"color",icon:"history",style:{marginRight:"10px"}}),B.message.indexOf("$__")>-1?lt(B.message,1):B.message," "),B.newData&&i.a.createElement("ul",{style:{position:"relative",width:"98%"}},Object.keys(r).map((function(t,a){if("icon"===t)return i.a.createElement("li",{key:a,style:{display:"flex"}},lt("$__icon",1),":",i.a.createElement(kt,{icon:r[t],color:dt("color"),size:"17px"}));if("customColumns"===t){var o=JSON.parse(r[t]);return i.a.createElement("li",{key:a},lt("$__customColumns",1),":",i.a.createElement("ul",null,Object.keys(o).map((function(e,t){return i.a.createElement("li",{key:t},lt("$__".concat(e)),"=>"," ",i.a.createElement("span",{style:{color:dt("menu"),fontWeight:"bold"}},lt("".concat(o[e].name))))}))))}if("_id"===t||"id"===t||"client"===t||"planId"===t||"_parent"===t||"owner"===t||"image"===t);else{if("status"===t)return i.a.createElement("li",{key:a},lt("$__status",1),": ",lt("$__".concat(r[t]),1));if("note"===t)return i.a.createElement("li",{key:a},lt("$__note",1),": ",i.a.createElement("div",null,yt(bt(r[t]),e.searchText)));if("kpi_type"===t||"priority"===t||"risk"===t||"complexity"===t||"impact"===t)return i.a.createElement("li",{key:a},lt("$__".concat(t),1),": ",lt("$__".concat(r[t]),1));if("name"===t||"description"===t)return i.a.createElement("li",{key:a},lt("$__".concat(t),1),": ",r[t]);if("url"===t)return i.a.createElement("li",{key:a},"url",":",i.a.createElement("a",{href:r[t],target:"blank",style:{}},yt(bt(r[t]),e.searchText)));if("_tags"!==t&&"string"===typeof r[t]&&"kpi_ini"!==t&&"kpi_fin"!==t&&"startDate"!==t&&"endDate"!==t&&"updated_at"!==t&&"created_at"!==t&&"content"!==t)return i.a.createElement("li",{key:a},lt("$__".concat(t),1),": ",r[t].indexOf("$__")>-1?lt("$__".concat(r[t]),1):r[t]);if("kpi_ini"===t||"kpi_fin"===t){r.kpi_type?r.kpi_type:n.cards[B.idRel]&&n.cards[B.idRel].kpi_type&&n.cards[B.idRel].kpi_type;return i.a.createElement("li",{key:a},lt("$__".concat(t),1),": ",mt(r[t],B.kpi_type?B.kpi_type:"decimal"))}if("startDate"===t||"endDate"===t||"updated_at"===t||"created_at"===t)return i.a.createElement("li",{key:a},lt("$__".concat(t),1),": ",r[t]?Ve()(new Date(1e3*r[t])).tz("America/Sao_Paulo").format("DD/MM/YYYY HH:mm"):lt("$__removed"));if("boolean"===typeof r[t])return i.a.createElement("li",{key:a},lt("$__".concat(t),1),": ",r[t]?lt("$__enable",1):lt("$__disable",1));if("_tags"===t)return i.a.createElement("li",{key:a},"TAGS: ",i.a.createElement(bn,{options:r[t],showOptions:!0}))}})),i.a.createElement("div",{style:{clear:"both"}})),i.a.createElement("div",{style:{clear:"both"}}))):i.a.createElement("div",{style:{position:"relative",width:"100%"}},i.a.createElement("div",{style:{position:"relative",width:"100%",display:"flex"}},i.a.createElement(kt,{color:"color",icon:"history",style:{marginRight:"10px"}}),i.a.createElement("div",{style:{wordBreak:"break-word"}},yt(bt(X),e.searchText)),i.a.createElement("div",{style:{clear:"both"}})),B.cardId&&De.getState().db.cards[B.cardId]?i.a.createElement("div",{style:Object(h.a)(Object(h.a)({position:"relative",maxWidth:"285px"},e.boxStyle&&e.boxStyle.maxWidth?{maxWidth:e.boxStyle.maxWidth}:{}),{},{width:"100%",display:"block"})},i.a.createElement(oc,{db:"cards",data:De.getState().db.cards[B.cardId],Avatar:!0,ignoreList:!0})):i.a.createElement(i.a.Fragment,null),i.a.createElement("div",{style:{clear:"both"}}))}if("timer"===B.type){var a=U,o="";if(U<60)o="".concat(a," ").concat(lt("$__seconds",1));else if(U>3600){var c=Math.trunc(a/3600);a-=3600*c;var l=Math.trunc(a/60)>0?Math.trunc(a/60):0,s=(a-=60*l)>0?a:0;o="".concat(c," hora").concat(c>1?"s":""," ").concat(l," ").concat(lt("$__minutes",1)," ").concat(s," ").concat(lt("$__seconds",1))}else{var u=Math.trunc(a/60)>0?Math.trunc(a/60):0,d=(a-=60*u)>0?a:0;o="".concat(u," ").concat(lt("$__minutes",1)," ").concat(d," ").concat(lt("$__seconds",1))}return S?i.a.createElement("div",null,i.a.createElement("div",{style:{position:"relative",width:"100%",marginTop:"33px"}},i.a.createElement(La,{label:lt("$__cancelReason",1),variant:dt("standard"),name:"cancelReason",InputProps:{autoComplete:"new-password",multiline:!0,minRows:3,onChange:function(e){w(e.target.value)}},placeholder:lt("$__cancelReason_placeholder",1)})),i.a.createElement("div",{style:{position:"absolute",right:"7px",top:"7px",display:"flex"}},i.a.createElement(At,{transparent:!0,title:lt("$__cancel","*"),color:dt("lightgrey"),icon:"cancel",onClick:function(){k(!1),w(null)},size:"25px"}),i.a.createElement(At,{transparent:!0,title:lt("$__save",1),color:"green",icon:"playlist_add_check",onClick:function(){K()},size:"25px"})),i.a.createElement("div",{style:{clear:"both"}})):i.a.createElement("div",null,i.a.createElement("div",{style:{position:"relative"}},B&&B._toUser&&Object.keys(B._toUser).length>0&&i.a.createElement("div",{className:t.timeInfo},i.a.createElement(Yo.a,{max:300,style:{flexWrap:"wrap",display:"inline-flex",border:"none"}},Object.keys(B._toUser).map((function(e){return i.a.createElement(Qe.a,{key:e,title:B._toUser[e].displayName?B._toUser[e].displayName:B._toUser[e].name},i.a.createElement(nn.a,{alt:B._toUser[e].name,src:B._toUser[e].image||null,style:{width:27,height:27,border:"none"}},B._toUser[e].name.substr(0,1)))})))),B.manualEntry?i.a.createElement("div",{className:t.timeInfo},i.a.createElement(kt,{color:"color",icon:"schedule"}),i.a.createElement("div",{className:"text"},Ve()(1e3*B.ini).tz("America/Sao_Paulo").format("DD/MM/YYYY"))):i.a.createElement(i.a.Fragment,null,parseInt(Ve()(1e3*B.ini).tz("America/Sao_Paulo").format("YYYY"))>2021?i.a.createElement("div",{className:t.timeInfo},i.a.createElement(kt,{color:"color",icon:"schedule"}),i.a.createElement("div",{className:"text"},Ve()(1e3*B.ini).tz("America/Sao_Paulo").format("YYYY/MM/DD HH:mm:ss"))):i.a.createElement(i.a.Fragment,null),parseInt(Ve()(1e3*B.fin).tz("America/Sao_Paulo").format("YYYY"))>2021?i.a.createElement("div",{className:t.timeInfo},i.a.createElement(kt,{color:"color",icon:"watch_later"}),i.a.createElement("div",{className:"text"},Ve()(1e3*B.fin).tz("America/Sao_Paulo").format("YYYY/MM/DD HH:mm:ss"))):i.a.createElement(i.a.Fragment,null)),i.a.createElement("div",{className:t.timeInfo},i.a.createElement(kt,{color:"color",icon:"hourglass_full"}),i.a.createElement("div",{className:"text"},o)),i.a.createElement("div",{style:{clear:"both"}}),B.deleted?i.a.createElement("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255,255,255,0.66)",display:"flex",justifyContent:"center",alignItems:"center",fontWeight:"bold",color:dt("menu")}},lt("$__cancelled")):i.a.createElement(i.a.Fragment,null)),i.a.createElement("div",null,X),B.deleted&&B.deletedReason&&i.a.createElement("div",{style:{color:"red"}},lt("$__cancelReason",1),": ",B.deletedReason),i.a.createElement("div",{style:{clear:"both"}}),B.deleted||!v&&!Ve()(B.created_at).unix("x")?i.a.createElement(i.a.Fragment,null):i.a.createElement("div",{style:{position:"absolute",right:"7px",top:"7px"}},i.a.createElement(En,{transparent:!0,options:[{name:"$__cancelThis",icon:"cancel",onClick:function(){k(!0)},show:"hover"}]}),i.a.createElement("div",{style:{clear:"both"}})),i.a.createElement("div",{style:{clear:"both"}}))}if("kpi"===B.type){var m=B&&B.balance?B.balance:0;return i.a.createElement("div",null,B.cardId?i.a.createElement(oc,{db:"cards",data:De.getState().db.cards[B.cardId],ignoreList:!0,noOptions:!0}):i.a.createElement(i.a.Fragment,null),i.a.createElement("div",null,X),i.a.createElement("div",{className:parseFloat(B.value)>0?t.valuePositive:t.valueNegative},mt(B.value,B.kpi_type?B.kpi_type:"decimal")),!e.stories&&i.a.createElement("div",{className:t.lastValue},lt("$__balance",1),": ",mt(m,B.kpi_type?B.kpi_type:"decimal")),i.a.createElement("div",{style:{clear:"both"}}))}}()),B.user&&i.a.createElement("div",{style:Object(h.a)(Object(h.a)({position:"absolute"},J?{right:"-20px"}:{left:"-20px"}),{},{bottom:0})},i.a.createElement(sc,{overlap:"circular",anchorOrigin:{vertical:"bottom",horizontal:"right"},userId:B.user._id},i.a.createElement(nn.a,{alt:B.user.displayName?B.user.displayName:B.user.name,src:"".concat(B.user.image),style:{width:"22px",height:"22px"}}))),i.a.createElement("div",{style:Object(h.a)(Object(h.a)({position:"absolute"},J?{left:"15px"}:{right:"15px"}),{},{bottom:"-26px",color:"rgba(0,0,0,0.77)",background:"linear-gradient(33deg, rgba(233, 233, 233, 1), rgba(211,211,211, 1))",display:"flex",padding:"1px 7px",alignItems:"center",borderRadius:"0 0 7px 7px",fontSize:"10px",width:"fit-content"})},Ve()(new Date).tz("America/Sao_Paulo").format("DD/MM/YYYY")===Ve()(1e3*B.created_at).tz("America/Sao_Paulo").format("DD/MM/YYYY")?"".concat(Ve()(1e3*B.created_at).tz("America/Sao_Paulo").format("H:mm")):Ve()(new Date).tz("America/Sao_Paulo").format("YYYY")===Ve()(1e3*B.created_at).tz("America/Sao_Paulo").format("YYYY")?"".concat(Ve()(1e3*B.created_at).tz("America/Sao_Paulo").format("DD/MM H:mm")):"".concat(Ve()(1e3*B.created_at).tz("America/Sao_Paulo").format("DD/MM/YYYY H:mm")),B.readedBy&&Object.keys(B.readedBy).length>0&&i.a.createElement(Qe.a,{title:i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:t.users},Object.keys(B.readedBy).sort((function(e,t){return B&&B.readedBy[e]&&B.readedBy[e].readedDate&&B.readedBy[t]&&B.readedBy[t].readedDate&&String(B.readedBy[e].readedDate.low)&&String(B.readedBy[t].readedDate.low)&&parseInt(B.readedBy[e].readedDate.low)<parseInt(B.readedBy[t].readedDate.low)?-1:B&&B.readedBy[e]&&B.readedBy[e].readedDate&&B.readedBy[t]&&B.readedBy[t].readedDate&&String(B.readedBy[e].readedDate.low)&&String(B.readedBy[t].readedDate.low)&&parseInt(B.readedBy[e].readedDate.low)>parseInt(B.readedBy[t].readedDate.low)?1:0})).map((function(e,t){return B.user._id!==e&&B.readedBy&&B.readedBy[e]&&B.readedBy[e].name&&i.a.createElement("div",{key:e,style:{position:"relative",display:"flex",alignItems:"center"}},i.a.createElement(nn.a,{alt:B.readedBy[e].name,src:B.readedBy[e].image||null}),i.a.createElement("span",{style:{paddingLeft:"7px"}},B.readedBy[e].displayName?B.readedBy[e].displayName:B.readedBy[e].name,B.readedBy[e].readedDate&&B.readedBy[e].readedDate.low&&" (".concat(Ve()(1e3*B.readedBy[e].readedDate.low).tz("America/Sao_Paulo").format("DD/MM/YYYY H:mm"),")")))}))))},i.a.createElement("div",null,i.a.createElement(kt,{color:"#FFFFFF",size:"14px",style:{marginLeft:"7px"}},"done_all"))),!B.deleted&&B._reactions&&Object.keys(B._reactions).length>0&&i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},B&&B._reactions.like&&Object.keys(B._reactions.like).length>0&&i.a.createElement(rn,{icon:"thumb_up",iconColor:dt("menu"),title:i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:t.users},Object.keys(B._reactions.like).sort((function(e,t){return B._reactions.like[e].reactDate&&String(B._reactions.like[e].reactDate.low)&&B._reactions.like[t].reactDate&&String(B._reactions.like[t].reactDate.low)&&parseInt(B._reactions.like[e].reactDate.low)<parseInt(B._reactions.like[t].reactDate.low)?-1:B._reactions.like[e].reactDate&&String(B._reactions.like[e].reactDate.low)&&B._reactions.like[t].reactDate&&String(B._reactions.like[t].reactDate.low)&&parseInt(B._reactions.like[e].reactDate.low)>parseInt(B._reactions.like[t].reactDate.low)?1:0})).map((function(e,t){return i.a.createElement("div",{key:e,style:{position:"relative",display:"flex",alignItems:"center"}},i.a.createElement(nn.a,{alt:B._reactions.like[e].name,src:B._reactions.like[e].image||on.a}),i.a.createElement("span",{style:{paddingLeft:"7px"}},B._reactions.like[e].displayName?B._reactions.like[e].displayName:B._reactions.like[e].name,B._reactions.like[e].reactDate&&B._reactions.like[e].reactDate.low&&" (".concat(Ve()(1e3*B._reactions.like[e].reactDate.low).tz("America/Sao_Paulo").format("DD/MM/YYYY H:mm"),")")))})))),style:{fontSize:"12px",margin:0}}),B&&B._reactions&&B._reactions.nolike&&Object.keys(B._reactions.nolike).length>0&&i.a.createElement(rn,{icon:"thumb_down",iconColor:dt("medium"),style:{fontSize:"12px",margin:0},title:i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:t.users},Object.keys(B._reactions.nolike).sort((function(e,t){return B._reactions.nolike[e].reactDate&&String(B._reactions.nolike[e].reactDate.low)&&B._reactions.nolike[t].reactDate&&String(B._reactions.nolike[t].reactDate.low)&&parseInt(B._reactions.nolike[e].reactDate.low)<parseInt(B._reactions.nolike[t].reactDate.low)?-1:B._reactions.nolike[e].reactDate&&String(B._reactions.nolike[e].reactDate.low)&&B._reactions.nolike[t].reactDate&&String(B._reactions.nolike[t].reactDate.low)&&parseInt(B._reactions.nolike[e].reactDate.low)>parseInt(B._reactions.nolike[t].reactDate.low)?1:0})).map((function(e,t){return i.a.createElement("div",{key:e,style:{position:"relative",display:"flex",alignItems:"center"}},i.a.createElement(nn.a,{alt:B._reactions.nolike[e].name,src:B._reactions.nolike[e].image||on.a}),i.a.createElement("span",{style:{paddingLeft:"7px"}},B._reactions.nolike[e].displayName?B._reactions.nolike[e].displayName:B._reactions.nolike[e].name,B._reactions.nolike[e].reactDate&&B._reactions.nolike[e].reactDate.low&&" (".concat(Ve()(1e3*B._reactions.nolike[e].reactDate.low).tz("America/Sao_Paulo").format("DD/MM/YYYY H:mm"),")")))}))))}),B&&B._reactions&&B._reactions.love&&Object.keys(B._reactions.love).length>0&&i.a.createElement(rn,{icon:"favorite",iconColor:dt("medium"),style:{fontSize:"12px",margin:0},title:i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:t.users},Object.keys(B._reactions.love).sort((function(e,t){return B._reactions.love[e].reactDate&&String(B._reactions.love[e].reactDate.low)&&B._reactions.love[t].reactDate&&String(B._reactions.love[t].reactDate.low)&&parseInt(B._reactions.love[e].reactDate.low)<parseInt(B._reactions.love[t].reactDate.low)?-1:B._reactions.love[e].reactDate&&String(B._reactions.love[e].reactDate.low)&&B._reactions.love[t].reactDate&&String(B._reactions.love[t].reactDate.low)&&parseInt(B._reactions.love[e].reactDate.low)>parseInt(B._reactions.love[t].reactDate.low)?1:0})).map((function(e,t){return i.a.createElement("div",{key:e,style:{position:"relative",display:"flex",alignItems:"center"}},i.a.createElement(nn.a,{alt:B._reactions.love[e].name,src:B._reactions.love[e].image||on.a}),i.a.createElement("span",{style:{paddingLeft:"7px"}},B._reactions.love[e].displayName?B._reactions.love[e].displayName:B._reactions.love[e].name,B._reactions.love[e].reactDate&&B._reactions.love[e].reactDate.low&&" (".concat(Ve()(1e3*B._reactions.love[e].reactDate.low).tz("America/Sao_Paulo").format("DD/MM/YYYY H:mm"),")")))}))))}),B&&B._reactions&&B._reactions.approve&&Object.keys(B._reactions.approve).length>0&&i.a.createElement(rn,{icon:"verified",iconColor:"green",style:{fontSize:"12px",margin:0},title:i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:t.users},Object.keys(B._reactions.approve).sort((function(e,t){return B._reactions.approve[e].reactDate&&String(B._reactions.approve[e].reactDate.low)&&B._reactions.approve[t].reactDate&&String(B._reactions.approve[t].reactDate.low)&&parseInt(B._reactions.approve[e].reactDate.low)<parseInt(B._reactions.approve[t].reactDate.low)?-1:B._reactions.approve[e].reactDate&&String(B._reactions.approve[e].reactDate.low)&&B._reactions.approve[t].reactDate&&String(B._reactions.approve[t].reactDate.low)&&parseInt(B._reactions.approve[e].reactDate.low)>parseInt(B._reactions.approve[t].reactDate.low)?1:0})).map((function(e,t){return i.a.createElement("div",{key:e,style:{position:"relative",display:"flex",alignItems:"center"}},i.a.createElement(nn.a,{alt:B._reactions.approve[e].name,src:B._reactions.approve[e].image||on.a}),i.a.createElement("span",{style:{paddingLeft:"7px"}},B._reactions.approve[e].displayName?B._reactions.approve[e].displayName:B._reactions.approve[e].name,B._reactions.approve[e].reactDate&&B._reactions.approve[e].reactDate.low&&" (".concat(Ve()(1e3*B._reactions.approve[e].reactDate.low).tz("America/Sao_Paulo").format("DD/MM/YYYY H:mm"),")")))}))))}),B&&B._reactions&&B._reactions.attention&&Object.keys(B._reactions.attention).length>0&&i.a.createElement(rn,{icon:"report_problem",iconColor:"red",style:{fontSize:"12px",margin:0},title:i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:t.users},Object.keys(B._reactions.attention).sort((function(e,t){return B._reactions.attention[e].reactDate&&String(B._reactions.attention[e].reactDate.low)&&B._reactions.attention[t].reactDate&&String(B._reactions.attention[t].reactDate.low)&&parseInt(B._reactions.attention[e].reactDate.low)<parseInt(B._reactions.attention[t].reactDate.low)?-1:B._reactions.attention[e].reactDate&&String(B._reactions.attention[e].reactDate.low)&&B._reactions.attention[t].reactDate&&String(B._reactions.attention[t].reactDate.low)&&parseInt(B._reactions.attention[e].reactDate.low)>parseInt(B._reactions.attention[t].reactDate.low)?1:0})).map((function(e,t){return i.a.createElement("div",{key:e,style:{position:"relative",display:"flex",alignItems:"center"}},i.a.createElement(nn.a,{alt:B._reactions.attention[e].name,src:B._reactions.attention[e].image||on.a}),i.a.createElement("span",{style:{paddingLeft:"7px"}},B._reactions.attention[e].displayName?B._reactions.attention[e].displayName:B._reactions.attention[e].name,B._reactions.attention[e].reactDate&&B._reactions.attention[e].reactDate.low&&" (".concat(Ve()(1e3*B._reactions.attention[e].reactDate.low).tz("America/Sao_Paulo").format("DD/MM/YYYY H:mm"),")")))})),i.a.createElement("div",{style:{clear:"both"}})))})),!e.isReply&&i.a.createElement("div",{style:{position:"relative",float:"left",marginLeft:"7px",marginRight:"7px"}},v&&!e.noReactions&&!B.deleted&&i.a.createElement("div",{style:{display:"flex",minWidth:"fit-content",justifyContent:"center"},onMouseOver:function(e){R(!0)},onMouseLeave:H},i.a.createElement(kt,{icon:q&&"like"===q?"thumb_up":"thumb_up_off_alt",iconColor:dt(q&&"like"===q?"menu":"medium"),title:lt("$__like",1),size:"18px",onClick:function(){W("like")},onMouseLeave:H}),i.a.createElement(kt,{icon:q&&"nolike"===q?"thumb_down":"thumb_down_off_alt",title:lt("$__notlike",1),iconColor:dt(q&&"nolike"===q?"menu":"medium"),size:"18px",onClick:function(){W("nolike")},onMouseLeave:H}),i.a.createElement(kt,{icon:q&&"love"===q?"favorite":"favorite_border",title:lt("$__love",1),iconColor:dt(q&&"love"===q?"menu":"medium"),size:"18px",onClick:function(){W("love")},onMouseLeave:H}),i.a.createElement(kt,{icon:"verified",title:lt("$__approve",1),iconColor:q&&"approve"===q?"green":dt("medium"),size:"18px",onClick:function(){W("approve")},onMouseLeave:H}),i.a.createElement(kt,{icon:"report_problem",title:lt("$__attention",1),iconColor:q&&"attention"===q?"red":dt("medium"),size:"18px",onClick:function(){W("attention")},onMouseLeave:H}),B&&B.user&&B.user._id===a._id&&i.a.createElement(kt,{icon:"forward",title:lt("$__forwardThisMessage",1),iconColor:"deepskyblue",size:"18px",onClick:function(){F(!0)},onMouseLeave:H}),i.a.createElement(kt,{icon:"reply",title:lt("$__replyThisMessage",1),iconColor:"deepskyblue",size:"18px",onClick:function(){e.reduxFunction("ASYNC","SET_CHATS",Object(h.a)(Object(h.a)({},De.getState().chats),{},{drafts:Object(h.a)(Object(h.a)({},De.getState().chats.drafts||{}),{},Object(O.a)({},e.nodeId,Object(h.a)(Object(h.a)({},De.getState().chats.drafts&&De.getState().chats.drafts[e.nodeId]?De.getState().chats.drafts[e.nodeId]:{}),{},{reply:B._id})))}))},onMouseLeave:H}),!B.deleted&&"comment"===B.type&&B.user&&B.user._id&&B.user._id===a._id&&parseInt(B.created_at)>parseInt(Ve()().unix("x"))-180?i.a.createElement(At,{id:"chat_message_delete",title:lt("$__delete","*"),color:"red",icon:"delete_forever",onClick:function(){K()},size:"18px",transparent:!0}):i.a.createElement(i.a.Fragment,null),i.a.createElement("div",{style:{clear:"both"}})),i.a.createElement("div",{style:{clear:"both"}})),i.a.createElement("div",{style:{clear:"both"}})),i.a.createElement("div",{style:{clear:"both"}})),I?i.a.createElement(Ko.a,{fullWidth:!0,"aria-labelledby":"simple-dialog-title",open:I},i.a.createElement("div",{className:"forwardMessage"},i.a.createElement("div",{style:{position:"relative",marginLeft:"10px",marginTop:"5px",width:"calc(100% - 10px)"}},i.a.createElement(Fa,{title:lt("$__forwardMessage",1),icon:"forward",onCancel:function(){F(!1)}})),i.a.createElement("div",{style:{padding:15}},i.a.createElement(ei,{hideSelected:!0,avatarSize:"33px",permission:e.permission,noLimit:!0,ignoreId:e.nodeId?e.nodeId:e.storie.idRel?e.storie.idRel:null,nodeId:e.nodeId,onSelect:function(e){M(e)}})),i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",padding:"15px"}},i.a.createElement(At,{shadow:!0,title:lt("$__cancel"),text:lt("$__cancel"),color:"lightgrey",icon:"close",size:"25px",onClick:function(){F(!1),M(null)}}),z&&i.a.createElement("div",{style:{marginLeft:"15px"}},i.a.createElement(At,{shadow:!0,title:lt("$__forward"),text:lt("$__forward"),icon:"forward",size:"25px",load:!!P,onClick:function(){D(!0),function(e,t){e&&e.store&&De.getState().functions&&De.getState().functions.socket,De.getState().functions.socket;var r=De.getState(),n=(r.db,r.session,Object(h.a)(Object(h.a)({},t),{},{forwardedId:t._id,_id:Object(Pn.a)(),created_at:"".concat(Ve()().tz("America/Sao_Paulo").unix("x"))}));n._reactions&&delete n._reactions,n.readedBy&&delete n.readedBy,n._reactions&&delete n._reactions,n._toUser&&delete n._toUser,t._forwardToId.map((function(t){so(e,{comment:Object(h.a)(Object(h.a)({},n),{},{idRel:t}),node:t}),console.log(n),ot.post("timeline/add",Object(h.a)(Object(h.a)({},n),{},{idRel:t}))}))}(e,Object(h.a)(Object(h.a)({},B),{},{_forwardToId:z})),setTimeout((function(){F(!1),M(null),e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},De.getState().chat),{},{db:"users",nodeId:z[0],loading:!1})),D(!1)}),6e3)}}),i.a.createElement("div",{style:{clear:"both"}})),i.a.createElement("div",{style:{clear:"both"}})),i.a.createElement("div",{style:{clear:"both"}}))):i.a.createElement(i.a.Fragment,null),i.a.createElement("div",{style:{clear:"both"}}))})));var Tc=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Yr)((function(e){var t=e.classes,r=De.getState(),n=(r.db,r.lightBox,i.a.useState(!1)),a=Object(Be.a)(n,2),o=a[0],c=a[1],l=i.a.useState(!1),s=Object(Be.a)(l,2),u=s[0],d=(s[1],i.a.useState(!1)),p=Object(Be.a)(d,2),f=(p[0],p[1],i.a.useState(null)),h=Object(Be.a)(f,2),m=(h[0],h[1],i.a.useState(null)),g=Object(Be.a)(m,2),v=(g[0],g[1],i.a.useState(!0)),y=Object(Be.a)(v,2),b=(y[0],y[1],i.a.useState(.5)),x=Object(Be.a)(b,2);return x[0],x[1],i.a.useEffect((function(){o||c(!0)})),De.getState().lightBox.miro||De.getState().lightBox.miroBoard?De.getState().lightBox.miro||De.getState().lightBox.miroBoard?i.a.createElement(Je.a,{className:t.backdrop,open:De.getState().lightBox.miro},i.a.createElement("div",{className:t.header},i.a.createElement("div",{className:t.btClose},i.a.createElement(kt,{title:lt("$__close","*"),color:dt("light"),onClick:function(){e.reduxFunction("ASYNC","LIGHTBOX_CLOSE")}},"close"))),i.a.createElement("div",{className:t.content,style:{zIndex:1e3}},u?i.a.createElement("div",{className:t.loader},i.a.createElement(Ct.a,null)):i.a.createElement("iframe",{style:{position:"absolute",width:"100%",height:"100%"},src:"https://miro.com/app/live-embed/".concat(De.getState().lightBox.miroBoard,"=/?embedAutoplay=true&moveToViewport=-23165,-5837,13803,7546")}))):null:i.a.createElement(i.a.Fragment,null)})));var Nc=function(e){return i.a.createElement("div",{id:"sideModule_closeButton",style:Object(h.a)({position:"fixed",display:"inline-flex",paddingLeft:"10px",top:"7px",right:0,backgroundColor:"#FFFFFF"},e.style?e.style:{})},e.saveLoader&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Ft,{size:"25px"})),!e.saveLoader&&i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{id:"sideModule_saveOptions",style:{display:"flex"}},e.save&&i.a.createElement(At,{id:"sideModule_saveButton",title:lt("$__save",1),color:dt("color"),icon:"save",onClick:function(){e.save()},size:"25px"}),e.saveClose&&i.a.createElement(At,{id:"sideModule_saveAndCloseButton",title:lt("$__saveAndClose",1),color:"green",icon:"playlist_add_check",onClick:function(){e.saveClose()},size:"25px"})),e.close&&i.a.createElement(At,{title:lt("$__close",1),color:"lightgrey",icon:"cancel",onClick:function(){e.close()},size:"25px"})))},Pc=function(){return{lock:{position:"fixed",top:"0px",left:"0px",right:"0px",bottom:"0px",height:"100vh",zIndex:"3000 !important"},backdrop:{position:"fixed",top:"0px",left:"0px",right:"440px",bottom:"0px",height:"100vh",backgroundColor:"rgba(0,0,0,0.7)"},module:Object(h.a)(Object(h.a)({},rr),{},{position:"absolute",right:"0px",top:"0px",bottom:"0px",minWidth:"500px",width:"30%",zIndex:"1100",backgroundColor:"rgba(255,255,255,1)"}),modulePopup:Object(h.a)(Object(h.a)({},rr),{},{width:"70vw",position:"absolute",zIndex:"1100",left:"calc(50% - 35vw)",backgroundColor:"rgba(255,255,255,1)",height:"80vh",top:"calc(50% - 40vh)",boxShadow:"0px 0px 20px rgba(0,0,0,0.2)",padding:"0px 5px",border:"solid 2px #ffffff"}),moduleExpanded:Object(h.a)(Object(h.a)({},rr),{},{width:"90vw",position:"absolute",zIndex:"1100",left:"calc(50% - 45vw)",backgroundColor:"rgba(255,255,255,1)",height:"80vh",bottom:"0px",boxShadow:"0px 0px 20px rgba(0,0,0,0.2)",padding:"0px 5px",border:"solid 2px #ffffff"}),moduleFullScreen:Object(h.a)(Object(h.a)({},rr),{},{width:"100vw",position:"absolute",zIndex:"1100",left:"0px",backgroundColor:"rgba(255,255,255,1)",height:"100vh",bottom:"0px",boxShadow:"0px 0px 20px rgba(0,0,0,0.2)",padding:"0px 5px",border:"solid 2px #ffffff"}),menu:{position:"absolute",left:"0px",width:"45px",top:"0px",bottom:"0px",textAlign:"center"},content:{position:"absolute",top:"80px",left:"45px",bottom:"0px",right:"0px",padding:"0px",overflowY:"auto",overflowX:"hidden",zIndex:1},menuButtons_resume:{margin:"0px auto 27px auto",height:"40px"},MenuButton:{margin:"auto auto",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},MenuButton_arrow:{position:"absolute",right:"-8px",fontSize:"16px",transform:"rotate(180deg)"},subTitle:{position:"absolute",left:"45px",right:"0px",padding:"4px 10px",top:"47px",backgroundColor:dt("color"),color:dt("light")}}},Dc=r(48),Ac=r.n(Dc),$c=r(247),zc=r(244),Mc={messagesContainer:{height:"100%",width:"100%"}};function Bc(){Bc=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Yc=Object($e.b)((function(){return{}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=e.messages,r=e.type,n=e.nodeId,a=i.a.useState(!1),c=Object(Be.a)(a,2),l=c[0],s=c[1],u=i.a.useState(!1),d=Object(Be.a)(u,2),p=d[0],f=d[1],m=Object(o.useRef)({}),g=Object(o.useRef)({}),v=Object(o.useRef)({});Object(o.useEffect)((function(){return function(){f(!1)}}),[n,r]),Object(o.useEffect)((function(){var e;t.length>0&&((!p||(null===g||void 0===g||null===(e=g.current)||void 0===e?void 0:e.messagesLength)&&t.length>g.current.messagesLength)&&(g.current=Object(h.a)(Object(h.a)({},g.current),{},{loading:!1,messagesLength:t.length},p?{}:{length:t.length}),E(),setTimeout((function(){s(!1)}),1e3)));b()}),[t,p]);var y=t.filter((function(e){return e.type===r&&e.user._id!==De.getState().session._id&&(!e.readedBy||e.readedBy&&!e.readedBy[De.getState().session._id])})).length,b=function(){var t=Object(Me.a)(Bc().mark((function t(){var a,o;return Bc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:p&&!p.lock&&(null===g||void 0===g||null===(a=g.current)||void 0===a?void 0:a.length)&&y>0&&(o=De.getState().functions.socket,co(e,{readedBy:De.getState().session._id,id:n,db:e.db,type:r}),o.emit("data",{module:"chat",method:"put",action:"read"},{readedBy:De.getState().session._id,id:n,db:e.db,type:r}),De.getState().chats.unreadeds[e.nodeId]&&e.reduxFunction("ASYNC","SET_CHATS",Object(h.a)(Object(h.a)({},De.getState().chats),{},{unreadeds:Object(h.a)(Object(h.a)({},De.getState().chats.unreadeds),{},Object(O.a)({},e.nodeId,0))})));case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),x=function(){var r=Object(Me.a)(Bc().mark((function r(){var n,a,o,i;return Bc().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(a=De.getState().db.users[e.nodeId]?"users":"cards",null===g||void 0===g||null===(n=g.current)||void 0===n?void 0:n.timelineEnd){r.next=6;break}return r.next=4,uo(Object(h.a)(Object(h.a)({},e),{},{fnIdentification:"Timeline/Index/scrollFunction()"}),{ids:[e.nodeId],db:a,type:"comment",limit:!0,skip:t.length});case 4:(o=r.sent)&&(i=Object(h.a)(Object(h.a)({},g.current),{},{length:t.length+o.total}),o.total<20&&(i=Object(h.a)(Object(h.a)({},i),{},{timelineEnd:!0})),g.current=Object(h.a)({},i));case 6:case"end":return r.stop()}}),r)})));return function(){return r.apply(this,arguments)}}();function _(e){return v.current[e]+11||83}function w(r){var n,a=r.index,o=r.style,c=t[a];return i.a.createElement("div",{style:o},i.a.createElement(Fc,{storie:c,openLightBox:function(t){e.openLightBox(t)},hideCards:!!e.hideCards,db:e.db,nodeId:e.nodeId,showUserName:!!(null===(n=De.getState().db)||void 0===n?void 0:n.cards[e.nodeId]),onResize:function(e){!function(e,t){var r;(null===m||void 0===m||null===(r=m.current)||void 0===r?void 0:r.resetAfterIndex)&&m.current.resetAfterIndex(0),v.current=Object(h.a)(Object(h.a)({},v.current),{},Object(O.a)({},e,t))}(a,e)}}))}function E(){var e,r,n,a,o=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=t.length-1,c="end",l=g.current.length||0,s=(null===g||void 0===g||null===(e=g.current)||void 0===e?void 0:e.visibleStopIndex)||0;!o&&p&&(null===g||void 0===g||null===(r=g.current)||void 0===r?void 0:r.lock)&&(null===g||void 0===g||null===(n=g.current)||void 0===n?void 0:n.length)&&(c="end",i=t.length-l+s+1),(null===m||void 0===m||null===(a=m.current)||void 0===a?void 0:a.scrollToItem)?m.current.scrollToItem(i,c):setTimeout((function(){E()}),100)}var j=setTimeout((function(){}),15e3),S=function(e,r){var n=Object(h.a)(Object(h.a)({},g.current),e);!p&&t.length>0&&e.visibleStopIndex+1===t.length&&f(!0),p&&e.visibleStopIndex<t.length-2&&t.length>10&&(n=Object(h.a)(Object(h.a)({},n),{},{lock:!0})),p&&e.visibleStopIndex+1===t.length&&(n=Object(h.a)(Object(h.a)({},n),{},{lock:!1}),setTimeout((function(){b()}),100)),p&&g.current&&!l&&!g.current.loading&&e.visibleStartIndex<10?(clearTimeout(j),s(!0),n=Object(h.a)(Object(h.a)({},n),{},{loading:!0,lock:!0}),j=setTimeout((function(){x()}),1e3)):(e.overscanStopIndex,t.length),g.current=Object(h.a)({},n)};return i.a.createElement("div",{style:Mc.messagesContainer},i.a.createElement(zc.a,{style:Mc.messagesContainer},(function(e){var r=e.height,n=e.width;return i.a.createElement($c.b,{className:"List",height:r,itemCount:t.length,itemSize:_,ref:m,width:n,onItemsRendered:S,overscanCount:15},w)})),y>0?i.a.createElement("div",{style:{position:"absolute",bottom:"33px",right:"15px",width:"33px",height:"33px"}},i.a.createElement(rn,{icon:"arrow_downward",iconColor:"red",size:"33px",onClick:function(){E(!0)}})):i.a.createElement(i.a.Fragment,null))})),Gc={};function Rc(){Rc=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Hc=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Gc)((function(e){var t=i.a.useState(""),r=Object(Be.a)(t,2),n=r[0],a=r[1],o=i.a.useState(!1),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.useState([]),d=Object(Be.a)(u,2),p=d[0],f=d[1],h=De.getState(),m=(h.db,h.functions.socket,window.location.hash.split("/"));m[0]=m[0].replace("#",""),i.a.useEffect((function(){if(e.text.length>1&&e.text!==n){a(e.text);var t=setTimeout((function(){return g()}),1e3);return s(!0),function(){return clearTimeout(t)}}}),[e.text]);var g=function(){var t=Object(Me.a)(Rc().mark((function t(){var r;return Rc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,console.log({text:e.text.trim(),nodeId:e.nodeId,db:e.db,type:"comment"}),t.next=4,Sn.post("/M_Timeline_Search",{text:e.text.trim(),nodeId:e.nodeId,db:e.db,type:"comment"});case 4:(r=t.sent)&&r.data&&(e.onFinish&&e.onFinish(),f(r.data),s(!1)),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),console.log("COMPONENTS/TIMELINE/SEARCH/MESSAGES/SearchMessages():::",t.t0);case 11:case"end":return t.stop()}}),t,null,[[0,8]])})));return function(){return t.apply(this,arguments)}}();return i.a.createElement("div",{style:{width:"100%",maxHeight:"70vh"}},i.a.createElement("div",{style:{positin:"relative",width:"100%"}},l&&i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},i.a.createElement(Fo,null)),i.a.createElement(vo,null,Object.keys(p).length>0&&i.a.createElement(xo,{xs:12,sm:12,md:12,lg:12,xl:12},Object.keys(p).map((function(t,r){return i.a.createElement("div",{key:t,style:{position:"relative",float:"left",width:"calc(100% - 20px)",marginLeft:"10px",marginRight:"10px",marginBottom:"22px",clear:"both"}},i.a.createElement(Fc,{messageClick:e.onAction?function(){}:null,searchText:e.text.trim(),storie:p[t],hideCards:!!e.hideCards,db:e.db,nodeId:e.nodeId}))}))))))})));var Wc=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Gc)((function(e){De.getState().db;var t,r=i.a.useState(""),n=Object(Be.a)(r,2),a=n[0],o=n[1],c=i.a.useState(!1),l=Object(Be.a)(c,2),s=l[0],u=l[1],d=i.a.useState(!1),p=Object(Be.a)(d,2),f=p[0],h=p[1],m=window.location.hash.split("/");return m[0]=m[0].replace("#",""),i.a.createElement("div",{style:{position:"relative",zIndex:10,padding:10,backgroundColor:"rgba(250,250,250,0.9)",borderRadius:"25px"}},s?i.a.createElement(i.a.Fragment,null,i.a.createElement(La,{label:lt("$__searchInChat"),variant:dt("fieldVariant"),name:"searchInChat",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"close",color:"lightgray",onClick:function(){o(""),h(!1),u(!1)}})),onChange:function(e,t){o(e.target.value),h(!0)},onBlur:function(){""===a&&(o(""),h(!1),u(!1))}},placeholder:lt("$__searchInChat"),value:vt(a).toLowerCase(),autoFocus:!0})):i.a.createElement(At,{title:lt("$__search",1),color:"grey",icon:"search",onClick:function(e){u((function(e){return!e}))},transparent:!0}),""!==a&&a.length>1&&f&&i.a.createElement("div",{style:{position:"absolute",bottom:0,left:"7px",right:"7px"}},i.a.createElement(Fo,null)),""!==a&&a.length>1&&i.a.createElement("div",{style:(t={position:"absolute",top:"50px",right:"15px",backgroundColor:"#FFFFFF",maxHeight:"calc(100vh - 60px)",height:"auto",overflow:"hidden",overflowY:"auto",boxShadow:"0 3px 3px 3px rgba(0,0,0,0.1)"},Object(O.a)(t,"maxHeight","90vh"),Object(O.a)(t,"maxWidth","666px"),Object(O.a)(t,"zIndex",2001),t)},i.a.createElement(Hc,{nodeId:e.nodeId,db:e.db,text:a,onFinish:function(e){h(!1)},onAction:function(t){e.onAction&&e.onAction(t),o(""),h(!1),u(!1)}})))})));function Uc(){Uc=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Vc=Object(Lt.a)(uc),qc=Object($e.b)((function(e){return{timeline:e.timeline}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=Vc(),r=De.getState().session,n=i.a.useState(!1),a=Object(Be.a)(n,2),o=a[0],c=a[1],l=e.timeline,s=e.type||"comment",u=e.nodeId?De.getState().db["".concat(e.db?e.db:"cards")][e.nodeId]:{},d=De.getState().db.users[e.nodeId]?"users":"cards",p=[],f=[];De.getState().db.cards[e.nodeId]&&l[e.nodeId]&&Object.keys(l[e.nodeId]).map((function(t){return f.push(l[e.nodeId][t])}));"kpi"===s&&function e(t){Object.keys(De.getState().db.cards).filter((function(e){return De.getState().db.cards[e]._parent===t&&De.getState().db.cards[e].kpi_useParent&&De.getState().db.cards[e].kpi_type===De.getState().db.cards[t].kpi_type})).map((function(t){De.getState().timeline[t]&&Object.keys(De.getState().timeline[t]).filter((function(e){return"kpi"===De.getState().timeline[t][e].type&&!De.getState().timeline[t][e].deleted})).map((function(e){return f.push(De.getState().timeline[t][e])})),e(t)}))}(e.nodeId),De.getState().db.users[e.nodeId]&&(l&&l[r._id]&&Object.keys(l[r._id]).filter((function(t){return l[r._id]&&l[r._id][t]&&l[r._id][t].user&&l[r._id][t].user._id===e.nodeId&&0===f.filter((function(e){return e._id===t})).length})).map((function(e){f.push(l[r._id][e])})),l&&l[e.nodeId]&&Object.keys(l[e.nodeId]).filter((function(t){return l[e.nodeId]})).map((function(t){f.push(l[e.nodeId][t])})),f=Object.keys(f).sort((function(e,t){return parseInt(f[e].created_at)<parseInt(f[t].created_at)?-1:parseInt(f[e].created_at)>parseInt(f[t].created_at)?1:0})).filter((function(t){return f[t].user&&f[t].user._id&&(f[t].user._id===r._id||f[t].user._id===e.nodeId)})).map((function(e){return f[e]}))),e.kpi_type&&(f=Object.keys(f).filter((function(t){return f[t].kpi_type===e.kpi_type||f[t].reply})).map((function(e){return f[e]})));var m=u&&u.kpi_ini?parseFloat(u.kpi_ini):0;i.a.useEffect((function(){var t=!0,r=function(){var t=Object(Me.a)(Uc().mark((function t(){var r;return Uc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.type?e.type:"comment",t.next=3,uo(Object(h.a)(Object(h.a)({},e),{},{fnIdentification:"Timeline/Index/init()",force:!0}),Object(h.a)({ids:e.nodeId,db:d,type:r},"kpi"===e.type?{limit:!1,skip:!1,reqChildrens:!0}:{limit:!0,skip:f.filter((function(e){return e.type===r})).length>0?f.filter((function(e){return e.type===r})).length-1:0,reqChildrens:!1}));case 3:c(!1);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return t&&f.filter((function(e){return e.type===s})).length<10&&(c(!0),r()),function(){t=!1}}),[s,e.nodeId]);var g=Object.keys(f).length>0&&Object.keys(f).filter((function(e){if((!f[e].deleted||f[e].deleted&&f[e].user&&f[e].user._id&&f[e].user._id===r._id)&&(f[e].type===s||f[e].reply&&Object.keys(f).filter((function(t){return f[t]&&f[t]._id===f[e].reply&&f[t].type===s})).length>0))return!0})).sort((function(e,t){return f[e].created_at<f[t].created_at?-1:f[e].created_at>f[t].created_at?1:0})).map((function(e){var t=f[e];return m=parseFloat(parseFloat(m)+parseFloat(t.value)),t.balance=m,t.files&&Object.keys(t.files).length>0&&Object.keys(t.files).map((function(e,r){var n=t.files[e];p.push(n)})),t}));return i.a.createElement("div",null,i.a.createElement("div",{className:t.timeline},i.a.createElement("div",{className:e.showHeader?t.timelineSimpleWithHeader:t.timelineSimple,style:{zIndex:1}},g&&g.length>0?i.a.createElement(Yc,{messages:g,hideCards:!!e.hideCards,db:e.db,type:s,nodeId:e.nodeId,openLightBox:function(t){var r;r=t,e.reduxFunction("ASYNC","LIGHTBOX",{open:!0,files:p,file:r})}}):i.a.createElement(i.a.Fragment,null),i.a.createElement("div",{style:{clear:"both"}})),o?i.a.createElement("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(250,250,250,0.7)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:10}},i.a.createElement(Xr,null)):e.noSearch?i.a.createElement(i.a.Fragment,null):i.a.createElement("div",{style:{position:"absolute",top:0,right:0}},i.a.createElement(Wc,{db:d,nodeId:e.nodeId,onAction:function(e){}}))))})),Xc=Object($e.b)((function(){return{}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=e.nodeId,r=De.getState().session,n=De.getState().db.users[t]?"users":"cards",a=!!e.disabledSend&&e.disabledSend;return t&&e.disabledSend&&(!De.getState().db.cards[t]||De.getState().db.cards[t]&&De.getState().db.cards[t].onlyAdminsSendMessages&&De.getState().db.cards[t]._users&&De.getState().db.cards[t]._users[r._id]&&De.getState().db.cards[t]._users[r._id].access<4)&&(a=!0),"users"===n&&De.getState().db.users&&De.getState().db.users[t]&&De.getState().db.users[t].deleted&&(a=!0),i.a.createElement("div",{style:{position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px",overflowY:"auto"}},i.a.createElement("div",{style:{position:"absolute",top:"0px",left:"0px",right:"0px",bottom:a?"0px":"70px"}},i.a.createElement(Ut,null,i.a.createElement(qc,e))),a?De.getState().db.cards[t]&&"chatGroup"===De.getState().db.cards[t].type?i.a.createElement("div",{style:{position:"absolute",alignItems:"center",textAlign:"center",bottom:0,left:0,right:0,padding:15,backgroundColor:"linear-gradient(33deg, rgba(250, 250, 250, 1), rgba(240,240,240, 1))",justifyContent:"center",fontSize:"16px",fontWeight:"bold",color:dt("menu")}},lt("$__onlyAdminsCanSendMessages",1)):i.a.createElement(i.a.Fragment,null):i.a.createElement(Ut,null,i.a.createElement(Eo,{db:e.db?e.db:"cards",nodeId:t,editorStyle:{padding:"7px"}})))})),Jc=r(1820);function Kc(){Kc=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Zc=Object($e.b)((function(){return{}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=function(){var t=Object(Me.a)(Kc().mark((function t(r,n){var a,o,i;return Kc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=n,o=De.getState().db[e.dbNode],!e.ws){t.next=9;break}return t.next=5,a.map(function(){var t=Object(Me.a)(Kc().mark((function t(r,n){var i,c,l,s;return Kc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r.value||!e.dbNode||0!==o.filter((function(e){return r&&r.label&&e.label===r.label||r&&r===e.label})).length){t.next=7;break}return t.next=3,ot.post(e.api?e.api:"node/add/".concat(e.dbNode),{name:r.trim(),secondaryParent:e.secondaryParent?e.secondaryParent:null});case 3:(i=t.sent)&&(c=i&&i.data&&i.data.id?i.data.id:i.data.value,0===o.filter((function(e){return e.value===c})).length&&(o.push({value:c,label:r}),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},Object(O.a)({},e.dbNode,o)))),0===a.filter((function(e){return e.value===c})).length&&(a.splice(n,1),a.push({value:c,label:r}))),t.next=8;break;case 7:o.filter((function(e){return r&&r.label&&e.label===r.label||r&&r===e.label})).length>0&&(l=o.filter((function(e){return r&&r.label&&e.label===r.label||r&&r===e.label}))[0])&&0===a.filter((function(e){return e.value===l.value})).length&&(a.splice(n,1),a.push({value:l.value,label:l.label}));case 8:return s=[],a.filter((function(e){e&&e.value&&s.push(e)})),a=Array.from(s),t.abrupt("return",a);case 12:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}());case 5:i=t.sent,Promise.all(i).then((function(){e.onChange&&e.onChange(r,a)})),t.next=10;break;case 9:e.onChange&&e.onChange(r,a);case 10:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),r=Object(h.a)({},e);return String(e.dbNode)&&delete r.dbNode,String(e.onChange)&&delete r.onChange,String(e.store)&&delete r.store,String(e.ownProps)&&delete r.ownProps,String(e.reduxFunction)&&delete r.reduxFunction,String(e.ws)&&delete r.ws,String(e.add)&&delete r.add,(e.inNode||"undefined"===String(e.inNode)||"null"===String(e.inNode))&&delete r.inNode,(e.InputProps||"undefined"===String(e.InputProps)||"null"===String(e.InputProps))&&delete r.InputProps,(e.dark||"undefined"===String(e.dark)||"null"===String(e.dark))&&delete r.dark,(e.endAdornment||"undefined"===String(e.endAdornment)||"null"===String(e.endAdornment))&&delete r.endAdornment,(e.startAdornment||"undefined"===String(e.startAdornment)||"null"===String(e.startAdornment))&&delete r.startAdornment,(e.secondaryParent||"undefined"===String(e.secondaryParent)||"null"===String(e.secondaryParent))&&delete r.secondaryParent,i.a.createElement(Jc.a,Object.assign({},r,{onChange:function(e,r){t(e,r)}}))})),Qc=Object(Ze.a)((function(e){return{root:{border:"none",boxShadow:"0 3px 3px 3px rgba(0,0,0,0.05)","& .MuiIcon-root":{color:"rgba(250,250,250,0.33)"},"& .MuiIcon-root:hover":{color:"rgba(250,250,250,0.77)"},padding:0}}}))(Pi.a);function el(e){var t=i.a.useState(!1),r=Object(Be.a)(t,2),n=r[0],a=r[1];return i.a.createElement(Qc,{style:Object(h.a)(Object(h.a)({},e.style?e.style:{}),n?{}:{paddingLeft:10,paddingRight:10}),deleteIcon:e.deleteIcon?e.deleteIcon:null,label:e.label,onMouseOver:function(){a(!0)},onMouseLeave:function(){a(!1)},onDelete:e.onDelete&&n?function(){e.onDelete()}:null,onClick:e.onClick?function(t){e.onDelete()}:null})}var tl=Object(Ze.a)({root:Object(h.a)(Object(h.a)({},rr),{},{padding:0,width:"100%",marginTop:"7px",marginBottom:"7px","& .invalid":{borderBottom:"solid 2px red !important"},"& .MuiOutlinedInput-input":{padding:"11px 11px",fontSize:"12px",color:"#FFFFFF"},"& label":{marginTop:"-10px",fontSize:"12px",color:dt("color")},"& label.MuiFormLabel-filled":{color:dt("color"),marginTop:"standard"===dt("fieldVariant")||"filled"===dt("fieldVariant")?"-10px":0},"& label.Mui-focused":{color:dt("color"),marginTop:"standard"===dt("fieldVariant")||"filled"===dt("fieldVariant")?"-10px":0},"& .MuiInput-underline:after":{borderBottomColor:dt("line")},"& .MuiOutlinedInput-root":{borderRadius:dt("fieldRadius"),"& fieldset":{borderColor:dt("line")},"&.Mui-focused fieldset":{borderColor:dt("line")}},"& .MuiFilledInput-root":{borderRadius:dt("fieldRadius"),"& fieldset":{borderColor:dt("line")},"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")},"&.Mui-focused":{borderBottomColor:dt("line"),"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")}}},"& .MuiInputLabel-outlined":{marginTop:"0px","&.Mui-focused":{marginTop:"0px"},"&.MuiFormLabel-filled":{marginTop:"0px"}},"& .MuiInputBase-root":{marginTop:"standard"===dt("fieldVariant")?0:"filled"===dt("fieldVariant")?"-15px":0,borderRadius:dt("fieldRadius"),color:"#FFFFFF","& fieldset":{borderColor:dt("line")},"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")},"&.Mui-focused":{borderBottomColor:dt("line"),"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")}}}})})(ka.a),rl={labelTop:Object(h.a)(Object(h.a)({},rr),{},{padding:"0px",width:"100%",marginTop:"7px",marginBottom:"7px","& .invalid":{borderBottom:"solid 2px red !important"},"& .MuiOutlinedInput-input":{padding:"11px 11px",fontSize:"12px",color:"#FFFFFF"},"& label":{marginTop:"-10px",fontSize:"12px",color:dt("color")},"& label.MuiFormLabel-filled":{color:dt("color"),marginTop:"standard"===dt("fieldVariant")||"filled"===dt("fieldVariant")?"-10px":"0px"},"& label.Mui-focused":{color:dt("color"),marginTop:"standard"===dt("fieldVariant")||"filled"===dt("fieldVariant")?"-10px":"0px"},"& .MuiInput-underline:after":{borderBottomColor:dt("line")},"& .MuiOutlinedInput-root":{borderRadius:dt("fieldRadius"),"& fieldset":{borderColor:dt("line")},"&.Mui-focused fieldset":{borderColor:dt("line")}},"& .MuiFilledInput-root":{borderRadius:dt("fieldRadius"),"& fieldset":{borderColor:dt("line")},"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")},"&.Mui-focused":{borderBottomColor:dt("line"),"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")}}},"& .MuiInputLabel-outlined":{marginTop:"0px","&.Mui-focused":{marginTop:"0px"},"&.MuiFormLabel-filled":{marginTop:"0px"}},"& .MuiInputBase-root":{marginTop:"standard"===dt("fieldVariant")?"0px":"filled"===dt("fieldVariant")?"-15px":"0px",borderRadius:dt("fieldRadius"),color:"#FFFFFF","& fieldset":{borderColor:dt("line")},"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")},"&.Mui-focused":{borderBottomColor:dt("line"),"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")}}}}),noLabel:Object(h.a)(Object(h.a)({},rr),{},{padding:"0px",width:"100%",marginTop:"7px",marginBottom:"7px","& .invalid":{borderBottom:"solid 2px red !important"},"& .MuiOutlinedInput-input":{padding:"11px 11px",fontSize:"12px",color:"#FFFFFF"},"& label":{textAlign:"right",fontSize:"12px",color:dt("color")},"& label.MuiFormLabel-filled":{display:"none"},"& label.Mui-focused":{display:"none"},"& .MuiInput-underline:after":{borderBottomColor:dt("line")},"& .MuiOutlinedInput-root":{borderRadius:dt("fieldRadius"),"& fieldset":{borderColor:dt("line")},"&.Mui-focused fieldset":{borderColor:dt("line")}},"& .MuiFilledInput-root":{borderRadius:dt("fieldRadius"),"& fieldset":{borderColor:dt("line")},"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")},"&.Mui-focused":{borderBottomColor:dt("line"),"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")}}},"& .MuiInputLabel-outlined":{display:"none",marginTop:"0px","&.Mui-focused":{marginTop:"0px"},"&.MuiFormLabel-filled":{marginTop:"0px"}},"& .MuiInputBase-root":{borderRadius:dt("fieldRadius"),color:"#FFFFFF","& fieldset":{borderColor:dt("line")},"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")},"&.Mui-focused":{borderBottomColor:dt("line"),"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")}}}}),labelTopLight:Object(h.a)(Object(h.a)({},rr),{},{padding:"0px",width:"100%",marginTop:"7px",marginBottom:"7px","& .invalid":{borderBottom:"solid 2px red !important"},"& .MuiOutlinedInput-input":{padding:"11px 11px",fontSize:"12px",color:"#FFFFFF"},"& label":{marginTop:"-10px",fontSize:"12px",color:dt("color")},"& label.MuiFormLabel-filled":{color:dt("color"),marginTop:"standard"===dt("fieldVariant")||"filled"===dt("fieldVariant")?"-10px":"0px"},"& label.Mui-focused":{color:dt("color"),marginTop:"standard"===dt("fieldVariant")||"filled"===dt("fieldVariant")?"-10px":"0px"},"& .MuiInput-underline:after":{borderBottomColor:dt("line")},"& .MuiOutlinedInput-root":{borderRadius:dt("fieldRadius"),"& fieldset":{borderColor:dt("line")},"&.Mui-focused fieldset":{borderColor:dt("line")}},"& .MuiFilledInput-root":{borderRadius:dt("fieldRadius"),"& fieldset":{borderColor:dt("line")},"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")},"&.Mui-focused":{borderBottomColor:dt("line"),"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")}}},"& .MuiInputLabel-outlined":{marginTop:"0px","&.Mui-focused":{marginTop:"0px"},"&.MuiFormLabel-filled":{marginTop:"0px"}},"& .MuiInputBase-root":{marginTop:"standard"===dt("fieldVariant")?"0px":"filled"===dt("fieldVariant")?"-15px":"0px",borderRadius:dt("fieldRadius"),"& fieldset":{borderColor:dt("line")},"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")},"&.Mui-focused":{borderBottomColor:dt("line"),"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")}}}}),noLabelLight:Object(h.a)(Object(h.a)({},rr),{},{padding:"0px",width:"100%",marginTop:"7px",marginBottom:"7px","& .invalid":{borderBottom:"solid 2px red !important"},"& .MuiOutlinedInput-input":{padding:"11px 11px",fontSize:"12px"},"& label":{textAlign:"right",fontSize:"12px",color:dt("color")},"& label.MuiFormLabel-filled":{display:"none"},"& label.Mui-focused":{display:"none"},"& .MuiInput-underline:after":{borderBottomColor:dt("line")},"& .MuiOutlinedInput-root":{borderRadius:dt("fieldRadius"),"& fieldset":{borderColor:dt("line")},"&.Mui-focused fieldset":{borderColor:dt("line")}},"& .MuiFilledInput-root":{borderRadius:dt("fieldRadius"),"& fieldset":{borderColor:dt("line")},"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")},"&.Mui-focused":{borderBottomColor:dt("line"),"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")}}},"& .MuiInputLabel-outlined":{display:"none",marginTop:"0px","&.Mui-focused":{marginTop:"0px"},"&.MuiFormLabel-filled":{marginTop:"0px"}},"& .MuiInputBase-root":{borderRadius:dt("fieldRadius"),"& fieldset":{borderColor:dt("line")},"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")},"&.Mui-focused":{borderBottomColor:dt("line"),"&::before":{borderBottomColor:dt("line")},"&::after":{borderBottomColor:dt("line")}}}})},nl=Object(Lt.a)(rl);var al=function(e){var t=nl(),r=i.a.useState([]),n=Object(Be.a)(r,2),a=n[0],o=n[1];i.a.useEffect((function(){o(e.value)}),[e.value]);var c=function(t){var r=Array.from(a);r.splice(r.findIndex((function(e){return e.value===t.value})),1),o(r),e.onChange&&e.onChange(r)};return i.a.createElement(Zc,{className:e.dark?e.noLabel?t.noLabel:t.labelTop:e.noLabel?t.noLabelLight:t.labelTopLight,value:a,options:e.options||[],getOptionLabel:function(e){return e&&e.label?lt(e.label,1):""},name:"autoComplete_".concat(e.name||""),style:{width:"100%"},multiple:e.multiple||!1,limitTags:e.multiple?e.limitTags?e.limitTags:2:null,freeSolo:e.freeSolo||!1,disableClearable:e.disableClearable||!1,disabled:e.disabled,renderInput:function(t){return e.dark?i.a.createElement(tl,Object.assign({},t,{label:lt(e.placeholder||"$__values","*"),variant:"standard",InputProps:Object(h.a)(Object(h.a)({},t.InputProps),e.InputProps)})):i.a.createElement(La,Object.assign({},t,{label:lt(e.placeholder||"$__values","*"),variant:"standard",InputProps:Object(h.a)(Object(h.a)({},t.InputProps),e.InputProps)}))},renderOption:function(e){return i.a.createElement("div",{style:{zIndex:3e3}},e.label)},renderTags:function(t,r){return t.map((function(t,r){return i.a.createElement("div",{key:r},e.colorPicker&&t&&t.label?i.a.createElement(vn,{label:t&&t.label?t.label:null,color:t.color,_id:t.value,onChange:function(r){var n=t;n.color=r,e.colorPickerCallBack&&e.colorPickerCallBack(n)}},i.a.createElement(el,{label:t&&t.label?t.label:null,style:{backgroundColor:t.color||"#b7b7b7",boxShadow:"0 0 7px 3px rgba(0,0,0,0.05)",color:Et(t.color||"#b7b7b7",!0)},deleteIcon:i.a.createElement(Ke.a,{style:{color:Et(t.color||"#b7b7b7",!0),fontSize:"20px"}},"delete"),onDelete:function(){c(t)}})):t&&t.label?i.a.createElement(el,{label:t&&t.label?t.label:null,style:{backgroundColor:t.color||"#b7b7b7",boxShadow:"0 0 7px 3px rgba(0,0,0,0.05)",color:Et(t.color||"#b7b7b7",!0)},deleteIcon:i.a.createElement(Ke.a,{style:{color:Et(t.color||"#b7b7b7",!0),fontSize:"20px"}},"delete"),onDelete:function(){c(t)}}):i.a.createElement(i.a.Fragment,null))}))},onChange:function(t,r){e.onChange&&e.onChange(r);var n=[];e.multiple?(r.map((function(e){e&&e.label?n.push(e):n.push({label:e})})),o(n)):o(r)},dbNode:e.dbNode?e.dbNode:"tag",add:!(!e.add||!0!==e.add),inNode:e.inNode?e.inNode:null,secondaryParent:e.secondaryParent?e.secondaryParent:null,ws:!0,api:e.api?e.api:null})},ol={instruction:{},picture:{}};function il(){il=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var cl=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(ol)((function(e){var t=i.a.useState([]),r=Object(Be.a)(t,2),n=r[0],a=r[1];i.a.useEffect((function(){if(e.data.values){var t=[];e.data.values.filter((function(e){return e.value})).map((function(e){t.push(e)})),a(t)}}),[e.data]);var o=function(){var t=Object(Me.a)(il().mark((function t(r){return il().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.callBack&&e.callBack(r),a(r);case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return i.a.createElement("div",null,i.a.createElement(al,{dbNode:e.dbNode?e.dbNode:"tag",secondaryParent:e.secondaryParent?e.secondaryParent:null,options:e.options?e.options:[],style:{width:"100%"},name:e.name?e.name:"multInput",ws:!0,add:!0,colorPicker:!0,multiple:!0,freeSolo:!0,disableClearable:!0,disabled:!!e.disabled,value:n,placeholder:e.placeholder||null,onChange:function(e){o(e)},colorPickerCallBack:function(t){e.colorPickerCallBack&&e.colorPickerCallBack(t)}}))}))),ll=function(e){return{btClose:{position:"relative",zIndex:e.zIndex.drawer+1,right:"0",top:"-64px",display:"flex"},root:{position:"absolute",top:"0px",bottom:"0px",left:"0px",right:"0px",overflowX:"auto"},image:{width:"100%",paddingTop:"48%",backgroundPosition:"center",backgroundSize:"cover"},data:{marginTop:"10px",padding:"10px",overflowX:"auto","& fieldset":{border:"solid 1px rgba(0,0,0,0.1)","& legend":{marginBottom:"0px",fontSize:"16px",color:dt("color")}}},switch:{fontSize:"16px",fontWeight:"bold",color:dt("medium")},accessDescription:{fontSize:"14px",color:dt("medium")}}};function sl(){sl=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var ul=Object($e.b)((function(e,t){return{tag:e.db.tag,userGroup:e.db.userGroup,sideModule:e.sideModule}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(ll)((function(e){var t=e.classes,r=De.getState(),n=r.sideModule,a=r.db,c=r.session,l=a.users,s=a.dataType,u=n.data,d=Object(o.useState)(u),p=Object(Be.a)(d,2),f=p[0],m=(p[1],i.a.useState(!pt(u&&u.email?u.email:""))),g=Object(Be.a)(m,2),v=g[0],y=g[1],b=xt(),x=JSON.stringify(f)!==JSON.stringify(u),_=function(t){var r=t.value,a=Object(h.a)(Object(h.a)({},u),{},Object(O.a)({},t.name,r));!r&&a[t.name]&&delete a[t.name],e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},n),{},{data:a}))},w=function(t){x&&!t?ft({message:lt("$__confirmCloseWithUnsavedData",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){e.reduxFunction("ASYNC","CLEAR_MODULE")}}):e.reduxFunction("ASYNC","CLEAR_MODULE")},E=function(){var t=Object(Me.a)(sl().mark((function t(r){var a;return sl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ja(u.email);case 2:if(a=t.sent,u.name){t.next=7;break}ft({message:lt("$__fillName",1),variant:"warning",persist:!1,horizontal:"right",confirm:null}),t.next=19;break;case 7:if(-1!==s.filter((function(e){return e.name===u.type}))[0].disabledFields.indexOf("email")||!v){t.next=11;break}ft({message:v,variant:"warning",persist:!1,horizontal:"right",confirm:null}),t.next=19;break;case 11:if(-1!==s.filter((function(e){return e.name===u.type}))[0].disabledFields.indexOf("email")||!(!pt(n.data.email)||l[u._id]&&u.email!==l[u._id].email&&a)){t.next=15;break}y(lt("$__invalidEmail",1)),t.next=19;break;case 15:return t.next=17,Va(e);case 17:t.sent&&(ft({message:lt("$__userDataSaved",1),variant:null,persist:!1,horizontal:"right",confirm:null}),r&&w(!0));case 19:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),j=!1;return(u._id===c._id||b&&b.user&&(b.userAdmin||b.userEdit))&&(j=!0),i.a.createElement("div",null,i.a.createElement(Nc,{save:j&&x?function(){return E()}:null,saveClose:j&&x?function(){return E(!0)}:null,close:function(){return w(!0)}}),j||!j&&n.data.image,i.a.createElement("div",{id:"sideModule_user_foto"},i.a.createElement(Zi,{maxWidthOrHeight:600,img:n.data&&n.data.image?n.data.image:null,onChange:j?function(e,t){_({name:"file",value:t})}:null,avatar:!0,avatarIcon:u.type&&"user"!==u.type?u.type&&"group"!==u.type?"business":"groups":"person"})),i.a.createElement("form",{className:t.data,autoComplete:"off",id:"sideModule_user_data"},i.a.createElement(La,{id:"sideModule_user_fullName",label:lt("$__fullName",1),variant:dt("fieldVariant"),name:"fullName",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"person"})),onChange:function(e){_(e.target)},onBlur:function(e){if(u&&!u.name){var t=e.target.value?"".concat(e.target.value.split(" ")[0]," ").concat(e.target.value.split(" ")[1]?e.target.value.split(" ")[1]:""):"";_({name:"name",value:t.trim()})}}},value:u&&u.fullName?u.fullName:"",placeholder:lt("$__fullName",1),autoFocus:!0,disabled:!j}),i.a.createElement(La,{id:"sideModule_user_displayName",label:lt("$__displayName",1),variant:dt("fieldVariant"),name:"name",InputProps:{autoComplete:"new-password",multiline:!0,endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"view_comfy_ind"})),onChange:function(e){_(e.target)},onBlur:function(e){_(e.target)}},value:u&&u.name?u.name:"",placeholder:lt("$__displayName",1),disabled:!j}),-1===s.filter((function(e){return e.name===u.type}))[0].disabledFields.indexOf("email")&&i.a.createElement(La,{id:"sideModule_user_email",label:lt("$__email",1),variant:dt("fieldVariant"),name:"email",type:"email",helperText:v,InputProps:{autoComplete:"new-password",className:!v&&u.email&&pt(u&&u.email?u.email:"")?"":"invalid",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"alternate_email"})),onChange:function(e){y(null),_(e.target)},onBlur:function(){var e=Object(Me.a)(sl().mark((function e(t){var r;return sl().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(u._id&&"new"!==u._id&&l[u._id]&&l[u._id].email!==t.target.value||!u._id||"new"===u._id)){e.next=9;break}if(!pt(t.target.value)||l[u._id]&&t.target.value===l[u._id].email){e.next=8;break}return e.next=4,Ja(t.target.value);case 4:r=e.sent,y(r?lt("$__emailAlreadyExists",1):null),e.next=9;break;case 8:y(lt("$__invalidEmail",1));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},value:u&&u.email?u.email:"",placeholder:lt("$__email",1),disabled:!j}),j&&b&&b.user&&(b.userAdmin||b.userEdit)?i.a.createElement(i.a.Fragment,null,i.a.createElement("fieldset",{style:{marginBottom:"14px"},id:"sideModule_user_tags"},i.a.createElement(cl,{data:{values:u.tags||[],_id:u._id},options:De.getState().db.tag?De.getState().db.tag:[],placeholder:"$__tagsPlaceholder",dbNode:"tag",callBack:function(e){_({name:"tags",value:e})},secondaryParent:u._parent,colorPickerCallBack:function(e){De.getState().functions.socket.emit("tag.UPD",e)}})),i.a.createElement("fieldset",{style:{marginBottom:"14px"},id:"sideModule_user_group"},i.a.createElement(cl,{data:{values:u.groups||[],_id:u._id},options:De.getState().db.userGroup?De.getState().db.userGroup:[],placeholder:"$__userGroupPlaceholder",dbNode:"userGroup",callBack:function(e){_({name:"groups",value:e})},secondaryParent:u._parent,colorPickerCallBack:function(e){}}))):i.a.createElement(i.a.Fragment,null)))})));function dl(e){var t=i.a.useState({cPassword:"",password:""}),r=Object(Be.a)(t,2),n=r[0],a=r[1],o=i.a.useState(!1),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.useState(0),d=Object(Be.a)(u,2),p=d[0],f=d[1],m=i.a.useState(0),g=Object(Be.a)(m,2),v=g[0],y=g[1];i.a.useEffect((function(){e.clear&&e.clear!==v&&(y(e.clear),a({cPassword:"",password:""}),s(!1))}));return i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{textAlign:"left"}},i.a.createElement("p",null,lt("$__passwordTip_1")),i.a.createElement("p",null,lt("$__passwordTip_2")),i.a.createElement("ul",null,i.a.createElement("li",null,lt("$__passwordTip_3")),i.a.createElement("li",null,lt("$__passwordTip_4")),i.a.createElement("li",null,lt("$__passwordTip_5")),i.a.createElement("li",null,lt("$__passwordTip_6")),i.a.createElement("li",null,lt("$__passwordTip_7")))),i.a.createElement(La,{label:lt("$__password",1),variant:"standard",name:"password_primary",type:"password",InputLabelProps:{shrink:!0},InputProps:{value:n.password,endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,null,"lock_outline")),autoComplete:"new-password",onChange:function(e){a(Object(h.a)(Object(h.a)({},n),{},{password:e.target.value})),function(e){var t=[];t.push("[$@$!%*#?&]"),t.push("[A-Z]"),t.push("[0-9]"),t.push("[a-z]");for(var r=0,n=0;n<t.length;n++)new RegExp(t[n]).test(e)&&r++;switch(r){case 0:f(0);break;case 1:f(1);break;case 2:f(2);break;case 3:f(3);break;case 4:f(4)}e.length<8&&f(0)}(e.target.value),p>2&&n.password===e.target.value?s(!0):s(!1)}},value:n.password}),i.a.createElement(La,{label:lt("$__passwordConfirm",1),variant:"standard",name:"password_secondary",type:"password",InputLabelProps:{shrink:!0},InputProps:{value:n.cPassword,endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{color:l?"green":"lightgray"},l?"verified":"check")),autoComplete:"new-password",onChange:function(t){a(Object(h.a)(Object(h.a)({},n),{},{cPassword:t.target.value})),p>2&&n.password===t.target.value?(s(!0),e.onConfirmed(t.target.value)):(s(!1),e.onConfirmed(null))}},value:n.cPassword}),n.password&&p>0&&i.a.createElement("div",{style:{position:"relative",width:"100%",margin:"auto",marginBottom:"7px",padding:"3px 0"}},1===p?lt("$__passwordTooWeak",1):2===p?lt("weakPassword",1):3===p?lt("$__goodPassword",1):4===p?lt("$__veryGoodPassword",1):null),n.password&&i.a.createElement("div",{style:{position:"relative",width:"100%",margin:"auto",height:"13px",padding:"3px 0",border:"1px solid rgba(0,0,0,0.1)"}},p>=0&&i.a.createElement("div",{style:{position:"relative",float:"left",width:"calc(20% - 6px)",height:"5px",backgroundColor:"red",margin:"0 3px"}}),p>=1&&i.a.createElement("div",{style:{position:"relative",float:"left",width:"calc(20% - 6px)",height:"5px",backgroundColor:"rgb(129,153,179)",margin:"0 3px"}}),p>=2&&i.a.createElement("div",{style:{position:"relative",float:"left",width:"calc(20% - 6px)",height:"5px",backgroundColor:"rgb(95,151,254)",margin:"0 3px"}}),p>=3&&i.a.createElement("div",{style:{position:"relative",float:"left",width:"calc(20% - 6px)",height:"5px",backgroundColor:"rgb(42,66,255)",margin:"0 3px"}}),4===p&&i.a.createElement("div",{style:{position:"relative",float:"left",width:"calc(20% - 6px)",height:"5px",backgroundColor:"rgb(38,165,45)",margin:"0 3px"}})))}var pl=function(e){return{btClose:{position:"relative",zIndex:e.zIndex.drawer+1,right:"0",top:"-64px",backgroundColor:"#FFFFFF",display:"flex"},image:{width:"100%",backgroundColor:"rgb(0,88,0)",paddingTop:"45%"},data:{position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px",overflowY:"auto",marginTop:"10px",padding:"10px"},switch:{fontSize:"16px",fontWeight:"bold",color:dt("medium")}}};function fl(){fl=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var hl=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(pl)((function(e){var t,r=e.classes,n=De.getState(),a=n.sideModule,o=n.session,c=n.functions,l=n.db,u=c.socket,d=a.data,p=i.a.useState(d),f=Object(Be.a)(p,2),m=f[0],g=(f[1],i.a.useState(!1)),v=Object(Be.a)(g,2),y=v[0],b=v[1],x=i.a.useState(null),_=Object(Be.a)(x,2),w=_[0],E=_[1],j=i.a.useState(0),S=Object(Be.a)(j,2),k=S[0],L=S[1],C=xt(),I=function(t){return b(!0),e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},a),{},{data:Object(h.a)(Object(h.a)({},a.data),{},{_access:Object(h.a)(Object(h.a)({},a.data._access),{},Object(O.a)({},t.name,t.value))})})),!0},F=function(t){var r={_id:d._id,isAdmin:t};try{De.getState().functions.socket.emit("data",{module:"user",method:"post",action:"save"},r,(function(t){t.error?console.log("companyDataError",t.error):e.reduxFunction("ASYNC","SET_SESSION",Object(h.a)(Object(h.a)({},De.getState().session),{},{GlobalData:Object(h.a)(Object(h.a)({},De.getState().session.GlobalData),r)}))}))}catch(n){console.log(n)}},T=function(t){!t&&y?ft({message:lt("$__confirmCloseWithUnsavedData",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){e.reduxFunction("ASYNC","CLEAR_MODULE")}}):e.reduxFunction("ASYNC","CLEAR_MODULE")},N=function(){var t=Object(Me.a)(fl().mark((function t(r){return fl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return b(!1),t.next=3,qa(e);case 3:t.sent&&(ft({message:lt("$__userDataSaved",1),variant:null,persist:!1,horizontal:"right",confirm:null}),F(!d._access.admin||null),r&&T(!0));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),P=function(){var e=Object(Me.a)(fl().mark((function e(){return fl().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:u.emit("data",{module:"user",method:"post",action:"accessSendInvite"},{_id:De.getState().sideModule.data._id,name:De.getState().sideModule.data.name,email:De.getState().sideModule.data.email},(function(){ft({message:lt("$__invitedEmailSended",1),variant:"success",persist:!1,horizontal:"center"})}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),D=function(){var e=Object(Me.a)(fl().mark((function e(){return fl().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ot.post("/user/new-password",{userId:d._id,password:w});case 3:e.sent&&(E(null),ft({message:lt("$__passwordChanged",1),variant:null,persist:!1,horizontal:"right",confirm:null})),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),ft({message:"".concat(lt("$__invalidRequest",1)," | ").concat(lt("$__contactSupport",1)),variant:"warning",persist:!1,horizontal:"right",confirm:null});case 10:L(k+1);case 11:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}(),A=(l.plans[0].settings.space,l.plans[0]);o&&o.GlobalData&&String(o.GlobalData.plan)&&l.plans.filter((function(e){return e.value===o.GlobalData.plan})).length>0&&l.plans.filter((function(e){return e.value===o.GlobalData.plan}))[0].settings&&(l.plans.filter((function(e){return e.value===o.GlobalData.plan}))[0].settings.space,A=l.plans.filter((function(e){return e.value===o.GlobalData.plan}))[0]);var $=1;A&&A.settings&&A.settings.admins&&($=parseInt(A.settings.admins)),o&&o.GlobalData&&o.GlobalData.customAdmins&&($=parseInt(o.GlobalData.customAdmins));var z=Object.keys(l.users).filter((function(e){return l.users[e]&&e!==d._id&&l.users[e]._access&&l.users[e]._access.admin&&(!l.users[e]._parent||l.users[e]._parent&&l.users[l.users[e]._parent]&&!l.users[l.users[e]._parent].independentAccount)})).length||0;return d._access&&d._access.owner&&o._id!==d._id||o._id===d._id?i.a.createElement("div",null,i.a.createElement(Nc,{save:y?function(){return N()}:null,saveClose:y?function(){return N(!0)}:null,close:function(){return T(!0)}}),i.a.createElement("div",{style:{position:"relative",width:"100%",textAlign:"center",padding:"15px"}},i.a.createElement("div",{style:{position:"relative",width:"100%"}},i.a.createElement(dl,{onConfirmed:function(e){E(e)},clear:k})),w&&i.a.createElement("div",{style:(t={display:"flex",padding:"7px 15px",margin:"auto",cursor:"pointer",backgroundColor:"green",marginTop:"15px"},Object(O.a)(t,"display","flex"),Object(O.a)(t,"alignItems","center"),Object(O.a)(t,"justifyContent","center"),Object(O.a)(t,"borderRadius","7px"),t),onClick:function(){D()}},i.a.createElement(rn,{icon:"save",text:lt("$__save","*"),title:!lt("$__save","*"),iconColor:dt("lightText"),textColor:dt("lightText")})))):(console.log($,z),i.a.createElement("div",null,i.a.createElement(Nc,{save:y?function(){return N()}:null,saveClose:y?function(){return N(!0)}:null,close:function(){return T(!0)}}),i.a.createElement("div",{className:r.data},i.a.createElement("fieldset",null,i.a.createElement("div",{className:r.switch},i.a.createElement(vi,{checked:!(!d._access||!d._access.enabled),onChange:function(e){I({name:"enabled",value:!d._access||!d._access.enabled})},name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__permitPlataformAccess",1)),i.a.createElement("div",{className:r.accessDescription},i.a.createElement("i",null,lt("$__userAccess_PlataformAccessDescription",1)))),d._access&&"owner"===d._access?i.a.createElement("fieldset",null,i.a.createElement("div",{className:r.accessDescription},i.a.createElement("i",null," ",lt("$__youAreAccountOwner",1)))):z<$||d&&d._access&&d._access.admin?i.a.createElement(i.a.Fragment,null,i.a.createElement("fieldset",{style:{display:"flex"}},i.a.createElement("div",{style:{padding:7,width:"calc(50% - 4px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",backgroundColor:d&&d._access&&d._access.admin?"rgba(0,0,0,0.07)":dt("color"),color:d&&d._access&&d._access.admin?"gray":"#FFFFFF"}},i.a.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},onClick:function(){I({name:"admin",value:!1})}},i.a.createElement(kt,{icon:"supervised_user_circle",size:"33px",color:d&&d._access&&d._access.admin?null:"#FFFFFF"}),lt("$__guest"))),i.a.createElement("div",{style:{padding:7,marginLeft:7,width:"calc(50% - 4px)",cursor:"pointer",backgroundColor:d&&d._access&&d._access.admin?dt("color"):"rgba(0,0,0,0.07)",color:d&&d._access&&d._access.admin?"#FFFFFF":"gray"}},i.a.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},onClick:function(){I({name:"admin",value:!0})}},i.a.createElement(kt,{icon:"supervisor_account",size:"33px",color:d&&d._access&&d._access.admin?"#FFFFFF":null}),lt("$__supervisorAccount")))),i.a.createElement("fieldset",null,i.a.createElement("div",{className:r.accessDescription},i.a.createElement("i",null,lt(d&&d._access&&d._access.admin?"$__adminAccess_PlataformDescription":"$__guestAccess_PlataformDescription",1))))):i.a.createElement(i.a.Fragment,null,i.a.createElement("fieldset",null,i.a.createElement("legend",null,lt("$__adminLimitReached")),i.a.createElement("div",{className:r.accessDescription},i.a.createElement("i",null,lt("$__adminLimitReachedDescription",1)),i.a.createElement("div",{style:{position:"relative",marginTop:7,color:"red",fontWeight:"bolder"}},lt("$__usedUsers","*")," ",z," ",lt("$__of","*")," ",$,i.a.createElement("span",{style:{marginLeft:15,color:"red",fontSize:11,cursor:"pointer"},onClick:function(){s.push("acc#tab/subscriptionUpgrade")}},lt("$__upgradeSubscription")))))),d._access&&d._access.enabled&&d._access.admin&&i.a.createElement(i.a.Fragment,null,i.a.createElement(i.a.Fragment,null,d._token&&i.a.createElement("fieldset",{style:{backgroundColor:"rgba(255,0,0,0.1)"}},i.a.createElement("i",null,lt("$__unregisteredUserAlert",1)),i.a.createElement(rn,{text:lt("$__sendInviteEmail",1),icon:"contact_mail",onClick:function(){P()}})),d._token&&d._token._id&&i.a.createElement("fieldset",{style:{backgroundColor:"rgba(255,0,0,0.1)"}},i.a.createElement("i",null,lt("$__urlToActivate",1)),i.a.createElement("input",{type:"text",value:"".concat("true"===String("true")?"https://software.machen.ai":"http://localhost:3000","/activate?token=").concat(d._token._id),onClick:function(e){e.target.select()},onChange:function(e){console.log("a")}}))),i.a.createElement("fieldset",null,i.a.createElement("legend",null,i.a.createElement(vi,{checked:!(!d._access||!d._access.user),onChange:function(e){I({name:"user",value:!d._access||!d._access.user})},name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__users",1)),d._access&&(!d._access||d._access.user&&!1!==d._access.user)?i.a.createElement(i.a.Fragment,null,!d._access.userAdmin&&i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:r.switch},i.a.createElement(vi,{checked:!(!d._access||!d._access.userRead),onChange:function(e){I({name:"userRead",value:!d._access||!d._access.userRead})},name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__read",1)),i.a.createElement("div",{className:r.switch},i.a.createElement(vi,{checked:!(!d._access||!d._access.userInteract),onChange:function(e){I({name:"userInteract",value:!d._access||!d._access.userInteract})},name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__interact",1)),i.a.createElement("div",{className:r.switch},i.a.createElement(vi,{checked:!(!d._access||!d._access.userEdit),onChange:function(e){I({name:"userEdit",value:!d._access||!d._access.userEdit})},name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__edit",1))),i.a.createElement("div",{className:r.switch},i.a.createElement(vi,{checked:!(!d._access||!d._access.userAdmin),onChange:function(e){I({name:"userAdmin",value:!d._access||!d._access.userAdmin})},name:"checkeduserAdmin",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__admin",1))):i.a.createElement("div",{className:r.accessDescription},i.a.createElement("i",null,lt("$__userAccess_UserAccessDescription",1)))),i.a.createElement("fieldset",null,i.a.createElement("legend",null,i.a.createElement(vi,{checked:!(!d._access||!d._access.plan),onChange:function(e){I({name:"plan",value:!d._access||!d._access.plan})},name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__plan",1)),d._access&&(!d._access||d._access.plan&&!1!==d._access.plan)?i.a.createElement(i.a.Fragment,null,!d._access.planAdmin&&i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:r.switch},i.a.createElement(vi,{checked:!(!d._access||!d._access.planRead),onChange:function(e){I({name:"planRead",value:!d._access||!d._access.planRead})},name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__read",1)),i.a.createElement("div",{className:r.switch},i.a.createElement(vi,{checked:!(!d._access||!d._access.planEdit),onChange:function(e){I({name:"planEdit",value:!d._access||!d._access.planEdit})},name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__edit",1)),i.a.createElement("div",{className:r.switch},i.a.createElement(vi,{checked:!(!d._access||!d._access.createTemplate),onChange:function(e){I({name:"createTemplate",value:!d._access||!d._access.createTemplate})},name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__createTemplate",1)),i.a.createElement("div",{className:r.switch},i.a.createElement(vi,{checked:!(!d._access||!d._access.planModerate),onChange:function(e){I({name:"planModerate",value:!d._access||!d._access.planModerate})},name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__moderate",1))),i.a.createElement("div",{className:r.switch},i.a.createElement(vi,{checked:!(!d._access||!d._access.planAdmin),onChange:function(e){I({name:"planAdmin",value:!d._access||!d._access.planAdmin})},name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__admin",1))):i.a.createElement("div",{className:r.accessDescription},i.a.createElement("i",null,lt("$__userAccess_StrategyAndPlansAccessDescription")))),C&&C.master&&d._isAdmin?i.a.createElement("fieldset",null,i.a.createElement("legend",null,i.a.createElement(vi,{checked:!(!d._access||!d._access.feed),onChange:function(e){I({name:"feed",value:!d._access||!d._access.feed})},name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__feed",1)),d._access&&(!d._access||d._access.feed&&!1!==d._access.feed)?i.a.createElement(i.a.Fragment,null,!d._access.feedAdmin&&i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:r.switch},i.a.createElement(vi,{checked:!(!d._access||!d._access.feedEdit),onChange:function(e){I({name:"feedEdit",value:!d._access||!d._access.feedEdit})},name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__edit",1)),i.a.createElement("div",{className:r.switch},i.a.createElement(vi,{checked:!(!d._access||!d._access.feedModerate),onChange:function(e){I({name:"feedModerate",value:!d._access||!d._access.feedModerate})},name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__moderate",1))),i.a.createElement("div",{className:r.switch},i.a.createElement(vi,{checked:!(!d._access||!d._access.feedAdmin),onChange:function(e){I({name:"feedAdmin",value:!d._access||!d._access.feedAdmin})},name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__admin",1))):i.a.createElement("div",{className:r.accessDescription},i.a.createElement("i",null,lt("$__feedAccess_StrategyAndPlansAccessDescription")))):i.a.createElement(i.a.Fragment,null),C&&C.masterAdmin?i.a.createElement(i.a.Fragment,null,i.a.createElement("fieldset",null,i.a.createElement("legend",{style:{color:"red"}},i.a.createElement(vi,{checked:!(!d._access||!d._access.masterAdmin),onChange:function(e){I({name:"masterAdmin",value:!d._access||!d._access.masterAdmin})},name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__accountAdministrator",1)),i.a.createElement("div",{className:r.accessDescription},i.a.createElement("i",null,lt("$__accountAdministratorDescription"))))):i.a.createElement(i.a.Fragment,null),C&&C.masterAdmin&&o&&(o.email.indexOf("@sonne.global")>-1||o.email.indexOf("@machen.ai")>-1)&&(d.email.indexOf("@sonne.global")>-1||d.email.indexOf("@machen.ai")>-1)?i.a.createElement(i.a.Fragment,null,i.a.createElement("fieldset",null,i.a.createElement("legend",{style:{color:"red"}},i.a.createElement(vi,{checked:!(!d._access||!d._access.machenAdmin),onChange:function(e){I({name:"machenAdmin",value:!d._access||!d._access.machenAdmin})},name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__machenAdministrator",1)),i.a.createElement("div",{className:r.accessDescription},i.a.createElement("i",null,lt("$__machenAdministratorDescription"))))):i.a.createElement(i.a.Fragment,null)),m&&m._access&&m._access.admin&&d&&d._access&&!d._access.admin?i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{color:"red",fontSize:12}},"Ao remover a permiss\xe3o de administrador do usu\xe1rio, o mesmo perder\xe1 acesso \xe0 todas as atividades que administra atualmente e passar\xe1 a ter acesso restrito \xe0s atividades da plataforma.")):i.a.createElement(i.a.Fragment,null))))})));function ml(){ml=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var gl=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(pl)((function(e){e.classes;var t,r,n,a=De.getState(),c=a.sideModule,l=(a.db,a.session,a.functions.socket,c.data,i.a.useState(!1)),s=Object(Be.a)(l,2),u=s[0],d=(s[1],i.a.useState((t={image:null},Object(O.a)(t,"image",null),Object(O.a)(t,"status",!1),t))),p=Object(Be.a)(d,2),f=p[0],m=p[1],g=i.a.useState(null),v=Object(Be.a)(g,2),y=v[0],b=v[1];Object(o.useEffect)((function(){x()}),[]);var x=function(){var e=Object(Me.a)(ml().mark((function e(){var t,r;return ml().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Sn.post("/M_User_TwoFactor",{action:"has"});case 2:if(!((t=e.sent)&&t.data&&t.data.result)){e.next=7;break}m(Object(h.a)(Object(h.a)(Object(h.a)({},f),t.data.result),{},{status:!0})),e.next=11;break;case 7:return e.next=9,Sn.post("/M_User_TwoFactor",{action:"create"});case 9:(r=e.sent)&&m(Object(h.a)(Object(h.a)(Object(h.a)({},f),r.data.result),{},{status:!1}));case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),_=function(){var e=Object(Me.a)(ml().mark((function e(){var t;return ml().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Sn.post("/M_User_TwoFactor",{action:"verify",code:y});case 2:(t=e.sent)&&t.data&&t.data.result?m(Object(h.a)(Object(h.a)({},f),{},{status:!0})):(ft({message:lt("$__invalidToken",1),variant:"warning",persist:!1,horizontal:"right"}),m(Object(h.a)(Object(h.a)({},f),{},{status:!1}))),b(null);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),w=function(){var e=Object(Me.a)(ml().mark((function e(){var t,r;return ml().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Sn.post("/M_User_TwoFactor",{action:"disable",code:y});case 2:(t=e.sent)&&t.data&&t.data.result?(m((r={image:null},Object(O.a)(r,"image",null),Object(O.a)(r,"status",!1),r)),x()):ft({message:lt("$__invalidToken",1),variant:"warning",persist:!1,horizontal:"right"}),b(null);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return i.a.createElement("div",null,i.a.createElement(Nc,{close:function(){u?ft({message:lt("$__confirmCloseWithUnsavedData",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){e.reduxFunction("ASYNC","CLEAR_MODULE")}}):e.reduxFunction("ASYNC","CLEAR_MODULE")}}),f.status?i.a.createElement("div",{style:{position:"relative",width:"100%",textAlign:"center",padding:"15px"}},i.a.createElement("div",{style:{textAlign:"left"}},i.a.createElement("p",null,lt("$__disableTokenTip_1")),i.a.createElement("p",null,lt("$__disableTokenTip_2")),i.a.createElement("ul",null,i.a.createElement("li",null,lt("$__disableTokenTip_3")),i.a.createElement("li",null,lt("$__disableTokenTip_4")),i.a.createElement("li",null,lt("$__disableTokenTip_5")),i.a.createElement("li",null,lt("$__disableTokenTip_6")),i.a.createElement("li",null,lt("$__disableTokenTip_7")))),i.a.createElement(La,{label:lt("$__token",1),variant:"standard",name:"token",type:"password",InputLabelProps:{shrink:!0},InputProps:{value:y,endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,null,"lock_outline")),autoComplete:"new-password",onChange:function(e){b(e.target.value)}},autoComplete:"new-password",value:y,max:6}),i.a.createElement("div",{style:(n={display:"flex",padding:"7px 15px",margin:"auto",cursor:"pointer",backgroundColor:"red",marginTop:"15px"},Object(O.a)(n,"display","flex"),Object(O.a)(n,"alignItems","center"),Object(O.a)(n,"justifyContent","center"),Object(O.a)(n,"borderRadius","7px"),n),onClick:function(){w()}},i.a.createElement(rn,{icon:"toggle_on",text:lt("$__disableToken","*"),title:lt("$__disableToken","*"),iconColor:dt("lightText"),textColor:dt("lightText")}))):i.a.createElement("div",{style:{position:"relative",width:"100%",textAlign:"center",padding:"15px"}},i.a.createElement("div",{style:{position:"relative",width:"100%"}},f.image&&i.a.createElement("img",{src:f.image})),i.a.createElement("div",{style:{textAlign:"left"}},i.a.createElement("p",null,lt("$__tokenTip_1")),i.a.createElement("p",null,lt("$__tokenTip_2")),i.a.createElement("ul",null,i.a.createElement("li",null,lt("$__tokenTip_3")),i.a.createElement("li",null,lt("$__tokenTip_4")),i.a.createElement("li",null,lt("$__tokenTip_5")),i.a.createElement("li",null,lt("$__tokenTip_6")),i.a.createElement("li",null,lt("$__tokenTip_7")))),i.a.createElement("fieldset",null,i.a.createElement("legend",null,lt("$__token",1)),i.a.createElement(La,{label:lt("$__token",1),variant:"standard",name:"token",type:"password",InputLabelProps:{shrink:!0},InputProps:{value:y,endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,null,"lock_outline")),autoComplete:"new-token",onChange:function(e){b(e.target.value)}},placeholder:lt("$__token","*"),autoComplete:"new-token",value:y,max:6})),!f.status&&y&&6===y.length&&i.a.createElement("div",{style:(r={display:"flex",padding:"7px 15px",margin:"auto",cursor:"pointer",backgroundColor:"green",marginTop:"15px"},Object(O.a)(r,"display","flex"),Object(O.a)(r,"alignItems","center"),Object(O.a)(r,"justifyContent","center"),Object(O.a)(r,"borderRadius","7px"),r),onClick:function(){_()}},i.a.createElement(rn,{icon:"check",text:lt("$__activeToken","*"),title:!lt("$__activeToken","*"),iconColor:dt("lightText"),textColor:dt("lightText")}))))})));function vl(){vl=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var yl=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(pl)((function(e){var t=e.classes,r=De.getState(),n=r.sideModule,a=r.db,c=i.a.useState(n.data),l=Object(Be.a)(c,2),s=l[0],u=l[1],d=Object(o.useState)(n.data),p=Object(Be.a)(d,2),f=p[0],m=(p[1],i.a.useState(n.data&&n.data.language?n.data.language:"pt-BR")),g=Object(Be.a)(m,2),v=g[0],y=g[1],b=JSON.stringify(f)!==JSON.stringify(s),x=function(t){var r=Object(h.a)(Object(h.a)({},s),{},Object(O.a)({},t.name,t.value));"language"===t.name&&y(t.value),!t.value&&r[t.name]&&delete r[t.name],e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},n),{},{data:r})),u(r)},_=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];b&&!t?ft({message:lt("$__confirmCloseWithUnsavedData",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){e.reduxFunction("ASYNC","CLEAR_MODULE")}}):e.reduxFunction("ASYNC","CLEAR_MODULE")},w=function(){var t=Object(Me.a)(vl().mark((function t(r){return vl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Va(e);case 2:t.sent&&(ft({message:lt("$__userDataSaved",1),variant:null,persist:!1,horizontal:"right",confirm:null}),s.language!==v&&e.reduxFunction("ASYNC","SET_SESSION",Object(h.a)(Object(h.a)({},De.getState().session),{},{language:v})),r&&(_(!0),s.language!==v&&setTimeout((function(){window.location.reload()}),1500)));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();console.log(f,s);var E=xt(),j=!1;return E&&E.user&&(E.userAdmin||E.userEdit)&&(j=!0),i.a.createElement("div",null,i.a.createElement(Nc,{save:b?function(){return w()}:null,saveClose:b?function(){return w(!0)}:null,close:function(){return _(!0)}}),i.a.createElement("div",{style:{position:"relative",width:"100%",textAlign:"center",padding:"15px"}},i.a.createElement("fieldset",null,i.a.createElement("legend",null,lt("$__language",1)),i.a.createElement(Zc,{id:"combo-box-demo",options:a.languages,getOptionLabel:function(e){return lt(e.label,1)},style:{width:"100%"},name:"status",disableClearable:!0,value:s&&s.language&&a.languages?a.languages.filter((function(e){return String(e.value)===String(s.language)}))[0]:a.languages[0],renderInput:function(e){return i.a.createElement(La,Object.assign({},e,{label:lt("$__language",1),variant:dt("fieldVariant"),value:s&&s.language&&a.languages?a.languages.filter((function(e){return String(e.value)===String(s.language)}))[0]:a.languages[0]}))},onChange:function(e,t){x({name:"language",value:t.value})}})),i.a.createElement("fieldset",null,i.a.createElement("legend",null,lt("$__sessionDuration",1)),i.a.createElement("div",null,lt("$__sessionDurationDescription",1)),i.a.createElement(Zc,{id:"combo-box-demo",options:a.expiresIn,getOptionLabel:function(e){return lt(e.label,1)},style:{width:"100%"},name:"status",disableClearable:!0,value:s&&s.expiresIn&&a.expiresIn?a.expiresIn.filter((function(e){return String(e.value)===String(s.expiresIn)}))[0]:a.expiresIn.filter((function(e){return!e.value}))[0],renderInput:function(e){return i.a.createElement(La,Object.assign({},e,{label:lt("$__expiresIn",1),variant:dt("fieldVariant"),value:s&&s.expiresIn&&a.expiresIn?a.expiresIn.filter((function(e){return String(e.value)===String(s.expiresIn)}))[0]:a.expiresIn.filter((function(e){return!e.value}))[0]}))},onChange:function(e,t){x({name:"expiresIn",value:t.value})}})),De.getState().session.isResale&&"user"!==s.type?i.a.createElement("fieldset",{style:{marginBottom:"14px"}},De.getState().db.users[s._id].independentAccount?i.a.createElement("div",{style:{color:"gray",fontSize:11}},lt("$__thisIsAIndependentAccountExplain",1)):i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:t.switch},i.a.createElement(vi,{checked:!!s.independentAccount,onChange:function(e){j&&x({name:"independentAccount",value:!s.independentAccount})},name:"independentAccount",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__turnIntoIndependentAccount",1)),i.a.createElement("div",{style:{color:"gray",fontSize:11}},lt("$__turnIntoIndependentAccountExplain",1)))):i.a.createElement(i.a.Fragment,null)))}))),bl=r(571),xl=r.n(bl),_l=r(1015);r(801);var wl=i.a.forwardRef((function(e,t){return i.a.createElement("div",{style:{display:"flex",width:"100%",padding:"7px 7px",fontSize:"12px",fontWeight:400,lineHeight:1.5,color:"#212529",backgroundColor:"#fff",border:"1px solid #ced4da",borderRadius:3,transition:"border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out",appearance:"none",justifyContent:"space-between"},onClick:e.onClick},i.a.createElement("label",{onClick:e.onClick,ref:t,style:{marginRight:7,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},e.value||e.placeholder),i.a.createElement(kt,{size:"22px",color:dt("color"),icon:"today",onClick:e.onClick}))})),El=function(e){return Object(bl.registerLocale)("pt",_l.a),i.a.createElement("div",{style:Object(h.a)(Object(h.a)(Object(h.a)({width:"100%"},e.horizontal?{display:"flex",alignItems:"center"}:{}),e.style?e.style:{}),{},{justifyContent:"center"})},i.a.createElement("div",{style:Object(h.a)({},e.horizontal?{width:e.onClear?"calc(50% - 11px)":""}:{})},i.a.createElement(xl.a,Object.assign({locale:"pt",placeholderText:e.placeholder?e.placeholder:lt("$__pleaseSelectStartDate"),selected:e.startDate?e.startDate:null,onChange:e.onChangeStartDate?function(t){e.onChangeStartDate(t)}:null,selectsStart:!0,startDate:e.startDate?e.startDate:null,endDate:e.endDate?e.endDate:null,maxDate:!e.range&&e.maxDate?e.maxDate:null},e.type&&"datetime"===e.type?{timeInputLabel:lt("$__time"),dateFormat:"dd/MM/yyyy HH:mm",showTimeInput:!0}:{dateFormat:"dd/MM/yyyy"},{customInput:i.a.createElement(wl,null),showYearDropdown:!0}))),e.range?i.a.createElement("div",{style:Object(h.a)({},e.horizontal?{marginLeft:7,width:e.onClear?"calc(50% - 18px)":"calc(50% - 7px)"}:{marginTop:7})},i.a.createElement(xl.a,Object.assign({locale:"pt",placeholderText:lt("$__pleaseSelectEndDate"),selected:e.endDate?e.endDate:null,onChange:e.onChangeEndDate?function(t){e.onChangeEndDate(t)}:null,selectsEnd:!0,startDate:e.startDate?e.startDate:null,endDate:e.endDate?e.endDate:null,minDate:e.minDate?e.minDate:e.range&&e.startDate?e.startDate:null},e.type&&"datetime"===e.type?{timeInputLabel:lt("$__time"),dateFormat:"dd/MM/yyyy HH:mm",showTimeInput:!0}:{dateFormat:"dd/MM/yyyy"},{maxDate:e.maxDate?e.maxDate:null,customInput:i.a.createElement(wl,null),showYearDropdown:!0}))):i.a.createElement(i.a.Fragment,null),e.onClear&&(e.startDate||e.endDate)?i.a.createElement("div",{style:Object(h.a)({display:"flex",justifyContent:e.clearButtonPosition?e.clearButtonPosition:"center"},e.horizontal?{}:{paddingTop:3})},i.a.createElement(At,Object.assign({color:dt("lightgray"),icon:"clear",onClick:e.onClear,size:"15px"},e.horizontal?{}:{title:lt("$__clearDate","*"),text:lt("$__clearDate","*")}))):i.a.createElement(i.a.Fragment,null))};function Ol(){Ol=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var jl=Object($e.b)((function(){return{}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(pl)((function(e){var t=e.classes,r=De.getState(),n=r.sideModule,a=r.db,c=Object(o.useState)(n.data),l=Object(Be.a)(c,2),s=l[0],u=l[1],d=Object(o.useState)(n.data),p=Object(Be.a)(d,2),f=p[0],m=p[1],g=JSON.stringify(s)!==JSON.stringify(f),v=function(t){var r=Object(h.a)(Object(h.a)({},s),{},Object(O.a)({},t.name,t.value));e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},n),{},{data:Object(h.a)(Object(h.a)({},n.data),{},Object(O.a)({},t.name,t.value))})),!t.value&&r[t.name]&&delete r[t.name],u(r)},y=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];g&&!t?ft({message:lt("$__confirmCloseWithUnsavedData",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){e.reduxFunction("ASYNC","CLEAR_MODULE")}}):e.reduxFunction("ASYNC","CLEAR_MODULE")},b=function(){var t=Object(Me.a)(Ol().mark((function t(r){return Ol().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Va(e);case 2:t.sent&&(ft({message:lt("$__userDataSaved",1),variant:null,persist:!1,horizontal:"right",confirm:null}),m(s),r&&y(!0));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),x=xt(),_=!1;return x&&x.user&&(x.userAdmin||x.userEdit)&&(_=!0),i.a.createElement("div",null,i.a.createElement(Nc,{save:g?function(){return b()}:null,saveClose:g?function(){return b(!0)}:null,close:function(){return y(!0)}}),i.a.createElement("div",{style:{position:"relative",width:"100%",textAlign:"center",padding:"15px"}},i.a.createElement("fieldset",null,i.a.createElement("legend",null,lt("$__limitNumberOfUsers",1)),i.a.createElement("div",null,lt("$__limitAdminUsersExplain",1),i.a.createElement(La,{label:lt("$__numberOfUsers"),variant:"outlined",name:"customAdmins",type:"number",min:0,max:99999,InputLabelProps:{shrink:!0},InputProps:{type:"number",onChange:function(e){0===e.target.value?v({name:"customAdmins",value:null}):v({name:"customAdmins",value:e.target.value>0?e.target.value:0})}},value:s.customAdmins||0}))),De.getState().session.isResale?i.a.createElement("fieldset",{style:{marginBottom:"14px"}},De.getState().db.users[s._id].independentAccount?i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{color:"gray",fontSize:11,width:"100%"}},lt("$__thisIsAIndependentAccountExplain",1)),i.a.createElement("ul",{style:{color:"gray",fontSize:12,width:"100%",textAlign:"initial"}},s.plan?i.a.createElement("li",null,lt("$__signaturePlan",1),": ",lt(a.plans.filter((function(e){return String(e.value)===String(s.plan)}))[0].label,1)):i.a.createElement(i.a.Fragment,null),s.expireAccountDate?i.a.createElement("li",null,lt("$__expireAccountDate",1),": ",Ac()(1e3*s.expireAccountDate).format("DD/MM/YYYY")):i.a.createElement(i.a.Fragment,null))):i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:t.switch},i.a.createElement(vi,{checked:!!s.independentAccount,onChange:function(e){_&&v({name:"independentAccount",value:!s.independentAccount})},name:"independentAccount",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__turnIntoIndependentAccount",1)),i.a.createElement("div",{style:{color:"gray",fontSize:11}},lt("$__turnIntoIndependentAccountExplain",1)))):i.a.createElement(i.a.Fragment,null),(!f.independentAccount&&s.plan||!s.plan)&&s.independentAccount?i.a.createElement(i.a.Fragment,null,i.a.createElement("fieldset",{style:{marginBottom:"14px"}},i.a.createElement(Zc,{id:"combo-box-demo",options:a.plans,getOptionLabel:function(e){return lt(e.label,1)},style:{width:"100%"},name:"plans",disableClearable:!0,value:s&&s.plan&&a.plans?a.plans.filter((function(e){return String(e.value)===String(s.plan)}))[0]:a.plans[0],renderInput:function(e){return i.a.createElement(La,Object.assign({},e,{label:lt("$__demoPlanSignature",1),variant:dt("fieldVariant"),value:s&&s.plan&&a.plans?a.plans.filter((function(e){return String(e.value)===String(s.plan)}))[0]:a.plans[0]}))},onChange:function(e,t){_&&v({name:"plan",value:t.value})}}))):i.a.createElement(i.a.Fragment,null),s.independentAccount&&s.plan&&"p0"!==s.plan&&!f.expireAccountDate?i.a.createElement(El,{placeholder:lt("$__dueDate"),clearButtonPosition:"flex-end",onChangeStartDate:function(e){v({name:"expireAccountDate",value:String(Ac()(e).unix("X"))})},maxDate:new Date(1e3*Ac()().add("days",30).unix("X")),startDate:s&&s.expireAccountDate?new Date(1e3*s.expireAccountDate):null}):i.a.createElement(i.a.Fragment,null)))}))),Sl=r(986),kl=r.n(Sl),Ll=r(987),Cl=r.n(Ll);function Il(){Il=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Fl=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(pl)((function(e){e.classes;var t,r=De.getState(),n=r.sideModule,a=(r.db,r.session,r.functions.socket,n.data,i.a.useState(!1)),c=Object(Be.a)(a,2),l=c[0],s=(c[1],i.a.useState((t={image:null},Object(O.a)(t,"image",null),Object(O.a)(t,"status",!1),t))),u=Object(Be.a)(s,2),d=(u[0],u[1],i.a.useState(null)),p=Object(Be.a)(d,2);p[0],p[1],Object(o.useEffect)((function(){f()}),[]);var f=function(){var e=Object(Me.a)(Il().mark((function e(){return Il().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return i.a.createElement("div",null,i.a.createElement(Nc,{close:function(){l?ft({message:lt("$__confirmCloseWithUnsavedData",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){e.reduxFunction("ASYNC","CLEAR_MODULE")}}):e.reduxFunction("ASYNC","CLEAR_MODULE")}}),i.a.createElement("div",{style:{position:"relative",width:"100%",textAlign:"center",padding:"15px"}},i.a.createElement("div",{style:{textAlign:"left"}},i.a.createElement("p",null,lt("$__mobileTokenTip_1")),i.a.createElement("ul",null,i.a.createElement("li",null,lt("$__mobileTokenTip_2")),i.a.createElement("li",null,lt("$__mobileTokenTip_3")),i.a.createElement("li",null,lt("$__mobileTokenTip_4")))),i.a.createElement("img",{src:Cl.a,style:{width:"52%"}}),i.a.createElement("img",{src:kl.a,style:{width:"52%",marginTop:"33px"}})))}))),Tl=function(){return{lock:{position:"fixed",top:"0px",left:"0px",right:"0px",bottom:"0px",height:"100vh",zIndex:"3000 !important"},backdrop:{position:"fixed",top:"0px",left:"0px",right:"440px",bottom:"0px",height:"100vh",backgroundColor:"rgba(0,0,0,0.7)"},module:Object(h.a)(Object(h.a)({},rr),{},{position:"absolute",right:"0px",top:"0px",bottom:"0px",minWidth:"500px",width:"25%",zIndex:"1100",backgroundColor:"rgba(255,255,255,1)"}),modulePopup:Object(h.a)(Object(h.a)({},rr),{},{width:"70vw",position:"absolute",zIndex:"1100",left:"calc(50% - 35vw)",backgroundColor:"rgba(255,255,255,1)",height:"80vh",top:"calc(50% - 40vh)",boxShadow:"0px 0px 20px rgba(0,0,0,0.2)",padding:"0px 5px",border:"solid 2px #ffffff"}),moduleExpanded:Object(h.a)(Object(h.a)({},rr),{},{width:"90vw",position:"absolute",zIndex:"1100",left:"calc(50% - 45vw)",backgroundColor:"rgba(255,255,255,1)",height:"80vh",bottom:"0px",boxShadow:"0px 0px 20px rgba(0,0,0,0.2)",padding:"0px 5px",border:"solid 2px #ffffff"}),moduleFullScreen:Object(h.a)(Object(h.a)({},rr),{},{width:"100vw",position:"absolute",zIndex:"1100",left:"0px",backgroundColor:"rgba(255,255,255,1)",height:"100vh",bottom:"0px",boxShadow:"0px 0px 20px rgba(0,0,0,0.2)",padding:"0px 5px",border:"solid 2px #ffffff"}),menu:{position:"absolute",left:"0px",width:"45px",top:"0px",bottom:"0px",textAlign:"center"},content:{position:"absolute",top:"80px",left:"45px",bottom:"0px",right:"0px",padding:"0px",overflowY:"auto",overflowX:"hidden",zIndex:1},menuButtons_resume:{margin:"0px auto 27px auto",height:"40px"},MenuButton:{margin:"auto auto",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},MenuButton_arrow:{position:"absolute",right:"-8px",fontSize:"16px",transform:"rotate(180deg)"},subTitle:{position:"absolute",left:"45px",right:"0px",padding:"4px 10px",top:"47px",backgroundColor:dt("color"),color:dt("light")}}},Nl=Object($e.b)((function(e){return{timeline:e.timeline&&e.sideModule.id&&e.timeline[e.sideModule.id]?e.timeline[e.sideModule.id]:{},card:e.db.cards&&e.db.cards[e.sideModule.id]?e.db.cards[e.sideModule.id]:{},sideModule:e.sideModule}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Tl)((function(e){var t=e.classes,r=e.sideModule,n={};return e.count&&(n=ma(r.id)),i.a.createElement("div",{className:t.MenuButton,id:"sideModule_buttom_".concat(e.module)},i.a.createElement(Tt.a,{onClick:function(){e.openModule(e.module)}},i.a.createElement(Pt.a,{overlap:"rectangular",badgeContent:e.count&&n&&n[e.count]?n[e.count]:null,color:"secondary"},i.a.createElement(kt,{icon:e.icon,size:e.size,color:r.activeModule===e.module?dt("active"):dt("colorText"),title:e.title})),r.activeModule===e.module&&i.a.createElement(kt,{className:t.MenuButton_arrow,color:r.activeModule===e.module?dt("active"):dt("colorText"),icon:"play_arrow"})))}))),Pl=r(1802),Dl=r(988),Al=r.n(Dl);function $l(e){var t=i.a.useState(!1),r=Object(Be.a)(t,2),n=r[0],a=r[1],o=i.a.useRef(null),c=i.a.useState(0),l=Object(Be.a)(c,2),s=l[0],u=l[1];i.a.useEffect((function(){u(e.value?e.value:e.defaultValue?e.defaultValue:0)}),[e.value]);var d=function(){a((function(e){return!e}))},p=function(e){o.current&&o.current.contains(e.target)||a(!1)};return i.a.createElement(i.a.Fragment,null,i.a.createElement(Pl.a,{variant:"text",ref:o,"aria-label":"split button"},i.a.createElement(Nt.a,{onClick:function(){u(s),e.onChange&&e.onChange(s)}},e.options.filter((function(e){return e.value===s})).length>0&&e.options.filter((function(e){return e.value===s}))[0].label),i.a.createElement(Nt.a,{size:"small","aria-controls":n?"split-button-menu":void 0,"aria-expanded":n?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:d},i.a.createElement(Al.a,null))),i.a.createElement(mn.a,{open:n,anchorEl:o.current,role:void 0,transition:!0},(function(t){var r=t.TransitionProps,n=t.placement;return i.a.createElement(fn.a,Object.assign({},r,{style:{transformOrigin:"bottom"===n?"center top":"center bottom"}}),i.a.createElement(hn.a,null,i.a.createElement(pn.a,{onClickAway:p},i.a.createElement(_n.a,{id:"split-button-menu"},e.options.map((function(t,r){return i.a.createElement(xn.a,{key:t.value,selected:t.value===s,onClick:function(){u(t.value),d(),e.onChange&&e.onChange(t.value)}},t.label)}))))))})))}var zl=Object(Lt.a)((function(e){return{root:{position:"relative",width:"100%"},options:{position:"relative",width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",borderBottom:"solid 1px rgba(0,0,0,0.05)",marginTop:"7px"},custom:{position:"relative",width:"100%",padding:"7px",backgroundColor:"rgba(0,0,0,0.05)",marginTop:"7px"},margin:{height:e.spacing(3)}}})),Ml={recurrence:"0",recurrenceRepeatDays:null,recurrenceEndDate:null,recurrenceLimit:null,recurrenceMyDay:null,recurrenceOnlyCompleted:null,recurrenceDuplicateCard:null};var Bl=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=i.a.useState({recurrence:"0"}),r=Object(Be.a)(t,2),n=r[0],a=r[1],o=zl();i.a.useEffect((function(){a({recurrence:e.data&&e.data.recurrence?e.data.recurrence:"0",recurrenceRepeatDays:e.data&&e.data.recurrenceRepeatDays?e.data.recurrenceRepeatDays:null,recurrenceEndDate:e.data&&e.data.recurrenceEndDate?e.data.recurrenceEndDate:null,recurrenceLimit:e.data&&e.data.recurrenceLimit?e.data.recurrenceLimit:null,recurrenceMyDay:e.data&&e.data.recurrenceMyDay?e.data.recurrenceMyDay:null,recurrenceOnlyCompleted:e.data&&e.data.recurrenceOnlyCompleted?e.data.recurrenceOnlyCompleted:null,recurrenceDuplicateCard:e.data&&e.data.recurrenceDuplicateCard?e.data.recurrenceDuplicateCard:null})}),[]),i.a.useEffect((function(){}),[e.data.startDate]);var c=function(t){var r=t;isNaN(t.recurrence)&&"custom"!==t.recurrence||(r=function(t){var r=t.recurrence;"custom"===t.recurrence&&(r=t.recurrenceRepeatDays);var n=Ve()(1e3*e.data.startDate).tz("America/Sao_Paulo").add(r,"d").format("YYYY-MM-DD");return Ve()(1e3*e.data.startDate).tz("America/Sao_Paulo").add(r,"d").unix("X")<Ve()().tz("America/Sao_Paulo").unix("X")&&(n=Ve()().tz("America/Sao_Paulo").add(r,"d").format("YYYY-MM-DD")),Object(h.a)(Object(h.a)({},t),{},{recurrenceNextDate:n})}(t)),t.recurrence&&parseInt(t.recurrence)>0&&parseInt(t.recurrence)<31&&(r=Object(h.a)(Object(h.a)({},r),{},{recurrenceNextDate:Ve()().tz("America/Sao_Paulo").add(parseInt(t.recurrence),"days").format("YYYY-MM-DD")})),"everyFriday"===t.recurrence&&(r=Object(h.a)(Object(h.a)({},r),{},{recurrenceNextDate:Ve()().tz("America/Sao_Paulo").add(1,"weeks").isoWeekday(5).format("YYYY-MM-DD")})),"everyMonday"===t.recurrence&&(r=Object(h.a)(Object(h.a)({},r),{},{recurrenceNextDate:Ve()().tz("America/Sao_Paulo").add(1,"weeks").isoWeekday(1).format("YYYY-MM-DD")})),"everyFirstMonthDay"===t.recurrence&&(r=Object(h.a)(Object(h.a)({},r),{},{recurrenceNextDate:Ve()().tz("America/Sao_Paulo").add(1,"month").format("YYYY-MM-01")})),a(r),e.onChange&&e.onChange(r)};return i.a.createElement("div",{id:"RecurrencySettings",className:o.root},i.a.createElement("div",{className:o.options},lt("$__recurrence"),i.a.createElement($l,{options:[{value:"0",label:lt("$__nonrecurrence")},{value:"1",label:lt("$__everyDay")},{value:"7",label:lt("$__weekly")},{value:"15",label:lt("$__every15days")},{value:"30",label:lt("$__every30days")},{value:"everyFirstMonthDay",label:lt("$__everyFirstMonthDay")},{value:"everyMonday",label:lt("$__everyMonday")},{value:"everyFriday",label:lt("$__everyFriday")},{value:"custom",label:lt("$__custom")}],value:n&&n.recurrence?n.recurrence:"0",onChange:function(e){c("0"===e?Object(h.a)(Object(h.a)({},Ml),{},{recurrence:null,recurrenceRepeatDays:null}):"custom"!==e?{recurrence:"".concat(e),recurrenceRepeatDays:null}:Object(h.a)(Object(h.a)({},n),{},{recurrence:"".concat(e),recurrenceNextDate:null,recurrenceRepeatDays:1}))}})),n&&n.recurrence&&"0"!==String(n.recurrence)&&i.a.createElement("div",{className:o.custom},lt("$__preffers",1),n&&"custom"===n.recurrence&&i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},lt("$__repeatEvery",1),i.a.createElement(La,{style:{width:"100px"},variant:dt("standard"),name:"recurrenceRepeatDays",type:"number",min:"1",InputLabelProps:{shrink:!0},InputProps:{min:1,autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"replay_10"}),lt("$__days").toLowerCase()),onChange:function(e){parseInt(e.target.value)>0&&c(Object(h.a)(Object(h.a)({},n),{},{recurrenceRepeatDays:e.target.value}))}},defaultValue:n.recurrenceRepeatDays?n.recurrenceRepeatDays:1})),i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},lt("$__limitDate",1),i.a.createElement(La,{style:{width:"200px"},variant:dt("standard"),name:"endDate",InputLabelProps:{shrink:!0},type:"date",InputProps:{endAdornment:n.recurrenceEndDate?i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"clear",onClick:function(){c(Object(h.a)(Object(h.a)({},n),{},{recurrenceEndDate:null}))}})):null,autoComplete:"new-password",onBlur:function(e){c(Object(h.a)(Object(h.a)({},n),{},{recurrenceEndDate:e.target.value?Ve()(e.target.value).tz("America/Sao_Paulo").format("YYYY-MM-DD"):null}))},onChange:function(e){c(Object(h.a)(Object(h.a)({},n),{},{recurrenceEndDate:e.target.value?Ve()(e.target.value).tz("America/Sao_Paulo").format("YYYY-MM-DD"):null}))}},defaultValue:e.data.recurrenceEndDate?e.data.recurrenceEndDate:null})),i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},lt("$__recurrenceDuplicateCard",1),i.a.createElement(vi,{checked:!!n.recurrenceDuplicateCard,onChange:function(e){c(Object(h.a)(Object(h.a)({},n),{},{recurrenceDuplicateCard:!n.recurrenceDuplicateCard},n.recurrenceDuplicateCard?{recurrenceCopyCatenation:!1}:{}))},name:"duplicate",inputProps:{"aria-label":"secondary checkbox"}})),n.recurrenceDuplicateCard&&i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},lt("$__copyCatenation",1),i.a.createElement(vi,{checked:!!n.recurrenceCopyCatenation,onChange:function(e){c(Object(h.a)(Object(h.a)({},n),{},{recurrenceCopyCatenation:!n.recurrenceCopyCatenation}))},name:"recurrenceCopyCatenation",inputProps:{"aria-label":"secondary checkbox"}}))))}));function Yl(){Yl=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Gl=Object($e.b)((function(e){return{tags:e.db.tag}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(ol)((function(e){var t=i.a.useState([]),r=Object(Be.a)(t,2),n=r[0],a=r[1],o=xt();i.a.useEffect((function(){if(e.data.values){var t=[];e.data.values.map((function(e){De.getState().db.tag.filter((function(t){return t.value===e.value})).length>0&&t.push(e)})),a(t)}}),[e.data]);var c=function(){var t=Object(Me.a)(Yl().mark((function t(r){return Yl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.callBack&&e.callBack(r),a(r);case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return i.a.createElement("div",null,i.a.createElement(al,{dbNode:e.dbNode?e.dbNode:"tag",secondaryParent:e.secondaryParent?e.secondaryParent:null,options:De.getState().db.tag?De.getState().db.tag:[],style:{width:"100%"},name:"tag",ws:!0,title:lt("$__tags"),api:"tag/add",add:!0,colorPicker:!(!o||!o.plan||!o.planAdmin&&!o.planModerate),multiple:!0,freeSolo:!0,disableClearable:!0,disabled:!!e.disabled,value:n,placeholder:e.placeholder||null,onChange:function(e){c(e)},colorPickerCallBack:function(e){De.getState().functions.socket.emit("tag.UPD",e)}}))})));function Rl(){Rl=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Hl=[{label:"$__strategic",value:null,swot:!0,description:"$__strategicPlanDescription"},{label:"$__tacticAndOrOperational",value:"operational",swot:!1,description:"$__operationalPlanDescription"}];var Wl=Object($e.b)((function(e){return{sideModule:e.sideModule,card:e.db.cards[e.sideModule.id],cards:e.db.cards}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(ll)((function(e){var t,r=e.classes,n=e.sideModule,a=De.getState(),o=a.db,c=a.session,l=i.a.useState({}),u=Object(Be.a)(l,2),d=u[0],p=u[1],m=i.a.useState({}),g=Object(Be.a)(m,2),v=g[0],y=g[1],b=i.a.useState(!1),x=Object(Be.a)(b,2),_=x[0],w=x[1],E=i.a.useState(!1),j=Object(Be.a)(E,2),S=j[0],k=j[1],L=i.a.useState(!1),C=Object(Be.a)(L,2),I=C[0],F=C[1],T=i.a.useState(!1),N=Object(Be.a)(T,2),P=N[0],D=N[1],A=i.a.useState(null),$=Object(Be.a)(A,2),z=$[0],M=$[1],B=i.a.useState(null),Y=Object(Be.a)(B,2),R=Y[0],H=Y[1],W=i.a.useState(!1),U=Object(Be.a)(W,2),V=U[0],q=U[1],X=i.a.useState(0),J=Object(Be.a)(X,2),K=J[0],Z=J[1],Q=i.a.useState(!1),ee=Object(Be.a)(Q,2),te=ee[0],re=ee[1],ne=xt(),ae=ia(n.id);i.a.useEffect((function(){d._id!==n.data._id&&(p(n.data),w(!1)),P||(n.data.startDate&&M(n.data&&n.data.startDate?n.data.startDate:null),n.data.endDate&&H(n.data&&n.data.endDate?n.data.endDate:null),p(n.data),w(!1),"link"!==d.type||d.name||se(),D(!0),oe()),n.data.name&&""!==n.data.name.trim()&&"link"===n.data.type&&"new"===n.data._id&&(w(!0),e.reqSave&&e.reqSave(!0))}),[n.data,d]),i.a.useEffect((function(){!d.name||d.name&&""===d.name.trim?w(!1):w(!0)}),[v]);var oe=function(){var t=Object(Me.a)(Rl().mark((function t(){return Rl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,In(Object(h.a)(Object(h.a)({},e),{},{ignoreLoader:!0}),{idRel:[n.data._id],cardLoad:"parents"});case 2:t.sent&&re(!1);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ie=function(t,r){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(t.value&&!n.data[t.name]&&!d[t.name]||n.data[t.name]&&n.data[t.name]!==t.value||a)&&e.reqSave&&e.reqSave(!0);var o=Object(h.a)(Object(h.a)({},d),{},Object(O.a)({},t.name,t.value));r&&r.name&&r.value&&(o=Object(h.a)(Object(h.a)(Object(h.a)({},d),o),{},Object(O.a)({},r.name,r.value))),p(o),y(Object(h.a)(Object(h.a)({},v),{},Object(O.a)({},t.name,t.value),r&&r.name&&r.value?Object(O.a)({},r.name,r.value):{}))},ce=function(t){_&&!t?ft({message:lt("$__confirmCloseWithUnsavedData",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){e.reduxFunction("ASYNC","CLEAR_MODULE")}}):e.reduxFunction("ASYNC","CLEAR_MODULE")},le=function(){var t=Object(Me.a)(Rl().mark((function t(){var r,a=arguments;return Rl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=a.length>0&&void 0!==a[0]&&a[0],S){t.next=19;break}if(w(!1),e.reqSave&&e.reqSave(!1),d.status||(d.status="notStarted"),"new"===n.id&&n.data&&p(Object(h.a)(Object(h.a)({},d),n.data)),e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},n),{},{data:d})),d.name&&(!d.name||""!==d.name.trim())){t.next=12;break}k(!1),ft({message:lt("$__fillName",1),variant:"warning",persist:!1,horizontal:"right",confirm:null}),t.next=19;break;case 12:return t.next=14,An(Object(h.a)(Object(h.a)({},e),{},{store:Object(h.a)(Object(h.a)({},e.store),{},{db:Object(h.a)({},De.getState().db)})}),r,d);case 14:t.sent&&(v&&v.status&&(da(Object(h.a)(Object(h.a)({},e),{},{data:{_id:d._id}}),{status:v.status}),ha(e,d._id,v.status)),k(!1),ft({message:lt("$__DataSaved",1),variant:null,persist:!1,horizontal:"right",confirm:null})),w(!1),e.reqSave&&e.reqSave(!1),r&&ce(!0);case 19:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),se=function(){var t=Object(Me.a)(Rl().mark((function t(){var r;return Rl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ot.post("/link/content",{url:d.url});case 2:r=t.sent,p(Object(h.a)(Object(h.a)({},d),{},{content:r.data.article})),w(!0),e.reqSave&&e.reqSave(!0);case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ue=n.data&&n.data.type?o.dataType.filter((function(e){return e.name===n.data.type}))[0]:{},de=null;if(d._parent&&(de=De.getState().db.cards[d._parent]),!d)return null;var pe=De.getState().db.cards[d._id]&&De.getState().db.cards[d._id]._users&&De.getState().db.cards[d._id]._users[c._id]&&De.getState().db.cards[d._id]._users[c._id].myDay?De.getState().db.cards[d._id]._users[c._id].myDay:null,fe=!!(!pe||pe&&pe&&Ve()(new Date(1e3*pe)).format("YYYY/MM/DD")!==Ve()().format("YYYY/MM/DD")),he=d.isTemplate?d.isTemplate:la(d._id),me=!!e.permission&&e.permission;!d||!d._planId||o.cards[d._planId]&&va(d._planId)||(me=!1),!me&&parseInt(ae)>=4&&(me=!0),!me&&va(d._planId)&&ne&&ne.admin&&ne.plan&&(ne.planAdmin||ne.planModerate)&&(me=!0);var ge=!1,ve=i.a.createElement(i.a.Fragment,null);if(d&&d.url&&d.url.indexOf(".youtube.com/watch?")>-1){var ye=d.url.split("?")[1].split("v=")[1].split("&")[0];ye&&(ve=i.a.createElement("iframe",{width:"560",height:"315",style:{top:0,width:"100%",maxWidth:"500px",height:"100%",alignSelf:"center",position:"absolute",overflow:"hidden"},src:"https://www.youtube.com/embed/".concat(ye),title:"YouTube video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}),ge=!0)}if(d&&d.url&&d.url.indexOf("//youtu.be/")>-1){var be=d.url.split(".be/")[1];be&&(ve=i.a.createElement("iframe",{width:"560",height:"315",style:{top:0,width:"100%",maxWidth:"500px",height:"100%",alignSelf:"center",position:"absolute",overflow:"hidden"},src:"https://www.youtube.com/embed/".concat(be),title:"YouTube video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}),ge=!0)}return i.a.createElement(i.a.Fragment,null,i.a.createElement(Nc,{save:_?function(){k(!0),le()}:null,saveClose:_?function(){k(!0),le(!0)}:null,saveLoader:S,close:function(){e.onClose&&e.onClose()}}),i.a.createElement("div",{className:r.root},ge?i.a.createElement("div",{style:{backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center",paddingTop:"48%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative",float:"left",width:"100%"}},ve):i.a.createElement(i.a.Fragment,null),me&&(!ue.hideFields||ue.hideFields&&-1===ue.hideFields.indexOf("imageUpload"))&&i.a.createElement(Zi,{img:d?d.image:null,onChange:function(e,t){ie({name:"image",value:e}),ie({name:"file",value:t})},files:d._files?d._files:{},maxWidthOrHeight:600,avatar:"chatGroup"===d.type,aspectRatio:"chatGroup"===d.type?null:16/9,onDelete:function(){ie({name:"image",value:null},{name:"file",value:null},!0)}}),!me&&d.image&&i.a.createElement("div",{className:r.image,style:{backgroundImage:"url(".concat(d.image,")")}}),"plan"!==d.type||d._id?i.a.createElement(i.a.Fragment,null):i.a.createElement("fieldset",{style:{marginBottom:"14px",marginTop:30}},i.a.createElement(Zc,{id:"combo-box-demo",options:Hl,getOptionLabel:function(e){return lt(e.label,1)},style:{width:"100%"},name:"planType",disableClearable:!0,value:d&&d.planType?Hl.filter((function(e){return e.value===d.planType}))[0]:Hl[0],renderInput:function(e){return i.a.createElement(La,Object.assign({},e,{label:lt("$__planType",1),variant:dt("fieldVariant"),value:d&&d.planType?Hl.filter((function(e){return e.value===d.planType}))[0]:Hl[0]}))},onChange:function(e,t){ie({name:"planType",value:t.value})}}),Hl.filter((function(e){return!d.planType||d.planType&&e.value===d.planType&&!0===e.swot})).length>0?i.a.createElement("div",{style:{position:"relative",width:"100%"}},i.a.createElement("div",{style:{width:"fit-content",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold",color:dt("color")}},i.a.createElement(kt,{icon:G.a,color:dt("color"),size:25}),i.a.createElement("span",{style:{marginLeft:15}},"MATRIX SWOT"))):i.a.createElement(i.a.Fragment,null),Hl.filter((function(e){return!d.planType||d.planType&&e.value===d.planType&&!0===e.swot})).length>0?i.a.createElement("div",null,lt(Hl[0].description,1)):i.a.createElement("div",null,lt(Hl[1].description,1))),i.a.createElement("div",{className:r.data},(d._parent||d._planId)&&te?i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"auto"}},i.a.createElement("span",{style:{color:dt("menu"),fontSize:"12px",paddingRight:"15px",whiteSpace:"nowrap"}},lt("$__loadingdata")),i.a.createElement(Fo,null)):(d._parent&&o.cards[d._parent]||d._planId&&o.cards[d._planId])&&i.a.createElement(ki,{id:d._parent?d._parent:d._planId?d._planId:null,open:function(t){e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{db:"cards",id:t,module:"cardEdit",activeModule:"cardEdit",data:De.getState().db.cards[t]}))}}),i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},d._id&&o.cards[d._id]&&o.cards[d._id]._users&&i.a.createElement(Ho,{_id:d._id,noLimit:!0,avatarSize:"33px",permission:me}),i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end"}},"plan"===d.type&&d._id&&me?i.a.createElement(At,{title:lt("$__openPlan",1),icon:"launch",color:"lightgray",onClick:function(){s.push("sp#".concat(d._id,"/dashboard")),ce(!0)},size:"25px"}):i.a.createElement(i.a.Fragment,null),e.card&&e.card._id&&"plan"===e.card.type?i.a.createElement(At,{title:lt(e.card&&e.card._isFavorite?"$__removeFromFavorite":"$__addToFavorite",1),icon:e.card&&e.card._isFavorite?"favorite":"favorite_border",color:e.card&&e.card._isFavorite?"red":"lightgray",onClick:function(){_t(e,d._id,!(!e.card||!e.card._isFavorite)),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},d._id,Object(h.a)(Object(h.a)({},De.getState().db.cards[d._id]),{},{_isFavorite:!e.card||!e.card._isFavorite})))}))},size:"25px"}):i.a.createElement(i.a.Fragment,null),d._id&&36===d._id.length&&"chatGroup"!==d.type&&"plan"!==d.type&&i.a.createElement(At,{title:lt(pe&&Ve()(new Date(1e3*pe)).format("YYYY/MM/DD")===Ve()().format("YYYY/MM/DD")?"$__removeOfMyDate":"$__addOnMyDay",1),color:pe&&Ve()(new Date(1e3*pe)).format("YYYY/MM/DD")===Ve()().format("YYYY/MM/DD")?"red":"lightblue",icon:pe&&Ve()(new Date(1e3*pe)).format("YYYY/MM/DD")===Ve()().format("YYYY/MM/DD")?"auto_delete":"alarm_add",onClick:function(){Zn(e,{_id:d._id,userId:c._id,option:fe}),e.myDayClick&&e.myDayClick()},size:"25px"}))),i.a.createElement("div",null,e.card&&"plan"!==d.type&&"chatGroup"!==d.type&&e.card._id&&e.card._users[c._id]&&"completed"!==d.status&&ae>0?i.a.createElement("div",{style:{position:"relative",width:"100%",float:"left"},onClick:function(e){e.stopPropagation()}},i.a.createElement(oi,{data:e.card})):i.a.createElement(i.a.Fragment,null)),i.a.createElement("fieldset",{style:{marginBottom:"14px"}},i.a.createElement("legend",null,"plan"===d.type&&d._id?lt("$__plan ".concat(d.planType?Hl[1].label:Hl[0].label),1):lt("$__data",1)),d.created_at?i.a.createElement("div",{style:{position:"relative",fontSize:12,color:"#bfbfbf",padding:"3px 0px",marginTop:-8,textAlign:"right"}},lt("$__createdAt"),": ",Ot(d.created_at)):i.a.createElement(i.a.Fragment,null),i.a.createElement(La,{label:lt(ue&&ue.fieldsTitle&&ue.fieldsTitle.name?ue.fieldsTitle.name:"$__titleOfCard",1),variant:dt("fieldVariant"),name:"name",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"view_headline"})),onChange:function(e){ie(e.target)}},value:d&&d.name?d.name:"",placeholder:lt(ue&&ue.fieldsTitle&&ue.fieldsTitle.placeholder&&ue.fieldsTitle.placeholder.name?ue.fieldsTitle.placeholder.name:"$__titleOfCard_placeholder",1),disabled:!(me&&"completed"!==d.status&&!(ue&&ue.disabledFields&&ue.disabledFields.indexOf("name")>-1))}),ae>3||d.description||me?i.a.createElement(i.a.Fragment,null,i.a.createElement(La,{label:lt("$__description",1),variant:dt("fieldVariant"),name:"description",InputProps:{autoComplete:"new-password",multiline:!0,minRows:3,endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"toc"})),onChange:function(e){ie(e.target)}},value:d&&d.description?d.description:"",placeholder:lt("$__descriptionOfCard_placeholder",1),disabled:!(me&&"completed"!==d.status&&!(ue&&ue.disabledFields&&ue.disabledFields.indexOf("description")>-1))})):i.a.createElement(i.a.Fragment,null),(ae>3||d.url||me)&&"chatGroup"!==d.type?i.a.createElement(La,{label:lt("$__URL",1),variant:dt("fieldVariant"),name:"url",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"http"})),onChange:function(e){ie(e.target)}},value:d&&d.url?d.url:"",placeholder:"https://domain.com",disabled:!(me&&"completed"!==d.status&&!(ue&&ue.disabledFields&&ue.disabledFields.indexOf("name")>-1))}):i.a.createElement(i.a.Fragment,null),d.url?i.a.createElement("div",{style:{width:"100%",textAlign:"right"}},i.a.createElement("a",{href:d.url,target:"_blank",style:{color:dt("menu"),fontWeight:"bold"}},lt("$__openlink","*"))):i.a.createElement(i.a.Fragment,null)),(ae>3||d.client||me)&&!he&&me&&(!ue.hideFields||ue.hideFields&&-1===ue.hideFields.indexOf("client"))&&(!d.client||d.client&&o.users[d.client])&&i.a.createElement(Zc,{id:"combo-box-demo",options:Object.keys(o.users).filter((function(e){return"client"===o.users[e].type||"group"===o.users[e].type||"sic"===o.users[e].type})).sort((function(e,t){return o.users[e].name<o.users[t].name?-1:o.users[e].name>o.users[t].name?1:0})).map((function(e){return{label:o.users[e].name,value:String(o.users[e]._id)}})),getOptionLabel:function(e){return lt(e.label,1)},style:{width:"100%"},name:"client",value:d&&d.client?Object.keys(o.users).filter((function(e){return d.client&&o.users[e]._id===d.client})).map((function(e){return{label:o.users[e].name,value:String(o.users[e]._id)}}))[0]:null,renderInput:function(e){return i.a.createElement(La,Object.assign({},e,{label:lt("$__account",1),variant:dt("fieldVariant"),value:d&&d.client?Object.keys(o.users).filter((function(e){return d.client&&o.users[e]._id===d.client})).map((function(e){return{label:o.users[e].name,value:String(o.users[e]._id)}}))[0]:null}))},onChange:function(e,t){ie({name:"client",value:t&&t.value?String(t.value):null})},disabled:!(me&&"completed"!==d.status&&!(ue&&ue.disabledFields&&ue.disabledFields.indexOf("client")>-1))}),((ae>2||d.endDate||d.startDate||me)&&!he||!(!me&&!d.startDate&&!d.endDate)&&!he&&(!ue.hideFields||ue.hideFields&&-1===ue.hideFields.indexOf("deadline")))&&i.a.createElement("fieldset",{style:{marginBottom:"14px"}},i.a.createElement("legend",null,lt("$__deadline",1)),d.endDate||d.startDate||I?i.a.createElement(i.a.Fragment,null,i.a.createElement(La,{label:lt("$__initialDate",1),variant:dt("fieldVariant",1),name:"startDate",InputLabelProps:{shrink:!0},type:"datetime-local",inputProps:{min:null,autoComplete:"start-date",onChange:function(e){Ve()(e.target.value).isValid()&&M(Ve()(e.target.value).unix("X"));var t={startDate:Ve()(e.target.value).unix("X")};M(Ve()(e.target.value).unix("X")),(!R||R<Ve()(e.target.value).unix("X"))&&(t=Object(h.a)(Object(h.a)({},t),{},{endDate:Ve()("".concat(Ve()(e.target.value).format("YYYY-MM-DD")," 23:59:59")).unix("X")}),H(Ve()("".concat(Ve()(e.target.value).format("YYYY-MM-DD")," 23:59:59")).unix("X"))),p(Object(h.a)(Object(h.a)({},d),t)),w(!0)}},value:z?Ve()(1e3*z).format("YYYY-MM-DDTHH:mm"):null}),i.a.createElement(La,{label:lt("$__endDate",1),variant:dt("fieldVariant",1),name:"endDate",InputLabelProps:{shrink:!0},type:"datetime-local",inputProps:{min:!R||z?Ve()(1e3*z).format("YYYY-MM-DDTHH:mm"):null,autoComplete:"end-date",onChange:function(e){var t={endDate:Ve()(e.target.value).unix("X")};H(Ve()(e.target.value).unix("X")),z||(t=Object(h.a)(Object(h.a)({},t),{},{startDate:Ve()("".concat(Ve()(e.target.value).format("YYYY-MM-DD")," 00:00:00")).unix("X")}),M(Ve()("".concat(Ve()(e.target.value).format("YYYY-MM-DD")," 00:00:00")).unix("X"))),p(Object(h.a)(Object(h.a)({},d),t)),w(!0)}},value:R?Ve()(1e3*R).format("YYYY-MM-DDTHH:mm"):null}),i.a.createElement("div",{style:{display:"flex",width:"100%",justifyContent:"flex-end"}},i.a.createElement(At,{color:dt("lightgray"),icon:"clear",onClick:function(){M(null),H(null),p(Object(h.a)(Object(h.a)({},d),{},{startDate:null,endDate:null,recurrence:null})),F(!1),w(!0)},size:"15px",title:lt("$__clearDate","*"),text:lt("$__clearDate","*")})),i.a.createElement("div",{style:{position:"relative",width:"fit-content",float:"right",display:"flex",justifyContent:"right"}},i.a.createElement($l,{options:[{value:0,label:"Manual"},{value:7,label:"7 ".concat(lt("$__days").toLowerCase())},{value:15,label:"15 ".concat(lt("$__days").toLowerCase())},{value:30,label:"30 ".concat(lt("$__days").toLowerCase())},{value:60,label:"60 ".concat(lt("$__days").toLowerCase())},{value:90,label:"90 ".concat(lt("$__days").toLowerCase())},{value:180,label:"180 ".concat(lt("$__days").toLowerCase())},{value:365,label:"365 ".concat(lt("$__days").toLowerCase())}].concat(Object(f.a)(de&&de.startDate&&de.endDate?[{value:"parent",label:"".concat(lt("$__useParentDate")," ").concat(Ve()(1e3*de.startDate).tz("America/Sao_Paulo").format("DD/MM/YYYY")," - ").concat(Ve()(1e3*de.endDate).tz("America/Sao_Paulo").format("DD/MM/YYYY"))}]:[])),value:K||"",onChange:function(e){"parent"!==e&&0!==e?(H(Ve()(new Date(1e3*z)).tz("America/Sao_Paulo").add(e,"days").unix("X")),ie({name:"endDate",value:Ve()(new Date(1e3*z)).tz("America/Sao_Paulo").add(e,"days").unix("X")},null,!0)):"parent"===e&&(de.startDate&&(M(de.startDate),ie({name:"startDate",value:de.startDate},de.endDate?{name:"endDate",value:de.endDate}:null,!0),de.endDate&&H(de.endDate)),!de.startDate&&de.endDate&&(H(de.endDate),ie({name:"endDate",value:de.endDate},null,!0))),Z(e)}})),i.a.createElement("div",{className:r.switch,style:{position:"relative",width:"100%",float:"left",display:"flex",alignItems:"center",justifyContent:"space-between"}},lt("$__freeChildrenDate",1),i.a.createElement(vi,{checked:!!d.freeChildrenDate,onChange:function(e){ie({name:"freeChildrenDate",value:!d.freeChildrenDate})},name:"freeChildrenDate",inputProps:{"aria-label":"secondary checkbox"},disabled:!(me&&"completed"!==d.status&&!(ue&&ue.disabledFields&&ue.disabledFields.indexOf("freeChildrenDate")>-1))})),d.startDate&&Ve()(d.startDate).isValid()&&(!ue.hideFields||ue.hideFields&&-1===ue.hideFields.indexOf("recurrence"))&&i.a.createElement("div",{style:{width:"311px",position:"relative",float:"left"}},d._recurrenceId?i.a.createElement("div",{style:{marginTop:"15px"}},lt("$__recurrentActivityFrom"),":",i.a.createElement(oc,(t={db:"cards",data:o.cards[d._recurrenceId]},Object(O.a)(t,"db","cards"),Object(O.a)(t,"Avatar",!0),Object(O.a)(t,"ignoreList",!0),Object(O.a)(t,"onlyOption",!0),t))):i.a.createElement("div",null,i.a.createElement(Bl,{data:d,onChange:function(e){p(Object(h.a)(Object(h.a)(Object(h.a)({},d),e),{},{recurrenceNextDate:Ve()("".concat(e.recurrenceNextDate," 06:00:00")).tz("America/Sao_Paulo").format("YYYY-MM-DD")})),w(!0)}}),d.recurrence&&"0"!==d.recurrence&&d.recurrenceNextDate&&i.a.createElement("fieldset",{style:{marginTop:"7px"}},i.a.createElement("legend",null,lt("$__NextRecurrenceDate")),i.a.createElement(El,{placeholder:lt("$__NextRecurrenceDate"),clearButtonPosition:"flex-end",onChangeStartDate:function(e){var t={recurrenceNextDate:Ve()(e).tz("America/Sao_Paulo").format("YYYY-MM-DD")};p(Object(h.a)(Object(h.a)({},d),t)),w(!0)},startDate:d.recurrenceNextDate&&Ve()(d.recurrenceNextDate).isValid()?new Date(1e3*Ve()("".concat(d.recurrenceNextDate," 06:00:00")).tz("America/Sao_Paulo").unix("X")):null,onClear:function(){p(Object(h.a)(Object(h.a)({},d),{},{recurrenceNextDate:null})),w(!0)}}))))):me||(ae>2||d.endDate||d.startDate||me)&&!he?i.a.createElement(rn,{text:lt("$__addDeadline",1),icon:"timer",onClick:function(){F(!0),M(Ve()("".concat(Ve()().format("YYYY-MM-DD")," 00:00:00")).unix("X")),ie({name:"startDate",value:Ve()("".concat(Ve()().format("YYYY-MM-DD")," 00:00:00")).unix("X")},"parent"!==K?{name:"endDate",value:Ve()("".concat(Ve()().format("YYYY-MM-DD")," 23:59:59")).add(K,"days").unix("X")}:null),"parent"!==K&&H(Ve()("".concat(Ve()().format("YYYY-MM-DD")," 23:59:59")).add(K,"days").unix("X"))}}):i.a.createElement(i.a.Fragment,null)),("completed"===d.status||!me)&&ae<3?i.a.createElement(i.a.Fragment,null,d._tags&&d._tags.length>0?i.a.createElement(bn,{options:d._tags,expanded:!0}):i.a.createElement(i.a.Fragment,null)):i.a.createElement(i.a.Fragment,null,(!ue.hideFields||ue.hideFields&&-1===ue.hideFields.indexOf("tags"))&&i.a.createElement("fieldset",{style:{marginBottom:"14px"}},i.a.createElement("legend",null,lt("$__tags",1)),i.a.createElement(Gl,{data:{values:d._tags?d._tags:[]},callBack:function(e){me&&ie({name:"_tags",value:e})},disabled:!(me&&"completed"!==d.status&&!(ue&&ue.disabledFields&&ue.disabledFields.indexOf("_tags")>-1)),placeholder:lt("$__selectTheOptions",1)}))),(!ue.hideFields||ue.hideFields&&(-1===ue.hideFields.indexOf("priority")||-1===ue.hideFields.indexOf("status")))&&i.a.createElement("fieldset",{style:{marginBottom:"14px"}},!he&&(!ue.hideFields||ue.hideFields&&-1===ue.hideFields.indexOf("priority"))&&i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%"}},i.a.createElement("div",{style:{position:"relative",float:"left",width:"calc(50% - 15px)",margin:3,paddingLeft:7}},i.a.createElement(Zc,{id:"combo-box-demo",options:o.priority,getOptionLabel:function(e){return lt(e.label,1)},style:{width:"100%"},name:"priority",disableClearable:!0,value:d&&d.priority&&o.priority?o.priority.filter((function(e){return String(e.value)===String(d.priority)}))[0]:o.priority[0],renderInput:function(e){return i.a.createElement(La,Object.assign({},e,{label:lt("$__priority",1),variant:dt("fieldVariant"),disabled:!(me&&"completed"!==d.status&&!(ue&&ue.disabledFields&&ue.disabledFields.indexOf("priority")>-1)),inputProps:Object(h.a)(Object(h.a)({},e&&e.inputProps?e.inputProps:{}),{},{style:Object(h.a)(Object(h.a)({},e&&e.inputProps&&e.inputProps.style?e.inputProps.style:{}),{},{paddingLeft:7,marginTop:3,marginLeft:-5,width:"calc(100% - 7px)",color:d&&d.priority?o.priority.filter((function(e){return String(e.value)===String(d.priority)}))[0].color:o.priority[0].color,borderLeft:"solid 3.33px ".concat(d&&d.priority?o.priority.filter((function(e){return String(e.value)===String(d.priority)}))[0].color:o.priority[0].color)})}),value:d&&d.priority&&o.priority?o.priority.filter((function(e){return String(e.value)===String(d.priority)}))[0]:o.priority[0]}))},onChange:function(e,t){me&&ie({name:"priority",value:t.value})},renderOption:function(e,t){t.inputValue;return i.a.createElement("span",{style:{color:e.color}},lt(e.label,1))},disabled:!(me&&"completed"!==d.status&&!(ue&&ue.disabledFields&&ue.disabledFields.indexOf("priority")>-1))})),i.a.createElement("div",{style:{position:"relative",float:"left",width:"calc(50% - 15px)",margin:3,paddingLeft:7}},i.a.createElement(Zc,{id:"combo-box-demo",options:o.priority,getOptionLabel:function(e){return lt(e.label,1)},style:{width:"100%"},name:"risk",disableClearable:!0,value:d&&d.risk&&o.priority?o.priority.filter((function(e){return String(e.value)===String(d.risk)}))[0]:o.priority[0],renderInput:function(e){return i.a.createElement(La,Object.assign({},e,{label:lt("$__risk",1),variant:dt("fieldVariant"),disabled:!(me&&"completed"!==d.status&&!(ue&&ue.disabledFields&&ue.disabledFields.indexOf("priority")>-1)),inputProps:Object(h.a)(Object(h.a)({},e&&e.inputProps?e.inputProps:{}),{},{style:Object(h.a)(Object(h.a)({},e&&e.inputProps&&e.inputProps.style?e.inputProps.style:{}),{},{paddingLeft:7,marginTop:3,marginLeft:-5,width:"calc(100% - 7px)",color:d&&d.risk?o.priority.filter((function(e){return String(e.value)===String(d.risk)}))[0].color:o.priority[0].color,borderLeft:"solid 3.33px ".concat(d&&d.risk?o.priority.filter((function(e){return String(e.value)===String(d.risk)}))[0].color:o.priority[0].color)})}),value:d&&d.risk&&o.priority?o.priority.filter((function(e){return String(e.value)===String(d.risk)}))[0]:o.priority[0]}))},onChange:function(e,t){me&&ie({name:"risk",value:t.value})},renderOption:function(e,t){t.inputValue;return i.a.createElement("span",{style:{color:e.color}},lt(e.label,1))},disabled:!(me&&"completed"!==d.status&&!(ue&&ue.disabledFields&&ue.disabledFields.indexOf("priority")>-1))})),i.a.createElement("div",{style:{position:"relative",float:"left",width:"calc(50% - 15px)",margin:3,paddingLeft:7}},i.a.createElement(Zc,{id:"combo-box-demo",options:o.priority,getOptionLabel:function(e){return lt(e.label,1)},style:{width:"100%"},name:"complexity",disableClearable:!0,value:d&&d.complexity&&o.priority?o.priority.filter((function(e){return String(e.value)===String(d.complexity)}))[0]:o.priority[0],renderInput:function(e){return i.a.createElement(La,Object.assign({},e,{label:lt("$__complexity",1),variant:dt("fieldVariant"),disabled:!(me&&"completed"!==d.status&&!(ue&&ue.disabledFields&&ue.disabledFields.indexOf("priority")>-1)),inputProps:Object(h.a)(Object(h.a)({},e&&e.inputProps?e.inputProps:{}),{},{style:Object(h.a)(Object(h.a)({},e&&e.inputProps&&e.inputProps.style?e.inputProps.style:{}),{},{paddingLeft:7,marginTop:3,marginLeft:-5,width:"calc(100% - 7px)",color:d&&d.complexity?o.priority.filter((function(e){return String(e.value)===String(d.complexity)}))[0].color:o.priority[0].color,borderLeft:"solid 3.33px ".concat(d&&d.complexity?o.priority.filter((function(e){return String(e.value)===String(d.complexity)}))[0].color:o.priority[0].color)})}),value:d&&d.complexity&&o.priority?o.priority.filter((function(e){return String(e.value)===String(d.complexity)}))[0]:o.priority[0]}))},onChange:function(e,t){me&&ie({name:"complexity",value:t.value})},renderOption:function(e,t){t.inputValue;return i.a.createElement("span",{style:{color:e.color}},lt(e.label,1))},disabled:!(me&&"completed"!==d.status&&!(ue&&ue.disabledFields&&ue.disabledFields.indexOf("priority")>-1))})),i.a.createElement("div",{style:{position:"relative",float:"left",width:"calc(50% - 15px)",margin:3,paddingLeft:7}},i.a.createElement(Zc,{id:"combo-box-demo",options:o.priority,getOptionLabel:function(e){return lt(e.label,1)},style:{width:"100%"},name:"impact",disableClearable:!0,value:d&&d.impact&&o.priority?o.priority.filter((function(e){return String(e.value)===String(d.impact)}))[0]:o.priority[0],renderInput:function(e){return i.a.createElement(La,Object.assign({},e,{label:lt("$__impact",1),variant:dt("fieldVariant"),disabled:!(me&&"completed"!==d.status&&!(ue&&ue.disabledFields&&ue.disabledFields.indexOf("priority")>-1)),inputProps:Object(h.a)(Object(h.a)({},e&&e.inputProps?e.inputProps:{}),{},{style:Object(h.a)(Object(h.a)({},e&&e.inputProps&&e.inputProps.style?e.inputProps.style:{}),{},{paddingLeft:7,marginTop:3,marginLeft:-5,width:"calc(100% - 7px)",color:d&&d.impact?o.priority.filter((function(e){return String(e.value)===String(d.impact)}))[0].color:o.priority[0].color,borderLeft:"solid 3.33px ".concat(d&&d.impact?o.priority.filter((function(e){return String(e.value)===String(d.impact)}))[0].color:o.priority[0].color)})}),value:d&&d.impact&&o.priority?o.priority.filter((function(e){return String(e.value)===String(d.impact)}))[0]:o.priority[0]}))},onChange:function(e,t){me&&ie({name:"impact",value:t.value})},renderOption:function(e,t){t.inputValue;return i.a.createElement("span",{style:{color:e.color}},lt(e.label,1))},disabled:!(me&&"completed"!==d.status&&!(ue&&ue.disabledFields&&ue.disabledFields.indexOf("priority")>-1))}))),!he&&(!ue.hideFields||ue.hideFields&&-1===ue.hideFields.indexOf("status"))&&i.a.createElement(Zc,{id:"combo-box-demo",options:o.status,getOptionLabel:function(e){return lt(e.label,1)},style:{width:"100%"},name:"status",disableClearable:!0,value:d&&d.status&&o.status?o.status.filter((function(e){return String(e.value)===String(d.status)}))[0]:o.status[0],renderInput:function(e){return i.a.createElement(La,Object.assign({},e,{label:lt("$__status",1),variant:dt("fieldVariant"),value:d&&d.status&&o.status?o.status.filter((function(e){return String(e.value)===String(d.status)}))[0]:o.status[0]}))},onChange:function(e,t){(me||"0"!==String(ae))&&ie({name:"status",value:t.value})},disabled:!(me&&!(ue&&ue.disabledFields&&ue.disabledFields.indexOf("status")>-1))&&"0"===String(ae)})),(ae>4||ne&&ne.plan&&ne.planAdmin)&&"plan"===d.type&&"completed"!==d.status&&i.a.createElement(i.a.Fragment,null,V||d.miroBoard?V?i.a.createElement("fieldset",{style:{marginBottom:"14px"}},i.a.createElement("legend",null,lt("$__MiroBoard",1)),i.a.createElement(La,{label:lt("$__MiroBoardCode"),variant:dt("fieldVariant"),name:"boardCode",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"save",color:"green",onClick:function(){return q(!1)}})),onChange:function(e,t){ie({name:"miroBoard",value:e.target.value})}},value:d&&d.miroBoard?d.miroBoard:"",placeholder:lt("$__MiroBoardCodePlaceholder",1),disabled:!(me&&"completed"!==d.status&&!(ue&&ue.disabledFields&&ue.disabledFields.indexOf("miroBoard")>-1))})):d.miroBoard&&i.a.createElement("fieldset",{style:{marginBottom:"14px"}},i.a.createElement("legend",null,lt("$__MiroBoard",1)),i.a.createElement(rn,{text:lt("$__openMiroBoard",1),icon:"developer_board",onClick:function(){e.reduxFunction("ASYNC","LIGHTBOX",{miro:!0,miroBoard:d.miroBoard})}}),i.a.createElement(rn,{text:lt("$__editBoard",1),icon:"insert_link",onClick:function(){q(!0)}})):i.a.createElement("fieldset",{style:{marginBottom:"14px"}},i.a.createElement("legend",null,lt("$__MiroBoard",1)),i.a.createElement(rn,{text:lt("$__addBoard",1),icon:"developer_board",onClick:function(){q(!0)}}))),(!d._id||d&&d._users&&c&&c._id&&d._users[c._id]&&d._users[c._id].access&&parseInt(d._users[c._id].access)>=3&&(!ue.hideFields||ue.hideFields&&-1===ue.hideFields.indexOf("private")))&&i.a.createElement("fieldset",{style:{marginBottom:"14px"}},i.a.createElement("div",{className:r.switch},i.a.createElement(vi,{checked:!!d.private,onChange:function(e){me&&ie({name:"private",value:!d.private})},name:"private",inputProps:{"aria-label":"secondary checkbox"},disabled:!(me&&"completed"!==d.status&&!(ue&&ue.disabledFields&&ue.disabledFields.indexOf("private")>-1))}),lt("$__private",1))),(!ue.hideFields||ue.hideFields&&-1===ue.hideFields.indexOf("private"))&&d.private&&i.a.createElement("fieldset",{style:{marginBottom:"14px"}},i.a.createElement("div",{className:r.switch},i.a.createElement(vi,{checked:!!d.privateChildrens,onChange:function(e){me&&ie({name:"privateChildrens",value:!d.privateChildrens})},name:"privateChildrens",inputProps:{"aria-label":"secondary checkbox"},disabled:!(me&&"completed"!==d.status&&!(ue&&ue.disabledFields&&ue.disabledFields.indexOf("private")>-1))}),lt("$__privateChildrens",1))),me&&"chatGroup"===d.type&&i.a.createElement("fieldset",{style:{marginBottom:"14px"}},i.a.createElement("div",{className:r.switch},i.a.createElement(vi,{checked:!!d.onlyAdminsSendMessages,onChange:function(e){me&&ie({name:"onlyAdminsSendMessages",value:!d.onlyAdminsSendMessages})},name:"onlyAdmins",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__onlyAdminsCanSendMessage",1))),ne&&ne.plan&&ne.planAdmin&&he&&"plan"===d.type&&c._access&&c._access.userAdmin&&c._access.machenAdmin?i.a.createElement("fieldset",{style:{marginBottom:"14px"}},i.a.createElement(Zc,{id:"combo-box-demo",options:o.plans,getOptionLabel:function(e){return lt(e.label,1)},style:{width:"100%"},name:"plans",disableClearable:!0,value:d&&d.plans&&o.plans?o.plans.filter((function(e){return String(e.value)===String(d.plans)}))[0]:{label:"$__notAvaiable",value:null,settings:{}},renderInput:function(e){return i.a.createElement(La,Object.assign({},e,{label:lt("$__avaiablefromplan",1),variant:dt("fieldVariant"),value:d&&d.plans&&o.plans?o.plans.filter((function(e){return String(e.value)===String(d.plans)}))[0]:{label:"$__notAvaiable",value:null,settings:{}}}))},onChange:function(e,t){me&&ie({name:"plans",value:t.value})}})):i.a.createElement(i.a.Fragment,null))))}))),Ul=r(1012),Vl=r(1803),ql=r(1823),Xl=function(e){return{btClose:{position:"relative",zIndex:e.zIndex.drawer+1,right:"0",top:"-64px",backgroundColor:"#FFFFFF",display:"flex"},data:{marginTop:"0px",padding:"0 10px","& fieldset":{border:"solid 1px rgba(0,0,0,0.1)","& legend":{marginBottom:"0px",fontSize:"16px",color:dt("color")}}},timeline:{position:"absolute",width:"100%",top:"300px",bottom:"0px"},timelineKpiParent:{position:"absolute",width:"100%",top:"350px",bottom:"0px"},avatar:{width:"22px",height:"22px"},switch:{fontSize:"16px",fontWeight:"bold",color:dt("medium")}}};function Jl(){Jl=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Kl=Object($e.b)((function(e){return{store:{sideModule:e.sideModule}}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Xl)((function(e){var t=e.classes,r=De.getState(),n=r.timeline,a=r.db,o=r.session,c=r.sideModule,l=c.data||{},s=i.a.useState(!l.kpi_type),u=Object(Be.a)(s,2),d=(u[0],u[1],i.a.useState(l.kpi_type?"timeline":"settings")),p=Object(Be.a)(d,2),f=p[0],m=p[1],g=i.a.useState(!(!l._id||"new"!==l._id||!l.name)),v=Object(Be.a)(g,2),y=v[0],b=v[1],x=i.a.useState({}),_=Object(Be.a)(x,2),w=_[0];_[1],i.a.useEffect((function(){y&&e.reqSave&&e.reqSave()}),[y]);var E=xt(),j=ia(c.id),S=!1;(parseInt(j)>=4||E.plan&&E.planAdmin)&&(S=!0),o._id&&a.cards[l._id]&&a.cards[l._id]._users&&a.cards[l._id]._users[Object.keys(a.cards[l._id]._users).find((function(e){return e.indexOf(o._id)>-1}))]&&(j=a.cards[l._id]._users[Object.keys(a.cards[l._id]._users).find((function(e){return e.indexOf(o._id)>-1}))]);var k=window.location.hash.split("/");k[0]=k[0].replace("#","");var L=n[l._id]||{};L=Object.keys(L).filter((function(e){return"kpi"===L[e].type})).map((function(e){return L[e]}));var C=null,I=0;l._parent&&De.getState().db.cards[l._parent]&&De.getState().db.cards[l._parent].kpi_type&&"task"!==De.getState().db.cards[l._parent].kpi_type&&(C=De.getState().db.cards[l._parent],I=parseInt(C.kpi_ini)>parseInt(C.kpi_fin)?parseInt(C.kpi_ini)-parseInt(C.kpi_fin):parseInt(C.kpi_fin)-parseInt(C.kpi_ini),Object.keys(De.getState().db.cards).filter((function(e){return De.getState().db.cards[e]._parent&&De.getState().db.cards[e]._parent===C._id&&De.getState().db.cards[e].kpi_type===C.kpi_type&&De.getState().db.cards[e].kpi_useParent})).map((function(e){parseInt(C.kpi_ini)>parseInt(C.kpi_fin&&parseInt(De.getState().db.cards[e].kpi_ini))?I-=parseInt(De.getState().db.cards[e].kpi_ini):parseInt(De.getState().db.cards[e].kpi_fin)&&(I-=parseInt(De.getState().db.cards[e].kpi_fin))})));var F=function(t){(t.value&&!c.data[t.name]||c.data[t.name]&&c.data[t.name]!==t.value)&&b(!0);var r=Object(h.a)(Object(h.a)({},c.data),{},Object(O.a)({},t.name,t.value));r.kpi_ini||(r=Object(h.a)(Object(h.a)({},r),{},{kpi_ini:0})),r.kpi_fin||(r=Object(h.a)(Object(h.a)({},r),{},{kpi_fin:0})),!r.kpi_useParent&&"false"!==!String(r.kpi_useParent)&&C&&C.kpi_type===t.value&&(r=Object(h.a)(Object(h.a)({},r),{},{kpi_useParent:!0})),e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},c),{},{data:r}))},T=function(){var t=Object(Me.a)(Jl().mark((function t(){var r,n=arguments;return Jl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n.length>0&&void 0!==n[0]&&n[0],b(!1),"time"!==c.data.kpi_type||!(0===parseInt(c.data.kpi_fin)&&0===parseInt(c.data.kpi_ini)||parseInt(c.data.kpi_fin)>0&&parseInt(c.data.kpi_fin)<parseInt(c.data.kpi_ini))){t.next=6;break}ft({message:lt("$__invalidMaximumMinutes",1),variant:"warning",persist:!1,horizontal:"right",confirm:null}),t.next=11;break;case 6:return t.next=8,An(e,!0,c.data);case 8:t.sent&&ft({message:lt("$__kpiDataSaved",1),variant:null,persist:!1,horizontal:"right",confirm:null}),r&&e.reduxFunction("ASYNC","CLEAR_MODULE");case 11:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),N=function(){var t=Object(Me.a)(Jl().mark((function t(r){return Jl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},c),{},{data:Object(h.a)(Object(h.a)({},c.data),{},{kpi_ini:null,kpi_fin:null,kpi_useParent:!!r.value||null})}));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),P=0;return Object.keys(a.cards).filter((function(e){return a.cards[e]&&a.cards[e]._parent&&a.cards[e]._parent===l._id&&a.cards[e].kpi_useParent})).map((function(e,t){P=parseInt(l.kpi_ini)>parseInt(l.kpi_fin)?P+parseInt(a.cards[e].kpi_ini)-parseInt(a.cards[e].kpi_fin):P+parseInt(a.cards[e].kpi_fin)-parseInt(a.cards[e].kpi_ini)})),i.a.createElement("div",null,i.a.createElement(Nc,{save:y&&S?function(){T()}:null,saveClose:y&&S?function(){T(!0)}:null,close:function(){e.onClose&&e.onClose(y)}}),i.a.createElement("div",{style:{posision:"absolute",top:5,left:0,right:0}},S?i.a.createElement("div",{style:{width:"100%",position:"relative",display:"flex",flexDirection:"row-reverse"}},i.a.createElement(At,{title:lt("$__changeKpiType",1),color:dt("settings"===f?"menu":"color"),icon:"tune",onClick:function(){return m("settings")},size:"25px",transparent:!0}),i.a.createElement(At,{title:lt("$__chart",1),color:dt("chart"===f?"menu":"color"),icon:"analytics",onClick:function(){return m("chart")},size:"25px",transparent:!0}),i.a.createElement(At,{title:lt("$__statement",1),color:dt("timeline"===f?"menu":"color"),icon:"receipt",onClick:function(){return m("timeline")},size:"25px",transparent:!0})):i.a.createElement("div",null),"chart"===f?i.a.createElement(Ni,{data:l,chartShow:!0}):"settings"===f?i.a.createElement("fieldset",{style:{textAlign:"center"}},i.a.createElement("legend",null,lt("$__measurementeType",1)),0===Object.keys(a.cards).filter((function(e){return a.cards[e]._parent===l._id&&a.cards[e].kpi_useParent})).length?i.a.createElement(ql.a,{value:l&&l.kpi_type?l.kpi_type:"task",exclusive:!0,onChange:function(e,t){F({name:"kpi_type",value:t})}},i.a.createElement(Vl.a,{value:"decimal"},i.a.createElement(kt,{title:lt("$__decimal",1),color:"color"},"filter_9_plus")),i.a.createElement(Vl.a,{value:"currency"},i.a.createElement(kt,{title:lt("$__currency",1),color:"color"},"attach_money")),i.a.createElement(Vl.a,{value:"percent"},i.a.createElement(Qe.a,{title:lt("$__percentage",1)},i.a.createElement("span",{style:{color:"".concat(dt("color")),fontSize:"22px"}},"%"))),i.a.createElement(Vl.a,{value:"time"},i.a.createElement(kt,{title:lt("$__time",1),color:"color"},"hourglass_top")),i.a.createElement(Vl.a,{value:"task"},i.a.createElement(kt,{title:lt("$__task",1),color:"color"},"task"))):"decimal"===l.kpi_type?i.a.createElement(kt,{title:lt("$__decimal",1),color:"color"},"filter_9_plus"):"currency"===l.kpi_type?i.a.createElement(kt,{title:lt("$__currency",1),color:"color"},"attach_money"):"percent"===l.kpi_type?i.a.createElement(kt,{title:lt("$__percentage",1),color:"color"},"percent"):i.a.createElement(kt,{title:lt("$__task",1),color:"color"},"task"),(Object.keys(a.cards).filter((function(e){return a.cards[e]._parent===l._id&&a.cards[e].kpi_useParent})).length,i.a.createElement(i.a.Fragment,null)),C&&C.kpi_type&&C.kpi_type===l.kpi_type?i.a.createElement(i.a.Fragment,null,i.a.createElement("fieldset",{style:{marginTop:7}},i.a.createElement("legend",{style:{color:"gray",fontSize:12}},lt("$__parentKpi",1)),l.kpi_useParent?i.a.createElement(i.a.Fragment,null,i.a.createElement("fieldset",{style:{marginTop:3}},i.a.createElement("legend",{style:{color:"blue",fontSize:12}},C&&parseInt(C.kpi_ini)>parseInt(C.kpi_fin)?lt("$__notAllocatedBudget",1):lt("$__notAllocatedGoal",1)),mt(I,"time"===C.kpi_type?"number":C.kpi_type,C.kpi_currency?C.kpi_currency:null))):i.a.createElement(i.a.Fragment,null),i.a.createElement("div",{className:t.switch},i.a.createElement(vi,{checked:!!l.kpi_useParent,onChange:function(e){N({name:"kpi_useParent",value:!l.kpi_useParent})},name:"kpi_useParent",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__useParentKpi",1)),l.kpi_useParent?i.a.createElement(i.a.Fragment,null):i.a.createElement("div",{style:{color:"red"}},lt("$__independentKPIDescription")),i.a.createElement("div",null))):i.a.createElement(i.a.Fragment,null),l&&l.kpi_type&&"task"!==l.kpi_type&&i.a.createElement(i.a.Fragment,null,"currency"!==l.kpi_type||l.kpi_useParent||0!==Object.keys(a.cards).filter((function(e){return a.cards[e]._parent===l._id&&a.cards[e].kpi_useParent})).length?Object.keys(a.cards).filter((function(e){return a.cards[e]._parent===l._id&&a.cards[e].kpi_useParent})).length>0?i.a.createElement("fieldset",{style:{marginTop:7}},i.a.createElement("legend",{style:{color:"gray",fontSize:12}},lt("$__allocatedKpiActivities",1)),i.a.createElement("ul",{style:{listStyle:"none",padding:0}},Object.keys(a.cards).filter((function(e){return a.cards[e]._parent===l._id&&a.cards[e].kpi_useParent})).map((function(e,t){var r=0;r=parseInt(l.kpi_ini)>parseInt(l.kpi_fin)?parseInt(a.cards[e].kpi_ini)-parseInt(a.cards[e].kpi_fin):parseInt(a.cards[e].kpi_fin)-parseInt(a.cards[e].kpi_ini);var o=0;return n&&n[e]&&Object.keys(n[e]).filter((function(t){return n[e][t]&&n[e][t].value})).length>0&&Object.keys(n[e]).filter((function(t){return n[e][t]&&n[e][t].value})).map((function(t){o+=parseFloat(n[e][t].value)})),i.a.createElement("li",{key:"ca-".concat(e)},i.a.createElement(oc,{db:"cards",data:De.getState().db.cards[e],notGlobalExpanded:!0,ignoreList:!0}),i.a.createElement("div",{style:{width:"100%",height:22}},i.a.createElement(Ul.a,{data:[{ranges:[0,parseInt(l.kpi_ini)>parseInt(l.kpi_fin)?parseInt(l.kpi_ini)-parseInt(l.kpi_fin):parseInt(l.kpi_fin)-parseInt(l.kpi_ini)],measures:[r],markers:[o]}],minValue:parseInt(l.kpi_ini)>parseInt(l.kpi_fin)?parseInt(l.kpi_fin):parseInt(l.kpi_ini),maxValue:parseInt(l.kpi_ini)<parseInt(l.kpi_fin)?parseInt(l.kpi_fin):parseInt(l.kpi_ini),margin:{top:0,right:0,bottom:0,left:0},spacing:50,titlePosition:"after",titleAlign:"end",titleOffsetX:-70,rangeBorderColor:{from:"color",modifiers:[]},measureBorderColor:{from:"color",modifiers:[]},measureSize:1e5,markerSize:1.2,rangeColors:"purple_orange",measureColors:"seq:blue_purple",markerColors:"seq:yellow_orange_red",motionConfig:"stiff"})),i.a.createElement("div",{style:{marginTop:0,fontSize:12,color:"black",width:"100%",textAlign:"left"}},mt(r,"time"===l.kpi_type?"number":l.kpi_type,l.kpi_currency?l.kpi_currency:null)))})))):i.a.createElement(i.a.Fragment,null):i.a.createElement(Zc,{id:"combo-box-demo",options:a.currency,getOptionLabel:function(e){return lt(e.label,1)},style:{width:"100%"},name:"currency",disableClearable:!0,value:l&&l.kpi_currency&&a.currency?a.currency.filter((function(e){return String(e.value)===String(l.kpi_currency)}))[0]:a.currency[0],renderInput:function(e){return i.a.createElement(La,Object.assign({},e,{label:lt("$__currency",1),variant:dt("fieldVariant"),value:l&&l.kpi_currency&&a.currency?a.currency.filter((function(e){return String(e.value)===String(l.kpi_currency)}))[0]:a.currency[0]}))},onChange:function(e,t){F({name:"kpi_currency",value:t.value})}}),i.a.createElement("div",{style:{display:"flex",marginTop:"14px",justifyContent:l.kpi_useParent?"center":"space-between"}},!l.kpi_useParent||l.kpi_useParent&&C&&parseInt(C.kpi_ini)>parseInt(C.kpi_fin)?i.a.createElement("div",{style:{width:"calc(50% - 7px)"}},i.a.createElement(La,{label:l.kpi_useParent?lt("$__budget"):"time"===l.kpi_type?lt("$__minimumMinutes",1):lt("$__initialValue",1),variant:"outlined",name:"kpi_ini",error:!(!w||!w.kpi_ini),helperText:w&&w.kpi_ini?lt("$__valueExceedAllocatedValue",1):null,InputLabelProps:{shrink:!0,step:.01},InputProps:{autoComplete:"new-password",startAdornment:i.a.createElement("span",{style:{color:"lightgray",fontSize:8}},"currency"===l.kpi_type&&a.currency.filter((function(e){return l.kpi_currency&&String(e.value)===String(l.kpi_currency)||!l.kpi_currency&"BRL"===String(e.value)}))[0]?a.currency.filter((function(e){return l.kpi_currency&&String(e.value)===String(l.kpi_currency)||!l.kpi_currency&"BRL"===String(e.value)}))[0].symbol:"")},onChange:function(e){F({name:"kpi_ini",value:"time"===l.kip_type?ht(e.target.value,0):ht(e.target.value,2)})},value:l.kpi_ini})):i.a.createElement(i.a.Fragment,null),!l.kpi_useParent||l.kpi_useParent&&C&&parseInt(C.kpi_ini)<parseInt(C.kpi_fin)?i.a.createElement("div",{style:{width:"calc(50% - 7px)"}},i.a.createElement(La,{label:l.kpi_useParent?lt("$__goal"):"time"===l.kpi_type?lt("$__maximumMinutes",1):lt("$__finalValue",1),variant:"outlined",name:"kpi_fin",type:"number",error:!(!w||!w.kpi_fin),helperText:w&&w.kpi_fin?lt("$__valueExceedAllocatedValue",1):null,InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",startAdornment:i.a.createElement("span",{style:{color:"lightgray",fontSize:8}},"currency"===l.kpi_type&&a.currency.filter((function(e){return l.kpi_currency&&String(e.value)===String(l.kpi_currency)||!l.kpi_currency&"BRL"===String(e.value)}))[0]?a.currency.filter((function(e){return l.kpi_currency&&String(e.value)===String(l.kpi_currency)||!l.kpi_currency&"BRL"===String(e.value)}))[0].symbol:"")},onChange:function(e){F({name:"kpi_fin",value:"time"===l.kip_type?ht(e.target.value,0):ht(e.target.value,2)})},value:l.kpi_fin})):i.a.createElement(i.a.Fragment,null)),i.a.createElement("div",{className:t.switch},i.a.createElement(vi,{checked:!!l.kpi_reqMessage,onChange:function(e){F({name:"kpi_reqMessage",value:!l.kpi_reqMessage})},name:"kpi_reqMessage",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__reqDescription",1)))):i.a.createElement("div",{style:{position:"absolute",top:30,bottom:0,left:0,right:0}},i.a.createElement(Ni,{data:l,chartShow:!1}),i.a.createElement("div",{style:{position:"absolute",top:103,bottom:0,left:0,right:0}},i.a.createElement(Xc,{noSearch:!0,nodeId:l._id,type:"kpi",db:"cards",disabledSend:!0,loadTimeline:!0,kpi_type:l.kpi_type})))))}))),Zl=function(e){return{root:{position:"relative",float:"left",width:"calc(100% - 20px)",margin:"10px"},progress:{marginLeft:"7px",width:"calc(100% - 14px)"},image:{width:"100%",paddingTop:"48%",backgroundPosition:"center",backgroundSize:"cover"}}};var Ql=Object($e.b)((function(e){return{store:e}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Zl)((function(e){var t=e.classes,r=De.getState().sideModule,n=r.data||{};return i.a.createElement("div",{className:t.root},r.data.image&&i.a.createElement("div",{className:t.image,style:{backgroundImage:"url(".concat(r.data.image,")")}}),n.kpi_type&&i.a.createElement(Ni,{data:n,chartShow:!0}))})));function es(e){var t=Object(Lt.a)({root:{boxShadow:"0 2px 2px 0px rgba(0,0,0,0.2)",textTransform:"none",padding:"6px 12px",border:"1px solid",lineHeight:1.5,backgroundColor:dt(e.color?e.color:"color"),borderColor:dt(e.color?e.color:"color"),color:dt("lightText"),"&:hover":{backgroundColor:dt(e.color?e.color:"color",.8),borderColor:dt(e.color?e.color:"color"),boxShadow:"0 0 0 0.2rem ".concat(dt(e.color?e.color:"color",.2))},"&:active":{boxShadow:"none",backgroundColor:dt(e.color?e.color:"color"),borderColor:dt(e.color?e.color:"color")},"&:focus":{boxShadow:"0 0 0 0.2rem ".concat(dt(e.color?e.color:"color",.2))}}})();return!e.color||e.color&&-1===["default","inherit","primary","secondary"].indexOf(e.color)?i.a.createElement(Nt.a,{className:t.root,variant:"contained",color:e.color?e.color:"primary",style:e.style?e.style:{},onClick:e.onClick?function(){return e.onClick()}:null},e.children):i.a.createElement(Nt.a,{variant:e.variant?e.variant:"contained",color:"primary",style:e.style?e.style:{},onClick:e.onClick?function(){return e.onClick()}:null},e.children)}function ts(){ts=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var rs=[{label:"$__strategic",value:null},{label:"$__operational",value:"operational"}];var ns,as=Object($e.b)((function(){return{}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(ll)((function(e){var t=e.classes,r=De.getState(),n=r.db,a=r.sideModule,o=(r.session,a.data||{}),c=i.a.useState(!1),l=Object(Be.a)(c,2),s=l[0],u=l[1],d=i.a.useState(!1),p=Object(Be.a)(d,2),f=p[0],m=p[1];i.a.useEffect((function(){f||("link"===o.type&&"new"===o._id&&u(!0),m(!0))}));var g=function(t,r){(t.value&&!a.data[t.name]||a.data[t.name]&&a.data[t.name]!==t.value)&&u(!0);var n=Object(h.a)(Object(h.a)({},a.data),{},Object(O.a)({},t.name,t.value));r&&r.name&&r.value&&(n=Object(h.a)(Object(h.a)({},n),{},Object(O.a)({},r.name,r.value))),e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},a),{},{data:Object(h.a)(Object(h.a)({},a.data),n)}))},v=function(t){s&&!t?ft({message:lt("$__confirmCloseWithUnsavedData",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){e.reduxFunction("ASYNC","CLEAR_MODULE")}}):e.reduxFunction("ASYNC","CLEAR_MODULE")},y=function(){var t=Object(Me.a)(ts().mark((function t(){var r,n=arguments;return ts().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n.length>0&&void 0!==n[0]&&n[0],u(!1),a.data.name){t.next=6;break}ft({message:lt("$__fillName",1),variant:"warning",persist:!1,horizontal:"right",confirm:null}),t.next=11;break;case 6:return t.next=8,An(e,!0,a.data);case 8:t.sent&&ft({message:lt("$__userDataSaved",1),variant:null,persist:!1,horizontal:"right",confirm:null}),r&&v(!0);case 11:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),b=function(){var t=Object(Me.a)(ts().mark((function t(){return ts().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:ft({message:lt("$__unlinkCardsConfirm",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){var t=Object(Me.a)(ts().mark((function t(){return ts().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ra(e,{cardId:o._id,_planId:o._planId});case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()});case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),x=n.dataType.filter((function(e){return e.name===a.data.type}))[0];return i.a.createElement(i.a.Fragment,null,i.a.createElement(Nc,{save:s?function(){y()}:null,saveClose:s?function(){y(!0)}:null,close:function(){v(!0)}}),i.a.createElement("div",{className:t.root},"plan"!==o.type?i.a.createElement(i.a.Fragment,null,Object.keys(n.cards).filter((function(e){return n.cards[e]._parent===o._id&&!n.cards[e].checklist})).length>0?i.a.createElement("fieldset",{style:{textAlign:"center"}},i.a.createElement("legend",{style:{color:dt("color")}},lt("$__unLinkCards",1)),i.a.createElement("div",{style:{textAlign:"center",width:"100%"}},lt("$__unLinkCardsDescription",1)),i.a.createElement(es,{onClick:function(){b()}},lt("$__unLinkCards",1))):i.a.createElement("fieldset",{style:{marginBottom:"14px"}},(!x.hideFields||x.hideFields&&-1===x.hideFields.indexOf("type"))&&i.a.createElement(Zc,{id:"combo-box-demo",options:n.type,getOptionLabel:function(e){return lt(e.label,1)},style:{width:"100%"},name:"type",disableClearable:!0,value:o&&o.type&&n&&n.type?n.type.filter((function(e){return String(e.value)===String(o.type)}))[0]:n.type[0],renderInput:function(e){return i.a.createElement(La,Object.assign({},e,{label:lt("$__type",1),variant:dt("fieldVariant"),value:o&&o.type&&n&&n.type?n.type.filter((function(e){return String(e.value)===String(o.type)}))[0]:n.type[0]}))},onChange:function(e,t){g({name:"type",value:t.value})}}))):i.a.createElement(i.a.Fragment,null),"plan"===o.type?i.a.createElement("fieldset",{style:{marginBottom:"14px",marginTop:30}},i.a.createElement(Zc,{id:"combo-box-demo",options:rs,getOptionLabel:function(e){return lt(e.label,1)},style:{width:"100%"},name:"type",disableClearable:!0,value:o&&o.planType?rs.filter((function(e){return e.value===o.planType}))[0]:rs[0],renderInput:function(e){return i.a.createElement(La,Object.assign({},e,{label:lt("$__planType",1),variant:dt("fieldVariant"),value:o&&o.planType?rs.filter((function(e){return e.value===o.planType}))[0]:rs[0]}))},onChange:function(e,t){g({name:"planType",value:t.value})}}),rs.filter((function(e){return!o.planType||o.planType&&e.value===o.planType&&!0===e.swot})).length>0?i.a.createElement("div",{style:{position:"relative",width:"100%"}},i.a.createElement("div",{style:{width:"fit-content",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold",color:dt("color")}},i.a.createElement(kt,{icon:G.a,color:dt("color"),size:25}),i.a.createElement("span",{style:{marginLeft:15}},"MATRIX SWOT"))):i.a.createElement(i.a.Fragment,null),rs.filter((function(e){return!o.planType||o.planType&&e.value===o.planType&&!0===e.swot})).length>0?i.a.createElement("div",null,lt("$__strategicplandescription",1)):i.a.createElement("div",null,lt("$__operationalplandescription",1))):i.a.createElement(i.a.Fragment,null)))})));function os(){os=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var is,cs=Xe.default.div(ns||(ns=Object(ze.a)(["\n","\n","\n","\n","\n","\n","\n width:calc(100%) !important\n"])),(function(e){return e.selectable&&e.selected?"\n opacity:1":e.selectable?"\n opacity:0.5":""}),(function(e){return e.locked?"cursor:no-drop !important":"cursor:pointer"}),(function(e){return e.priority&&e.showCard,""}),(function(e){return!e.selectable&&e.selected?"border-bottom:solid 5px ".concat(dt("color")):""}),(function(e){return e.isDragDisable?"":e.isDragging?"\n opacity:0.88\n max-width:320px":""}),(function(e){return e.inLine?"position:relative\n float:left\n margin:1px\n width:calc(20% - 7px)\n // maxWidth:320px\n ":"\n width:calc(100%) !important\n margin:1px 0px 1px 0px\n "})),ls=Object($e.b)((function(){return{}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(pi)((function(e){var t=e.classes,r=De.getState().db,n=e.data&&e.data._id?De.getState().db.cards[e.data._id]:{},a=i.a.useState(n.name?n.name:""),o=Object(Be.a)(a,2),c=o[0],l=o[1],s=i.a.useState(!1),u=Object(Be.a)(s,2),d=u[0],p=u[1],f=i.a.useState(!1),m=Object(Be.a)(f,2),g=m[0],v=m[1],y=function(){var t=Object(Me.a)(os().mark((function t(r){return os().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:pa(Object(h.a)(Object(h.a)({},e),{},{data:{_id:n._id}}),r),p(!1);case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),b=function(){var e=Object(Me.a)(os().mark((function e(){return os().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:ft({message:lt("$__confirmDeleteThisFullDescription",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){y({deleted:!0})}});case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return i.a.createElement(cs,Object.assign({},e.provided&&e.provided.draggableProps,e.key?{key:e.key}:{},{ref:e.provided&&e.provided.innerRef,isDragging:e.snapshot&&e.snapshot.isDragging,isDragDisable:n.isDragDisable||e.isDragDisable||!1,inLine:e.inLine,selectable:e.showSelected,selected:n._selected,priority:n.priority?r.priority.filter((function(e){return String(e.value)===String(n.priority)}))[0].color:null,locked:e.locked||!1,className:e.showCard?t.cardContainer:t.container}),i.a.createElement("div",e.provided&&e.provided.dragHandleProps,d?i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",padding:"7px",display:"flex",alignItems:"center"}},i.a.createElement("div",{style:{width:"calc(100% - 50px)",display:"flex"}},i.a.createElement(La,{label:lt("$__taskTitle"),variant:dt("fieldVariant"),name:"name",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",onChange:function(e){l(e.target.value)},onBlur:function(e){""===e.target.value&&p(!d)},onKeyDown:function(e){13===e.keyCode&&c&&y({name:c}),27===e.keyCode&&(p(!d),l())}},autoFocus:!0,value:c,placeholder:lt("$__taskTitlePlaceholder")})),i.a.createElement("div",{style:{display:"flex"}},i.a.createElement("div",{onClick:function(){return y({name:c})}},i.a.createElement(kt,{color:"green",icon:"save",title:lt("$__save","*"),size:e.actionsSize||"25px"})),i.a.createElement("div",{onClick:function(){p(!d),l("")}},i.a.createElement(kt,{color:dt("medium"),icon:"cancel",title:lt("$__cancel","*"),size:e.actionsSize||"25px"}))))):i.a.createElement("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},onMouseOver:function(){v(!0)},onMouseLeave:function(){v(!1)}},i.a.createElement("div",Object.assign({style:{width:"100%",padding:"0px 7px",wordBreak:"break-word"},onDoubleClick:function(){p(!d)}},e.provided?{provided:e.provided}:{},e.snapshot?{snapshot:e.snapshot}:{}),e.showCard?i.a.createElement(oc,{db:"cards",data:e.data,viewTimer:!0,viewAllName:!0}):n.name?n.name:lt("$__new",1)),"completed"!==n.status||e.showCard?i.a.createElement(i.a.Fragment,null):i.a.createElement("div",{style:{position:"absolute",top:0,bottom:0,left:0,right:0,backgroundColor:"rgba(0,0,0,0.05)",display:"flex",alignItems:"center"}},i.a.createElement("div",{style:{position:"absolute",top:"50%",marginLeft:15,height:1,width:"calc(100% - 50px)",backgroundColor:"rgba(0,0,0,0.1)"}}),n.completed_at?i.a.createElement("div",{style:{position:"absolute",right:33,top:"calc(50% - 15px)",fontSize:10,textAlign:"right",backgroundColor:"#f1f1f1",paddingLeft:7}},Ot(n.completed_at)):i.a.createElement(i.a.Fragment,null)),g&&e.permission&&i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},i.a.createElement(At,{title:lt("$__deleteThis",1),color:"lightgrey",icon:"delete_forever",onClick:function(){return b()},transparent:!0})))),e.locked?i.a.createElement("div",{style:{position:"absolute",backgroundColor:"rgba(233,233,233,0.88)",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"}},i.a.createElement("div",{style:{display:"flex"}},i.a.createElement(kt,{color:"lightgray",icon:"lock",size:"22px"}))):i.a.createElement(i.a.Fragment,null))})));function ss(){ss=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var us=Xe.default.div(is||(is=Object(ze.a)(["\n background-color:none\n ","\n "])),(function(e){return e.isDragDisable?"":e.isDragging?"opacity:0.88":""}));Object($e.b)((function(e){return{cards:e.db.cards}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.db,n=(t.session,De.getState().functions.socket),a=i.a.useState(e.name?e.name:""),o=Object(Be.a)(a,2),c=(o[0],o[1],i.a.useState(!1)),l=Object(Be.a)(c,2),s=l[0],u=l[1],d=i.a.useState(!1),p=Object(Be.a)(d,2),f=p[0],m=(p[1],i.a.useState(!1)),g=Object(Be.a)(m,2),v=(g[0],g[1],i.a.useState(!1)),y=Object(Be.a)(v,2),b=y[0],x=y[1],_=(Ve()().tz("America/Sao_Paulo").format("YYYY/MM/DD"),i.a.useState(!e.myDay)),w=Object(Be.a)(_,2),E=(w[0],w[1],window.location.hash.split("/"));E[0]=E[0].replace("#",""),36!==E[0].length&&(E[0]=null);var j={};De.getState().db[e.db]&&De.getState().db[e.db][e.nodeId]&&(j=De.getState().db[e.db][e.nodeId]);var S=Object.keys(De.getState().db.cards).filter((function(t){if("step"===De.getState().db.cards[t].type&&String(De.getState().db.cards[t].step)&&De.getState().db.cards[t].checklist&&De.getState().db.cards[t]._parent===e.nodeId)return!0})).sort((function(e,t){var n=parseInt(r.cards[e].step)||0,a=parseInt(r.cards[t].step)||0;return n<a?-1:n>a?1:0})).map((function(e){return e})),k=function(){var t=Object(Me.a)(ss().mark((function t(a){var o,i,c,l,s;return ss().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(x(!1),o=a.destination,i=a.source,c=a.draggableId,o){t.next=4;break}return t.abrupt("return",!1);case 4:if(o.droppableId!==i.droppableId||o.id!==i.index){t.next=6;break}return t.abrupt("return",!1);case 6:return l=Array.from(S.filter((function(e){return"completed"!==r.cards[e].status})).sort((function(e,t){var n=r.cards[e].order||0;String(n.low)&&(n=parseInt(n.low));var a=r.cards[t].order||0;return String(a.low)&&(a=parseInt(a.low)),n<a?-1:n>a?1:0})).map((function(e){return e}))),console.log(l),l.splice(i.index,1),t.next=11,setTimeout(500);case 11:return l.splice(o.index,0,c),t.next=14,setTimeout(500);case 14:return n.emit("data",{module:"cards",method:"put",action:"reorder"},{cards:l}),s=Object(h.a)({},De.getState().db.cards),t.next=18,new Promise((function(e,t){l.map((function(t,r){s=Object(h.a)(Object(h.a)({},s),{},Object(O.a)({},t,Object(h.a)(Object(h.a)({},s[t]),{},{order:"".concat(r+1)}))),r+1===l.length&&e(!0)}))}));case 18:return t.sent&&e.reduxFunction("IMMEDIATE","SET_DB",Object(h.a)(Object(h.a)({},r),{},{cards:Object(h.a)(Object(h.a)({},r.cards),s)})),t.abrupt("return");case 21:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),L=function(){var e=Object(Me.a)(ss().mark((function e(t){return ss().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:x(!0);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),C=function(){var e=Object(Me.a)(ss().mark((function e(t){return ss().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),I=S.filter((function(e){return"completed"!==r.cards[e].status})).sort((function(e,t){var n=r.cards[e]&&r.cards[e].order&&!r.cards[e].order.low?parseInt(r.cards[e].order):r.cards[e].order&&r.cards[e].order.low?parseInt(r.cards[e].order.low):0,a=r.cards[t]&&r.cards[t].order&&!r.cards[t].order.low?parseInt(r.cards[t].order):r.cards[t].order&&r.cards[t].order.low?parseInt(r.cards[t].order.low):0;return n<a?-1:n>a?1:0}));return i.a.createElement("div",{style:{width:"100%"},onClick:function(e){return e.stopPropagation()}},e.showProgress&&S.length>0?i.a.createElement("div",{style:{position:"relative",width:"100%"}},i.a.createElement("div",{style:{position:"absolute",right:7,bottom:0,fontSize:9,color:dt("menu"),fontWeight:"bold"}},S.filter((function(e){return"completed"===r.cards[e].status})).length,"/",i.a.createElement("span",{style:{fontWeight:"normal"}},S.length)),i.a.createElement("div",{style:{position:"relative",width:"100%",height:5,backgroundColor:"lightGray"}},i.a.createElement("div",{style:{position:"absolute",top:0,left:0,bottom:0,backgroundColor:dt("menu"),width:"".concat(100/S.length*S.filter((function(e){return"completed"===r.cards[e].status})).length,"%")}}))):i.a.createElement(i.a.Fragment,null),i.a.createElement(di.a,{onDragEnd:k,onDragStart:L,onDragUpdate:C},i.a.createElement(di.c,{droppableId:"Drop_tasks",type:"column",direction:"vertical"},(function(t,n){return i.a.createElement(us,Object.assign({ref:t.innerRef},t.droppableProps,{isDraggingOver:n.isDraggingOver}),I.map((function(t,n){return i.a.createElement(di.b,{draggableId:t,index:n,key:"".concat(t).concat(n)},(function(n,a){return i.a.createElement(ls,{dragStatus:b,provided:n,snapshot:a,data:r.cards[t],db:"cards",showCard:!0,permission:e.permission})}))})),t.placeholder)}))),!s&&!f&&(e.permission||e.myDay)&&i.a.createElement("div",{style:{position:"relative",float:"right",width:"100%",padding:"7px",display:"flex",alignContent:"flex-end",justifyContent:"center"}},i.a.createElement("div",null,i.a.createElement(rn,{reverse:!0,text:lt("$__add","*"),icon:"add_box",iconColor:dt("medium"),onClick:function(){u(!s)}}))),s&&!f?i.a.createElement(Ei,{nodeId:j._id,checklist:!0,onCancel:function(){return u(!1)},rows:S.length,type:"step"}):f?i.a.createElement("div",{style:{position:"relative",float:"right",width:"100%",padding:"7px",display:"flex",alignContent:"flex-end",justifyContent:"center",color:dt("menu")}},lt("$__saving")):i.a.createElement(i.a.Fragment,null))}));function ds(){ds=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var ps=[{label:"$__strategic",value:null,swot:!0,description:"$__strategicPlanDescription"},{label:"$__tacticAndOrOperational",value:"operational",swot:!1,description:"$__operationalPlanDescription"}];var fs=function(e){var t=De.getState().db;return i.a.createElement(Zc,{id:"combo-box-demo",options:e.ignoreValues?t.automation.filter((function(t){return-1===e.ignoreValues.indexOf(t.value)})):t.automation,getOptionLabel:function(e){return lt(e.label,1)},style:{width:"100%"},name:e.name||"AutomationAction",disableClearable:!0,value:e.value?t.automation.filter((function(t){return String(t.value)===e.value}))[0]:t.automation[0],renderInput:function(r){return i.a.createElement(La,Object.assign({},r,{label:lt("$__action",1),variant:dt("fieldVariant"),inputProps:Object(h.a)(Object(h.a)({},r&&r.inputProps?r.inputProps:{}),{},{style:Object(h.a)(Object(h.a)({},r&&r.inputProps&&r.inputProps.style?r.inputProps.style:{}),{},{paddingLeft:7,marginTop:3,marginLeft:-5,width:"calc(100% - 7px)"})}),value:e.value?t.automation.filter((function(t){return String(t.value)===e.value}))[0]:t.automation[0]}))},renderOption:function(e,t){t.inputValue;return i.a.createElement("span",null,lt(e.label,1))},onChange:function(t,r){e.onChange(r.value)}})},hs=Object($e.b)((function(e){return{sideModule:e.sideModule,card:e.db.cards[e.sideModule.id],cards:e.db.cards}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(ll)((function(e){var t=e.classes,r=e.sideModule,n=De.getState(),a=n.db,o=n.session,c=i.a.useState({}),l=Object(Be.a)(c,2),s=l[0],u=l[1],d=i.a.useState({}),p=Object(Be.a)(d,2),f=p[0],m=p[1],g=i.a.useState(!1),v=Object(Be.a)(g,2),y=v[0],b=v[1],x=i.a.useState(!1),_=Object(Be.a)(x,2),w=_[0],E=_[1],j=i.a.useState(!1),S=Object(Be.a)(j,2),k=(S[0],S[1],i.a.useState(!1)),L=Object(Be.a)(k,2),C=L[0],I=L[1],F=i.a.useState(null),T=Object(Be.a)(F,2),N=(T[0],T[1]),P=i.a.useState(null),D=Object(Be.a)(P,2),A=(D[0],D[1]),$=i.a.useState(!1),z=Object(Be.a)($,2),M=(z[0],z[1],i.a.useState(0)),B=Object(Be.a)(M,2),Y=(B[0],B[1],i.a.useState(!1)),G=Object(Be.a)(Y,2),R=(G[0],G[1]),H=xt(),W=ia(r.id);i.a.useEffect((function(){s._id!==r.data._id&&(u(r.data),b(!1)),C||(r.data.startDate&&N(r.data&&r.data.startDate?r.data.startDate:null),r.data.endDate&&A(r.data&&r.data.endDate?r.data.endDate:null),u(r.data),b(!1),"link"!==s.type||s.name||J(),I(!0),U()),r.data.name&&""!==r.data.name.trim()&&"link"===r.data.type&&"new"===r.data._id&&(b(!0),e.reqSave&&e.reqSave(!0))}),[r.data,s]),i.a.useEffect((function(){!s.name||s.name&&""===s.name.trim?b(!1):b(!0)}),[f]);var U=function(){var t=Object(Me.a)(ds().mark((function t(){return ds().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,In(Object(h.a)(Object(h.a)({},e),{},{ignoreLoader:!0}),{idRel:[r.data._id],cardLoad:"parents"});case 2:t.sent&&R(!1);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),V=function(t,n){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(t.value&&!r.data[t.name]&&!s[t.name]||r.data[t.name]&&r.data[t.name]!==t.value||a)&&e.reqSave&&e.reqSave(!0);var o=Object(h.a)(Object(h.a)({},s),{},Object(O.a)({},t.name,t.value));n&&n.name&&n.value&&(o=Object(h.a)(Object(h.a)(Object(h.a)({},s),o),{},Object(O.a)({},n.name,n.value))),u(o),m(Object(h.a)(Object(h.a)({},f),{},Object(O.a)({},t.name,t.value),n&&n.name&&n.value?Object(O.a)({},n.name,n.value):{}))},q=function(t){y&&!t?ft({message:lt("$__confirmCloseWithUnsavedData",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){e.reduxFunction("ASYNC","CLEAR_MODULE")}}):e.reduxFunction("ASYNC","CLEAR_MODULE")},X=function(){var t=Object(Me.a)(ds().mark((function t(){var n,a=arguments;return ds().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=a.length>0&&void 0!==a[0]&&a[0],w){t.next=19;break}if(b(!1),e.reqSave&&e.reqSave(!1),s.status||(s.status="notStarted"),"new"===r.id&&r.data&&u(Object(h.a)(Object(h.a)({},s),r.data)),e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},r),{},{data:s})),s.name&&(!s.name||""!==s.name.trim())){t.next=12;break}E(!1),ft({message:lt("$__fillName",1),variant:"warning",persist:!1,horizontal:"right",confirm:null}),t.next=19;break;case 12:return t.next=14,An(Object(h.a)(Object(h.a)({},e),{},{store:Object(h.a)(Object(h.a)({},e.store),{},{db:Object(h.a)({},De.getState().db)})}),n,s);case 14:t.sent&&(f&&f.status&&(da(Object(h.a)(Object(h.a)({},e),{},{data:{_id:s._id}}),{status:f.status}),ha(e,s._id,f.status)),E(!1),ft({message:lt("$__DataSaved",1),variant:null,persist:!1,horizontal:"right",confirm:null})),b(!1),e.reqSave&&e.reqSave(!1),n&&q(!0);case 19:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),J=function(){var t=Object(Me.a)(ds().mark((function t(){var r;return ds().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ot.post("/link/content",{url:s.url});case 2:r=t.sent,u(Object(h.a)(Object(h.a)({},s),{},{content:r.data.article})),b(!0),e.reqSave&&e.reqSave(!0);case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),K=r.data&&r.data.type?a.dataType.filter((function(e){return e.name===r.data.type}))[0]:{};if(s._parent&&De.getState().db.cards[s._parent],!s)return null;var Z=De.getState().db.cards[s._id]&&De.getState().db.cards[s._id]._users&&De.getState().db.cards[s._id]._users[o._id]&&De.getState().db.cards[s._id]._users[o._id].myDay?De.getState().db.cards[s._id]._users[o._id].myDay:null,Q=(!Z||Z&&Z&&(Ve()(new Date(1e3*Z)).format("YYYY/MM/DD"),Ve()().format("YYYY/MM/DD")),s.isTemplate?s.isTemplate:la(s._id),!!e.permission&&e.permission);if(!s||!s._planId||a.cards[s._planId]&&va(s._planId)||(Q=!1),!Q&&parseInt(W)>=4&&(Q=!0),!Q&&va(s._planId)&&H&&H.admin&&H.plan&&(H.planAdmin||H.planModerate)&&(Q=!0),i.a.Fragment,s&&s.url&&s.url.indexOf(".youtube.com/watch?")>-1){var ee=s.url.split("?")[1].split("v=")[1].split("&")[0];ee&&(i.a.createElement("iframe",{width:"560",height:"315",style:{top:0,width:"100%",maxWidth:"500px",height:"100%",alignSelf:"center",position:"absolute",overflow:"hidden"},src:"https://www.youtube.com/embed/".concat(ee),title:"YouTube video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}),!0)}if(s&&s.url&&s.url.indexOf("//youtu.be/")>-1){var te=s.url.split(".be/")[1];te&&(i.a.createElement("iframe",{width:"560",height:"315",style:{top:0,width:"100%",maxWidth:"500px",height:"100%",alignSelf:"center",position:"absolute",overflow:"hidden"},src:"https://www.youtube.com/embed/".concat(te),title:"YouTube video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}),!0)}return i.a.createElement(i.a.Fragment,null,i.a.createElement(Nc,{save:y?function(){E(!0),X()}:null,saveClose:y?function(){E(!0),X(!0)}:null,saveLoader:w,close:function(){e.onClose&&e.onClose()}}),i.a.createElement("div",{className:t.root},i.a.createElement("div",{className:t.data},i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end"}},"step"===s.type&&s._id&&Q?i.a.createElement(At,{title:lt("$__openBoard",1),icon:"launch",color:"lightgray",onClick:function(){console.log("openBoard",s._id)},size:"25px"}):i.a.createElement(i.a.Fragment,null))),i.a.createElement("fieldset",{style:{marginBottom:"14px"}},i.a.createElement("legend",null,"plan"===s.type&&s._id?lt("$__plan ".concat(s.planType?ps[1].label:ps[0].label),1):lt("$__data",1)),s.created_at?i.a.createElement("div",{style:{position:"relative",fontSize:12,color:"#bfbfbf",padding:"3px 0px",marginTop:-8,textAlign:"right"}},lt("$__createdAt"),": ",Ot(s.created_at)):i.a.createElement(i.a.Fragment,null),i.a.createElement(La,{label:lt(K&&K.fieldsTitle&&K.fieldsTitle.name?K.fieldsTitle.name:"$__titleOfCard",1),variant:dt("fieldVariant"),name:"name",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"view_headline"})),onChange:function(e){V(e.target)}},value:s&&s.name?s.name:"",placeholder:lt(K&&K.fieldsTitle&&K.fieldsTitle.placeholder&&K.fieldsTitle.placeholder.name?K.fieldsTitle.placeholder.name:"$__titleOfCard_placeholder",1),disabled:!(Q&&"completed"!==s.status&&!(K&&K.disabledFields&&K.disabledFields.indexOf("name")>-1))}),W>3||s.description||Q?i.a.createElement(i.a.Fragment,null,i.a.createElement(La,{label:lt("$__description",1),variant:dt("fieldVariant"),name:"description",InputProps:{autoComplete:"new-password",multiline:!0,minRows:3,endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"toc"})),onChange:function(e){V(e.target)}},value:s&&s.description?s.description:"",placeholder:lt("$__descriptionOfCard_placeholder",1),disabled:!(Q&&"completed"!==s.status&&!(K&&K.disabledFields&&K.disabledFields.indexOf("description")>-1))})):i.a.createElement(i.a.Fragment,null)),i.a.createElement("fieldset",{style:{marginBottom:"14px"}},i.a.createElement("legend",null,lt("$__automation",1)),i.a.createElement("fieldset",{style:{marginBottom:"14px"}},i.a.createElement("legend",null,lt("$__users",1)),i.a.createElement("div",{style:{position:"relative",width:"100%",color:"gray",fontSize:10}},lt("$__automationUsersExplain",1)),i.a.createElement(fs,Object.assign({value:s.automationUsers||null,onChange:function(e){V({name:"automationUsers",value:e})}},"0"===s.step?{ignoreValues:["remove"]}:{})),s._id&&a.cards[s._id]&&a.cards[s._id]._users&&i.a.createElement(Ho,{_id:s._id,noLimit:!0,avatarSize:"33px",permission:Q})),i.a.createElement("fieldset",{style:{marginBottom:"14px"}},i.a.createElement("legend",null,lt("$__dueDate",1)),i.a.createElement("fieldset",{style:{marginBottom:"14px"}},i.a.createElement("legend",null,lt("$__due",1)),i.a.createElement(fs,{value:s.automationDueDateType||null,onChange:function(e){V({name:"automationDueDateType",value:e})},ignoreValues:["replace"]}),s.automationDueDateType&&"add"===s.automationDueDateType?i.a.createElement(La,{label:lt("$__automationDueDate",1),variant:dt("fieldVariant"),name:"automationDueDate",min:1,InputProps:{type:"number",min:1,autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},lt("$__days","*")),onChange:function(e){var t=e.target.value||1;parseInt(t)<1&&(t=1),V({name:"automationDueDate",value:t})}},value:s&&s.automationDueDate?s.automationDueDate:1}):i.a.createElement(i.a.Fragment,null))),i.a.createElement("fieldset",{style:{marginBottom:"14px"}},i.a.createElement("legend",null,lt("$__status",1)),i.a.createElement("fieldset",{style:{marginBottom:"14px"}},i.a.createElement("legend",null,lt("$__changeStatusTo",1)),i.a.createElement(fs,{value:s.automationStatusType||null,onChange:function(e){V({name:"automationStatusType",value:e})},ignoreValues:["add","remove"]}),s.automationStatusType&&"doNotChange"!==s.automationStatusType?i.a.createElement(Zc,{id:"combo-box-demo",options:a.status,getOptionLabel:function(e){return lt(e.label,1)},style:{width:"100%"},name:"automationStatus",disableClearable:!0,value:s&&s.automationStatus&&a.status?a.status.filter((function(e){return String(e.value)===String(s.automationStatus)}))[0]:a.status[0],renderInput:function(e){return i.a.createElement(La,Object.assign({},e,{label:lt("$__status",1),variant:dt("fieldVariant"),value:s&&s.automationStatus&&a.status?a.status.filter((function(e){return String(e.value)===String(s.automationStatus)}))[0]:a.status[0]}))},onChange:function(e,t){(Q||"0"!==String(W))&&V({name:"automationStatus",value:t.value})}}):i.a.createElement(i.a.Fragment,null)))))))})));function ms(){ms=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var gs=Object($e.b)((function(e){return{store:e}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.sideModule,n=t.db,a=t.functions.socket,o=i.a.useState(!1),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.useState(!1),d=Object(Be.a)(u,2),p=d[0],f=d[1],m=i.a.useState(null),g=Object(Be.a)(m,2),v=g[0],y=g[1],b=i.a.useState({}),x=Object(Be.a)(b,2),_=x[0],w=x[1],E=i.a.useState(0),j=Object(Be.a)(E,2),S=j[0],k=j[1],L=i.a.useState(""),C=Object(Be.a)(L,2),I=C[0],F=C[1],T=r.data||{},N=0;T&&"step"===T.type&&(N=Object.keys(De.getState().db.cards).filter((function(e){return De.getState().db.cards[e]._parent===T._id&&!De.getState().db.cards[e].deleted})).length),i.a.useEffect((function(){return"user"===T.type?$():f(!1),function(){}}),[]),i.a.useEffect((function(){P()}),[T._id]);var P=function(){var e=Object(Me.a)(ms().mark((function e(){var t;return ms().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ua(T._id);case 2:(t=e.sent)&&w(t);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),D=function(){var t=Object(Me.a)(ms().mark((function t(){return ms().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(N>0)){t.next=3;break}return ft({message:lt("$__beforeRemovingYouneedToMoveAllActivitiesInTheColumn",1),variant:"warning",persist:!1,horizontal:"center"}),t.abrupt("return");case 3:ft({message:lt("$__confirmDeleteThis",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){Wn(e,{_id:T._id},!1),gt(e,{_id:T._id},!1),e.reduxFunction("ASYNC","CLEAR_MODULE")}});case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),A=function(){var t=Object(Me.a)(ms().mark((function t(){return ms().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:ft({message:lt("$__confirmDeleteThisAndAllLinkedsActivies",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){Wn(e,{_id:T._id},!1,!0),e.reduxFunction("ASYNC","CLEAR_MODULE")}});case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),$=function(){var e=Object(Me.a)(ms().mark((function e(){var t;return ms().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f(!1),e.next=3,Sn.post("/Card_Count",{id:T._id,all:!0,rel:"INN"});case 3:(t=e.sent)&&(f(!0),k(t.data));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),z=function(){var e=Object(Me.a)(ms().mark((function e(){return ms().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f(!0),a.emit("data",{module:"user",method:"post",action:"migrate"},{from:T._id,fromData:T,to:v,toData:n.users[v]},Object(Me.a)(ms().mark((function e(){var t;return ms().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s(!0),t=Object(h.a)({},n.cards),Object.keys(t).filter((function(e){return t[e]._users&&t[e]._users[T._id]})).map((function(e){t[e]._users[v]||(t[e]._users=Object(h.a)(Object(h.a)({},t[e]._users),{},Object(O.a)({},v,{access:t[e]._users[T._id].access,_id:v}))),delete t[e]._users[T._id]})),f(!0);case 4:case"end":return e.stop()}}),e)}))));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return i.a.createElement("div",{style:{width:"100%"}},i.a.createElement(Nc,{close:function(){e.reduxFunction("ASYNC","CLEAR_MODULE")}}),T._id&&n.cards[T._id]&&i.a.createElement(i.a.Fragment,null,i.a.createElement("fieldset",{style:{textAlign:"center"}},i.a.createElement("legend",{style:{color:dt("color")}},lt("$__deleteOptions",1)),i.a.createElement("fieldset",{style:{textAlign:"center"}},i.a.createElement("div",{style:{textAlign:"center",width:"100%"}},"chatGroup"===T.type?lt("$__deleteThisChatGroup",1):lt("$__deleteThisActivity",1)),i.a.createElement(es,{onClick:function(){D()}},lt("$__delete",1))),"step"!==T.type&&Object.keys(_).length>0&&i.a.createElement("fieldset",{style:{textAlign:"center"}},i.a.createElement("legend",{style:{color:dt("color")}},lt("$__thisActivityHasOtherLinkedsActivities",1)),i.a.createElement("div",{style:{textAlign:"center",width:"100%",color:"red"}},lt("$__deleteAllActiviesLinkedAlert",1)),i.a.createElement(es,{onClick:function(){A()}},lt("$__deleteAll",1))))),T._id&&n.users[T._id]&&("client"===n.users[T._id].type||"group"===n.users[T._id].type||"sic"===n.users[T._id].type||"unity"===n.users[T._id].type)&&i.a.createElement("fieldset",{style:{textAlign:"center"}},i.a.createElement("legend",{style:{color:dt("color")}},lt("$__deleteOptions",1)),i.a.createElement("div",{style:{textAlign:"center",width:"100%"}},Object.keys(n.users).filter((function(e){return n.users[e]._parent===T._id})).length>0?lt("$__delete".concat(n.users[T._id].type,"WithUsersDescription"),1):lt("$__delete".concat(n.users[T._id].type,"NoUsersDescription"),1)),i.a.createElement("div",{style:{textAlign:"center",width:"100%"}},lt("$__deleteThisDescription",1)),i.a.createElement(es,{onClick:function(){D()}},lt("$__deleteThis",1))),T._id&&n.users[T._id]&&"client"!==n.users[T._id].type&&"group"!==n.users[T._id].type&&"sic"!==n.users[T._id].type&&"unity"===n.users[T._id].type&&i.a.createElement(i.a.Fragment,null,p?i.a.createElement(i.a.Fragment,null,S>0&&!l?i.a.createElement(i.a.Fragment,null,i.a.createElement("fieldset",null,i.a.createElement("legend",{style:{color:dt("color")}},lt("$__thisUserHas",1)),i.a.createElement("div",{style:{position:"relative",marginTop:"22px",bottom:"7px",width:"100%",fontSize:"12px",color:dt("mediumText"),display:"flex",justifyContent:"center",textAlign:"center"}},S," ",lt("$__items"),i.a.createElement("br",null),lt("$__deleteCountCardsExplain"))),v?i.a.createElement("fieldset",null,i.a.createElement("legend",null,lt("$__selectedUserToMigrationCards")),i.a.createElement("div",{style:{cursor:"pointer",marginBottom:"7px",display:"flex",alignItems:"center"},onClick:function(){y(null)}},i.a.createElement(nn.a,{alt:n.users[v].name,src:n.users[v].image||null,style:{marginRight:"15px"}},n.users[v].name.substr(0,1)),i.a.createElement("span",null,n.users[v].name)),i.a.createElement(es,{onClick:function(){ft({message:lt("$__confirmUserTransferData",1),autoClose:5e4,buttons:[{shadow:!0,title:lt("$__confirm"),text:lt("$__confirm"),color:"green",icon:"done_all",size:"25px",style:{marginLeft:15},onClick:function(){z()}},{shadow:!0,title:lt("$__cancel"),text:lt("$__cancel"),color:"red",icon:"close",size:"25px",style:{marginLeft:15},onClick:function(){}}],variant:"warning",persist:!1,horizontal:"right"})}},lt("$__migrate",1))):i.a.createElement("fieldset",{style:{marginTop:7,marginBottom:7}},i.a.createElement("legend",null,lt("$__chooseAUserToTransferCardsBeforeDeletingUser")),i.a.createElement(La,{label:lt("$__search","*"),variant:"standard",autoFocus:!0,value:I,InputProps:{endAdornment:i.a.createElement(To.a,{position:"start"},i.a.createElement(kt,{color:dt("color")},"search")),onChange:function(e){F(e.target.value)}}}),Object.keys(n.users).filter((function(e){return e!==T._id&&"user"===n.users[e].type&&!n.users[e].deleted&&(!T._parent&&!n.users[e]._parent||T._parent&&n.users[e]._parent===T._parent)&&(!I||I&&n.users[e].name.toLowerCase().indexOf(I.toLowerCase().trim())>-1)})).sort((function(e,t){var r=n.users[e].name.toLowerCase(),a=n.users[t].name.toLowerCase();return r<a?-1:r>a?1:0})).map((function(e){return i.a.createElement("div",{style:{cursor:"pointer",marginBottom:"7px",display:"flex",alignItems:"center"},onClick:function(){y(e)},key:e},i.a.createElement(nn.a,{alt:n.users[e].name,src:n.users[e].image||null,style:{marginRight:"15px"}},n.users[e].name.substr(0,1)),i.a.createElement("span",null,n.users[e].name))}))),i.a.createElement("fieldset",{style:{textAlign:"center"}},i.a.createElement("legend",{style:{color:dt("color")}},lt("$__deactivateThis",1)),i.a.createElement("div",{style:{textAlign:"center",width:"100%"}},lt("$__deactivateWhithoutMigration",1)),i.a.createElement(es,{onClick:function(){D()}},lt("$__deactivateThis",1)))):i.a.createElement("fieldset",{style:{textAlign:"center"}},i.a.createElement("legend",{style:{color:dt("color")}},lt("$__deactivateThis",1)),i.a.createElement("div",{style:{textAlign:"center",width:"100%"}},lt("$__deactivateUserDescription",1)),i.a.createElement(es,{onClick:function(){D()}},lt("$__deactivateThis",1)))):i.a.createElement(i.a.Fragment,null),p?i.a.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",marginTop:"33px"}},i.a.createElement(Ft,null)):i.a.createElement(i.a.Fragment,null)))}));function vs(){vs=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var ys=Object($e.b)((function(e){return{store:e}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.sideModule,n=t.db,a=t.functions.socket,o=i.a.useState(!1),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.useState(!1),d=Object(Be.a)(u,2),p=d[0],f=d[1],m=i.a.useState(null),g=Object(Be.a)(m,2),v=g[0],y=g[1],b=i.a.useState({}),x=Object(Be.a)(b,2),_=(x[0],x[1]),w=i.a.useState(0),E=Object(Be.a)(w,2),j=E[0],S=E[1],k=i.a.useState(""),L=Object(Be.a)(k,2),C=L[0],I=L[1],F=r.data||{};i.a.useEffect((function(){return"user"===F.type?P():f(!1),function(){}}),[]),i.a.useEffect((function(){T()}),[F._id]);var T=function(){var e=Object(Me.a)(vs().mark((function e(){var t;return vs().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ua(F._id);case 2:(t=e.sent)&&_(t);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),N=function(){var t=Object(Me.a)(vs().mark((function t(){return vs().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:ft({message:lt("$__confirmDeleteThis",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){Wn(e,{_id:F._id},!1),gt(e,{_id:F._id},!1),e.reduxFunction("ASYNC","CLEAR_MODULE")}});case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),P=function(){var e=Object(Me.a)(vs().mark((function e(){var t;return vs().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f(!1),e.next=3,Sn.post("/Card_Count",{id:F._id,all:!0,rel:"INN"});case 3:(t=e.sent)&&(f(!0),S(t.data));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),D=function(){var e=Object(Me.a)(vs().mark((function e(){return vs().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f(!0),a.emit("data",{module:"user",method:"post",action:"migrate"},{from:F._id,fromData:F,to:v,toData:n.users[v]},Object(Me.a)(vs().mark((function e(){var t;return vs().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s(!0),t=Object(h.a)({},n.cards),Object.keys(t).filter((function(e){return t[e]._users&&t[e]._users[F._id]})).map((function(e){t[e]._users[v]||(t[e]._users=Object(h.a)(Object(h.a)({},t[e]._users),{},Object(O.a)({},v,{access:t[e]._users[F._id].access,_id:v}))),delete t[e]._users[F._id]})),f(!0);case 4:case"end":return e.stop()}}),e)}))));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return i.a.createElement("div",{style:{width:"100%"}},i.a.createElement(Nc,{close:function(){e.reduxFunction("ASYNC","CLEAR_MODULE")}}),F._id&&n.users[F._id]&&("client"===n.users[F._id].type||"group"===n.users[F._id].type||"sic"===n.users[F._id].type||"unity"===n.users[F._id].type)&&i.a.createElement("fieldset",{style:{textAlign:"center"}},i.a.createElement("legend",{style:{color:dt("color")}},lt("$__deleteOptions",1)),i.a.createElement("div",{style:{textAlign:"center",width:"100%"}},Object.keys(n.users).filter((function(e){return n.users[e]._parent===F._id})).length>0?lt("$__delete".concat(n.users[F._id].type,"WithUsersDescription"),1):lt("$__delete".concat(n.users[F._id].type,"NoUsersDescription"),1)),i.a.createElement("div",{style:{textAlign:"center",width:"100%"}},lt("$__deleteThisDescription",1)),i.a.createElement(es,{onClick:function(){N()}},lt("$__deleteThis",1))),F._id&&n.users[F._id]&&"user"===n.users[F._id].type&&i.a.createElement(i.a.Fragment,null,p?i.a.createElement(i.a.Fragment,null,j>0&&!l?i.a.createElement(i.a.Fragment,null,i.a.createElement("fieldset",null,i.a.createElement("legend",{style:{color:dt("color")}},lt("$__thisUserHas",1)),i.a.createElement("div",{style:{position:"relative",marginTop:"22px",bottom:"7px",width:"100%",fontSize:"12px",color:dt("mediumText"),display:"flex",justifyContent:"center",textAlign:"center"}},j," ",lt("$__items"),i.a.createElement("br",null),lt("$__deleteCountCardsExplain"))),v?i.a.createElement("fieldset",null,i.a.createElement("legend",null,lt("$__selectedUserToMigrationCards")),i.a.createElement("div",{style:{cursor:"pointer",marginBottom:"7px",display:"flex",alignItems:"center"},onClick:function(){y(null)}},i.a.createElement(nn.a,{alt:n.users[v].name,src:n.users[v].image||null,style:{marginRight:"15px"}},n.users[v].name.substr(0,1)),i.a.createElement("span",null,n.users[v].name)),i.a.createElement(es,{onClick:function(){ft({message:lt("$__confirmUserTransferData",1),autoClose:5e4,buttons:[{shadow:!0,title:lt("$__confirm"),text:lt("$__confirm"),color:"green",icon:"done_all",size:"25px",style:{marginLeft:15},onClick:function(){D()}},{shadow:!0,title:lt("$__cancel"),text:lt("$__cancel"),color:"red",icon:"close",size:"25px",style:{marginLeft:15},onClick:function(){}}],variant:"warning",persist:!1,horizontal:"right"})}},lt("$__migrate",1))):i.a.createElement("fieldset",{style:{marginTop:7,marginBottom:7}},i.a.createElement("legend",null,lt("$__chooseAUserToTransferCardsBeforeDeletingUser")),i.a.createElement(La,{label:lt("$__search","*"),variant:"standard",autoFocus:!0,value:C,InputProps:{endAdornment:i.a.createElement(To.a,{position:"start"},i.a.createElement(kt,{color:dt("color")},"search")),onChange:function(e){I(e.target.value)}}}),Object.keys(n.users).filter((function(e){return e!==F._id&&"user"===n.users[e].type&&!n.users[e].deleted&&(!F._parent&&!n.users[e]._parent||F._parent&&n.users[e]._parent===F._parent)&&(!C||C&&n.users[e].name.toLowerCase().indexOf(C.toLowerCase().trim())>-1)})).sort((function(e,t){var r=n.users[e].name.toLowerCase(),a=n.users[t].name.toLowerCase();return r<a?-1:r>a?1:0})).map((function(e){return i.a.createElement("div",{style:{cursor:"pointer",marginBottom:"7px",display:"flex",alignItems:"center"},onClick:function(){y(e)},key:e},i.a.createElement(nn.a,{alt:n.users[e].name,src:n.users[e].image||null,style:{marginRight:"15px"}},n.users[e].name.substr(0,1)),i.a.createElement("span",null,n.users[e].name))}))),i.a.createElement("fieldset",{style:{textAlign:"center"}},i.a.createElement("legend",{style:{color:dt("color")}},lt("$__deactivateThis",1)),i.a.createElement("div",{style:{textAlign:"center",width:"100%"}},lt("$__deactivateWhithoutMigration",1)),i.a.createElement(es,{onClick:function(){N()}},lt("$__deactivateThis",1)))):i.a.createElement("fieldset",{style:{textAlign:"center"}},i.a.createElement("legend",{style:{color:dt("color")}},lt("$__deactivateThis",1)),i.a.createElement("div",{style:{textAlign:"center",width:"100%"}},lt("$__deactivateUserDescription",1)),i.a.createElement(es,{onClick:function(){N()}},lt("$__deactivateThis",1)))):i.a.createElement(i.a.Fragment,null),p?i.a.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",marginTop:"33px"}},i.a.createElement(Ft,null)):i.a.createElement(i.a.Fragment,null)))}));function bs(){bs=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var xs,_s,ws=Object($e.b)((function(){return{}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.db,n=t.session,a=i.a.useState(!0),o=Object(Be.a)(a,2),c=(o[0],o[1]),l=i.a.useState([]),s=Object(Be.a)(l,2),u=s[0],d=s[1],p=i.a.useState(!1),f=Object(Be.a)(p,2),m=f[0],g=f[1],v=i.a.useState(!1),y=Object(Be.a)(v,2),b=y[0],x=y[1],_=i.a.useState(""),w=Object(Be.a)(_,2),E=w[0],O=w[1],j=i.a.useState(0),S=Object(Be.a)(j,2),k=S[0],L=S[1],C=[];i.a.useEffect((function(){return x(!0),function(){d([]),c(!0)}}),[e.nodeId]),i.a.useEffect((function(){x(!0)}),[k]),i.a.useEffect((function(){b&&I()}),[b]);var I=function(){var t=Object(Me.a)(bs().mark((function t(){var n,a;return bs().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(m){t.next=5;break}return t.next=3,Po({ids:[e.nodeId],type:r.cards[e.nodeId]?"cards":"users",page:k});case 3:(n=t.sent)&&(n.length<20&&g(!0),a=Array.from(u),n.map((function(e){0===a.filter((function(t){return t&&t.data&&e&&e.data&&t.data._id===e.data._id})).length&&a.push(e)})),d(a),c(!1),x(!1));case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),F=function(t){e.reduxFunction("ASYNC","LIGHTBOX",{open:!0,files:C,file:t})};return i.a.createElement("div",{style:{position:"relative",width:"100%",height:"100%"},id:"sideModule_files"},(!E&&u.length>10||E)&&i.a.createElement("div",{style:{position:"relative",padding:"10px"}},i.a.createElement(La,{label:lt("$__fileNameSearch",1),variant:dt("fieldVariant"),name:"name",id:"sideModule_files_search",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"find_in_page"})),onChange:function(e){O(e.target.value)}},value:vt(E).toLowerCase(),placeholder:lt("$__fileNameSearch")})),i.a.createElement("div",{style:{position:"absolute",bottom:0,top:u&&u.length>10?63:0,padding:15,left:0,right:0},id:"sideModule_files_list"},i.a.createElement("legend",{style:{display:"flex",alignItems:"center",color:e.dark?dt("color"):dt("menu"),fontSize:14}},i.a.createElement(kt,{color:dt("color"),icon:"folder_open",title:lt("$__files","*"),size:"20px",style:{marginRight:"15px"}}),lt("$__files","*")),i.a.createElement("ul",{id:"filesList_".concat(e.nodeId),style:{listStyle:"none",padding:"0px",position:"absolute",bottom:0,top:33,overflowY:"auto",overflowX:"hidden",left:15,right:15},onScroll:e.horizontal?null:function(t){!function(t){var r=document.getElementById("filesList_".concat(e.nodeId));r.scrollTop+window.innerHeight+150>r.scrollHeight&&!b&&L(k+1)}()}},u&&u.length>0&&u.filter((function(e){return!E||""===E||E&&e.data.name.toLowerCase().indexOf(E.toLocaleLowerCase())>-1})).sort((function(e,t){return parseInt(e.data.created_at)<parseInt(t.data.created_at)})).map((function(t,a){C.push(t.data);var o=Object(h.a)(Object(h.a)({},t.data),{},{createdBy:t.createdBy}),c=!1;return(o.createdBy&&o.createdBy._id===n._id||e.nodeId&&r.cards[e.nodeId]&&r.cards[e.nodeId]._users&&r.cards[e.nodeId]._users[n._id]&&r.cards[e.nodeId]._users[n._id].access>2)&&(c=!0),i.a.createElement("li",{key:t.data._id,onClick:c?null:function(e){F(t.data._id),e.preventDefault()},id:"sideModule_files_file_".concat(t.data._id)},i.a.createElement(Da,{data:o,resume:!0,dark:!!e.dark,admin:c,searchText:E,openLightBox:function(){F(t.data._id)}}))})),(u.length>0||b)&&!m?i.a.createElement("li",{style:{width:"100%",textAlign:"center",position:"relative",float:"left",color:e.dark?dt("color"):dt("menu")}},i.a.createElement(Fo,null),lt("$__checkingFiles","*")):0!==u.length||b?i.a.createElement(i.a.Fragment,null):lt("$__hasNoFiles","*"))))}));function Es(){Es=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Os=Xe.default.div(xs||(xs=Object(ze.a)(["\n background-color:none;\n "]))),js=(Xe.default.div(_s||(_s=Object(ze.a)(["background-color:red;\n padding:7px;"]))),Object($e.b)((function(e){return{store:e}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.db,n=(t.session,De.getState().functions.socket),a=i.a.useState(e.name?e.name:""),o=Object(Be.a)(a,2),c=(o[0],o[1],i.a.useState(!1)),l=Object(Be.a)(c,2),s=(l[0],l[1],window.location.hash.split("/"));s[0]=s[0].replace("#",""),36!==s[0].length&&(s[0]=null),De.getState().db[e.db]&&De.getState().db[e.db][e.nodeId]&&De.getState().db[e.db][e.nodeId];var u=Object.keys(De.getState().db.cards).filter((function(t){if(!De.getState().db.cards[t].deleted&&!De.getState().db.cards[t].checklist&&De.getState().db.cards[t]._recurrenceId&&De.getState().db.cards[t]._parent===e.nodeId)return!0})).map((function(e){return e})),d=function(){var t=Object(Me.a)(Es().mark((function t(a){var o,i,c,l,s,u;return Es().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=Object.keys(De.getState().db.cards).filter((function(t){if(De.getState().db.cards[t]&&De.getState().db.cards[t].checklist&&De.getState().db.cards[t]._parent===e.nodeId)return!0})).sort((function(e,t){return r.cards[e].order&&r.cards[t].order&&String(r.cards[e].order.low)&&String(r.cards[t].order.low)&&parseInt(r.cards[e].order.low)<parseInt(r.cards[t].order.low)?-1:r.cards[e].order&&r.cards[t].order&&String(r.cards[e].order.low)&&String(r.cards[t].order.low)&&parseInt(r.cards[e].order.low)>parseInt(r.cards[t].order.low)?1:0})).map((function(e){return e})),i=a.destination,c=a.source,l=a.draggableId,i){t.next=4;break}return t.abrupt("return",!1);case 4:if(i.droppableId!==c.droppableId||i.id!==c.index){t.next=6;break}return t.abrupt("return",!1);case 6:return(s=o).splice(c.index,1),s.splice(i.index,0,l),n.emit("data",{module:"cards",method:"put",action:"reorder"},{cards:s}),u={},s.map((function(e,t){return u=Object(h.a)(Object(h.a)({},u),{},Object(O.a)({},e,r.cards[e])),u=Object(h.a)(Object(h.a)({},u),{},Object(O.a)({},e,Object(h.a)(Object(h.a)({},u[e]),{},{order:{low:"".concat(t+1)}}))),!0})),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),u)})),t.abrupt("return");case 14:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),p=function(){var e=Object(Me.a)(Es().mark((function e(t){return Es().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),f=function(){var e=Object(Me.a)(Es().mark((function e(t){return Es().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return i.a.createElement("div",{style:{width:"100%"}},i.a.createElement(di.a,{onDragEnd:d,onDragStart:p,onDragUpdate:f},i.a.createElement(di.c,{droppableId:"Drop_tasks",type:"column",direction:"vertical"},(function(e,t){return i.a.createElement(Os,Object.assign({ref:e.innerRef},e.droppableProps,{isDraggingOver:t.isDraggingOver}),u.sort((function(e,t){return r.cards[e].order&&r.cards[t].order&&String(r.cards[e].order.low)&&String(r.cards[t].order.low)&&parseInt(r.cards[e].order.low)<parseInt(r.cards[t].order.low)?-1:r.cards[e].order&&r.cards[t].order&&String(r.cards[e].order.low)&&String(r.cards[t].order.low)&&parseInt(r.cards[e].order.low)>parseInt(r.cards[t].order.low)?1:0})).map((function(e,t){return i.a.createElement(di.b,{draggableId:e,index:t,key:e},(function(t,n){return i.a.createElement(oc,{provided:t,snapshot:n,data:r.cards[e],db:"cards",onlyOption:!0,showCompleteOption:!0,directDeletion:!0,editable:!0,noShowRecurrenceCard:!0})}))})),e.placeholder)}))))}))),Ss=r(1814),ks=function(e){return{root:Object(O.a)({height:"auto",transform:"translateZ(0px)",flexGrow:1,zIndex:1e3},"height","100vh"),speedDial:{position:"absolute",bottom:e.spacing(2),right:e.spacing(2),"& .MuiFab-root":{backgroundColor:dt("color"),color:dt("lightText"),display:"flex",alignItems:"center",justifyContent:"center"}},speedDialInvisible:{right:e.spacing(2),bottom:"-60px",position:"absolute","& .MuiFab-root":{backgroundColor:dt("color"),color:dt("lightText"),display:"flex",alignItems:"center",justifyContent:"center"},"& .MuiButtonBase-root":{}}}};function Ls(){Ls=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Cs=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(ks)((function(e){var t=e.classes,r=(De.getState().functions.socket,i.a.useState({name:"plan"})),n=Object(Be.a)(r,2),a=n[0],o=n[1],c=i.a.useState(""),l=Object(Be.a)(c,2),s=l[0],u=l[1],d=i.a.useState(""),p=Object(Be.a)(d,2),f=p[0],m=(p[1],i.a.useState(null)),g=Object(Be.a)(m,2),v=g[0],y=g[1],b=i.a.useState(0),x=Object(Be.a)(b,2),_=x[0],w=x[1],E=De.getState(),O=E.db,j=E.session,S=O.cards,k=De.getState().sideModule.data;i.a.useEffect((function(){Object(Me.a)(Ls().mark((function t(){return Ls().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Tn(e,null,!1,null,"plans",!1);case 2:case"end":return t.stop()}}),t)})))()}),[]);var L=i.a.useRef(null),C=[];O.dataType.filter((function(e){return e.sendTo})).map((function(e){C.push({name:e.name})}));var I=O.users[Object.keys(O.users).find((function(e){return e.indexOf(j._id)>-1}))]._access,F=0;j._id&&O.cards[k._id]&&O.cards[k._id]._users&&O.cards[k._id]._users[Object.keys(O.cards[k._id]._users).find((function(e){return e.indexOf(j._id)>-1}))]&&(F=O.cards[k._id]._users[Object.keys(O.cards[k._id]._users).find((function(e){return e.indexOf(j._id)>-1}))]);var T=window.location.hash.split("/");T[0]=T[0].replace("#","");var N=S;N=Object.keys(N).filter((function(e){if(!N[e].archived&&!N[e].deleted&&(N[e]._users&&N[e]._id!==k._id&&N[e]._users[j._id]&&parseInt(N[e]._users[j._id].access)>2||I&&(I.owner||I.planAdmin||I.planModerate)||F&&F.access&&parseInt(F.access)>2))return!0})).map((function(e){return N[e]})),s&&(N=Object.keys(N).filter((function(e){if(N[e]&&N[e].name&&N[e].name.toLowerCase().indexOf(s.toLowerCase())>-1)return!0})).map((function(e){return N[e]}))),a&&(N=Object.keys(N).filter((function(e){if(N[e]&&N[e].type&&N[e].type===a.name)return!0})).map((function(e){return N[e]}))),N=Object.keys(N).filter((function(e){return k.type&&N[e].type&&O.dataType.filter((function(e){return e.name===k.type}))&&O.dataType.filter((function(e){return e.name===k.type})).length>0&&O.dataType.filter((function(e){return e.name===k.type}))[0].sharedIn&&(O.dataType.filter((function(e){return e.name===k.type}))[0].sharedIn.copy.indexOf(N[e].type)>-1||O.dataType.filter((function(e){return e.name===k.type}))[0].sharedIn.attach.indexOf(N[e].type)>-1||O.dataType.filter((function(e){return e.name===k.type}))[0].sharedIn.shared.indexOf(N[e].type)>-1)})).map((function(e){return N[e]}));var P=function(){var t=Object(Me.a)(Ls().mark((function t(){var r;return Ls().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r={_id:Object(Pn.a)(),cardId:k._id,idRel:v,_parent:v,type:"comment",message:f||"",shared:!0},so(e,Object(h.a)(Object(h.a)({},r),{},{user:Object(h.a)({},O.users[j._id]),files:{}})),ot.post("timeline/add",r),y(null),o({name:"plan"});case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),D=function(){var t=Object(Me.a)(Ls().mark((function t(){return Ls().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:ft({message:lt("$__confirmMoveCard",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){var t={cardId:k._id,newRel:v,planId:O.cards[v]._planId?O.cards[v]._planId:"plan"===O.cards[v].type?v:null,oldRel:k._parent};Qn(e,t)&&(y(null),o({name:"plan"}))}});case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return i.a.createElement("div",{className:t.root},i.a.createElement("div",{style:{width:"100%",padding:"15px"},ref:L},v&&O.cards[v]&&i.a.createElement(i.a.Fragment,null,i.a.createElement(oc,{db:"cards",data:O.cards[v],onlyOption:!0}),i.a.createElement("fieldset",{style:{maxWidth:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},i.a.createElement("legend",null,lt("$__action")),O.dataType.filter((function(e){return e.name===k.type})).length>0&&O.dataType.filter((function(e){return e.name===k.type}))[0].sharedIn&&O.dataType.filter((function(e){return e.name===k.type}))[0].sharedIn.shared&&O.dataType.filter((function(e){return e.name===k.type}))[0].sharedIn.shared.indexOf(O.cards[v].type)>-1&&i.a.createElement(es,{style:{position:"relative",float:"left",margin:"3px"},onClick:function(){return P()}},lt("$__share","*"))),O.dataType.filter((function(e){return e.name===k.type})).length>0&&O.dataType.filter((function(e){return e.name===k.type}))[0].sharedIn&&O.dataType.filter((function(e){return e.name===k.type}))[0].sharedIn.attach&&O.dataType.filter((function(e){return e.name===k.type}))[0].sharedIn.attach.indexOf(O.cards[v].type)>-1&&i.a.createElement("fieldset",{style:{maxWidth:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},i.a.createElement("legend",null,lt("$__AttachInCard")),i.a.createElement(es,{style:{position:"relative",float:"left",margin:"3px"},onClick:function(){return D()}},lt("$__Attach","*"))),i.a.createElement("fieldset",{style:{maxWidth:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},i.a.createElement(es,{style:{position:"relative",float:"left",margin:"3px"},color:"red",onClick:function(){y(null)}},lt("$__cancel","*"))))),i.a.createElement("div",{style:{padding:"15px"}},i.a.createElement(Zc,{dbNode:"typeFilter",options:C,getOptionLabel:function(e){return lt("$__".concat(e.name),1)},style:{width:"100%"},name:"typeFilter",disableClearable:!0,value:a,renderInput:function(e){return i.a.createElement(La,Object.assign({},e,{label:lt("$__cardType",1),variant:dt("outlined")}))},onChange:function(e,t){o(t)}})),i.a.createElement("div",{style:{padding:"15px"}},i.a.createElement(La,{label:lt("$__search",1),variant:"outlined",name:"search",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",onChange:function(e){u(e.target.value),w(0)}},value:s})),i.a.createElement("div",{style:{maxWidth:"100%"}},Object.keys(N).length>25&&i.a.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"center"}},i.a.createElement(Ss.a,{count:Object.keys(N).length,size:"small",page:_,onChange:function(e,t){w(t)}})),Object.keys(N).filter((function(e){return!v||(!(!v||N[e]._parent!==v&&N[e]._planId!==v)||void 0)})).map((function(e,t){if(t<=25*(_+1)&&t>=25*_)return i.a.createElement(oc,{db:"cards",key:t,data:N[e],notGlobalExpanded:!0,onlyOption:!0,onClick:function(t){y(N[e]._id),w(0),L.current.scrollIntoView()}})}))))}))),Is=r(253),Fs=r(256),Ts=r.n(Fs);var Ns=function(e){var t=Ts.a.ExcelFile,r=Ts.a.ExcelFile.ExcelSheet,n=Ts.a.ExcelFile.ExcelColumn,a=e.data,o=[],c=[],l=0,s=0,u=0,d=0;if(a&&Object.keys(a).length>0){Object.keys(a).map((function(e){var t=[];a[e]._times&&Object.keys(a[e]._times>0)&&Object.keys(a[e]._times).map((function(r){var n=De.getState().db.cards[a[e]._times[r].cardId],i=parseInt(a[e]._times[r].fin)-parseInt(a[e]._times[r].ini);l+=i;var c=i,s="",u=0,d=0,p=0;i<60?s="".concat(c," ").concat(lt("$__seconds",1)):i>3600?(c-=3600*(u=Math.trunc(c/3600)),p=(c-=60*(d=Math.trunc(c/60)>0?Math.trunc(c/60):0))>0?c:0,s="".concat(u," ").concat(lt("$__hour",1)).concat(u>1?"s":""," ").concat(d," ").concat(lt("$__minutes",1)," ").concat(p," ").concat(lt("$__seconds",1))):(p=(c-=60*(d=Math.trunc(c/60)>0?Math.trunc(c/60):0))>0?c:0,s="".concat(d," ").concat(lt("$__minutes",1)," ").concat(p," ").concat(lt("$__seconds",1))),o.push({name:a[e].name,type:lt("$__".concat(n.type),1),card:n.name,description:a[e]._times[r].message,iniData:Ve()(1e3*a[e]._times[r].ini).tz("America/Sao_Paulo").format("YYYY/MM/DD HH:mm:ss"),finalData:Ve()(1e3*a[e]._times[r].fin).tz("America/Sao_Paulo").format("YYYY/MM/DD HH:mm:ss"),total:s,hours:u,minutes:d,seconds:p,calc:(parseInt(a[e]._times[r].fin)-parseInt(a[e]._times[r].ini))/3600}),t.push({name:a[e].name,type:lt("$__".concat(n.type),1),card:n.name,description:a[e]._times[r].message,iniData:Ve()(1e3*a[e]._times[r].ini).tz("America/Sao_Paulo").format("YYYY/MM/DD HH:mm:ss"),finalData:Ve()(1e3*a[e]._times[r].fin).tz("America/Sao_Paulo").format("YYYY/MM/DD HH:mm:ss"),total:s,hours:u,minutes:d,seconds:p,calc:(parseInt(a[e]._times[r].fin)-parseInt(a[e]._times[r].ini))/3600})})),console.log(a[e]),t.push({name:"",email:"",type:"",card:"",description:"",iniData:"",finalData:"",total:a[e].timerText,hours:"",minutes:"",seconds:"",calc:parseInt(a[e].totalTimer)/3600}),c=Object(h.a)(Object(h.a)({},c),{},Object(O.a)({},e,t))}));var p=l,f="";l<60?(d=p,f="".concat(p," ").concat(lt("$__seconds",1))):l>3600?(p-=3600*(s=Math.trunc(p/3600)),d=(p-=60*(u=Math.trunc(p/60)>0?Math.trunc(p/60):0))>0?p:0,f="".concat(s," ").concat(lt("$__hour",1)).concat(s>1?"s":""," ").concat(u," ").concat(lt("$__minutes",1)," ").concat(d," ").concat(lt("$__seconds",1))):(d=(p-=60*(u=Math.trunc(p/60)>0?Math.trunc(p/60):0))>0?p:0,f="".concat(u," ").concat(lt("$__minutes",1)," ").concat(d," ").concat(lt("$__seconds",1))),o.push({name:"",type:"",card:"",description:"",iniData:"",finalData:"",total:f,hours:"",minutes:"",seconds:"",calc:""})}return i.a.createElement(t,{filename:"".concat(Ve()(new Date).tz("America/Sao_Paulo").format("YYYY-MM-DDTHHMM"),"_timeSheet"),element:i.a.createElement(At,{title:lt("$__export"),text:lt("$__export"),icon:"file_download",size:"25px"})},i.a.createElement(r,{data:o,name:"timeSheet"},i.a.createElement(n,{style:{alignment:{wrapText:!0}},label:"".concat(lt("$__name",1)),value:"name"}),i.a.createElement(n,{style:{alignment:{wrapText:!0}},label:"".concat(lt("$__type",1)),value:"type"}),i.a.createElement(n,{style:{alignment:{wrapText:!0}},label:"".concat(lt("$__card",1)),value:"card"}),i.a.createElement(n,{style:{alignment:{wrapText:!0}},label:"".concat(lt("$__description",1)),value:"description"}),i.a.createElement(n,{style:{alignment:{wrapText:!0}},label:"".concat(lt("$__initialTimer",1)),value:"iniData"}),i.a.createElement(n,{style:{alignment:{wrapText:!0}},label:"".concat(lt("$__finalTimer",1)),value:"finalData"}),i.a.createElement(n,{style:{alignment:{wrapText:!0}},label:"".concat(lt("$__totalTime",1)),value:"total"}),i.a.createElement(n,{style:{alignment:{wrapText:!0}},label:"".concat(lt("$__hours",1)),value:"hours"}),i.a.createElement(n,{style:{alignment:{wrapText:!0}},label:"".concat(lt("$__minutes",1)),value:"minutes"}),i.a.createElement(n,{style:{alignment:{wrapText:!0}},label:"".concat(lt("$__seconds",1)),value:"seconds"}),i.a.createElement(n,{style:{alignment:{wrapText:!0}},label:"".concat(lt("$__valueForCalculation",1)),value:"calc"})),c&&Object.keys(c).length>0&&Object.keys(c).map((function(e,t){var a=c[e][0].name;return i.a.createElement(r,{data:c[e],name:a,key:e},i.a.createElement(n,{style:{alignment:{wrapText:!0}},label:"".concat(lt("$__name",1)),value:"name"}),i.a.createElement(n,{style:{alignment:{wrapText:!0}},label:"".concat(lt("$__type",1)),value:"type"}),i.a.createElement(n,{style:{alignment:{wrapText:!0}},label:"".concat(lt("$__card",1)),value:"card"}),i.a.createElement(n,{style:{alignment:{wrapText:!0}},label:"".concat(lt("$__description",1)),value:"description"}),i.a.createElement(n,{style:{alignment:{wrapText:!0}},label:"".concat(lt("$__initialTimer",1)),value:"iniData"}),i.a.createElement(n,{style:{alignment:{wrapText:!0}},label:"".concat(lt("$__finalTimer",1)),value:"finalData"}),i.a.createElement(n,{style:{alignment:{wrapText:!0}},label:"".concat(lt("$__totalTime",1)),value:"total"}),i.a.createElement(n,{style:{alignment:{wrapText:!0}},label:"".concat(lt("$__hours",1)),value:"hours"}),i.a.createElement(n,{style:{alignment:{wrapText:!0}},label:"".concat(lt("$__minutes",1)),value:"minutes"}),i.a.createElement(n,{style:{alignment:{wrapText:!0}},label:"".concat(lt("$__seconds",1)),value:"seconds"}),i.a.createElement(n,{style:{alignment:{wrapText:!0}},label:"".concat(lt("$__valueForCalculation",1)),value:"calc"}))})))},Ps={card:{border:"0",marginBottom:"30px",marginTop:"30px",borderRadius:"6px",color:"rgba("+Zt("#000")+", 0.87)",background:"#FFF",width:"100%",boxShadow:"0 1px 4px 0 rgba("+Zt("#000")+", 0.14)",position:"relative",display:"flex",flexDirection:"column",minWidth:"0",wordWrap:"break-word",fontSize:".875rem"},cardPlain:{background:"transparent",boxShadow:"none"},cardProfile:{marginTop:"30px",textAlign:"center"},cardBlog:{marginTop:"60px"},cardRaised:{boxShadow:"0 16px 38px -12px rgba("+Zt("#000")+", 0.56), 0 4px 25px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt("#000")+", 0.2)"},cardBackground:{backgroundPosition:"center center",backgroundSize:"cover",textAlign:"center","&:after":{position:"absolute",zIndex:"1",width:"100%",height:"100%",display:"block",left:"0",top:"0",content:'""',backgroundColor:"rgba("+Zt("#000")+", 0.56)",borderRadius:"6px"},"& small":{color:"rgba("+Zt("#FFF")+", 0.7) !important"}},cardPricing:{textAlign:"center","&:after":{backgroundColor:"rgba("+Zt("#000")+", 0.7) !important"},"& ul":{listStyle:"none",padding:0,maxWidth:"240px",margin:"10px auto"},"& ul li":{color:sr[0],textAlign:"center",padding:"12px 0px",borderBottom:"1px solid rgba("+Zt(sr[0])+",0.3)"},"& ul li:last-child":{border:0},"& ul li b":{color:sr[2]},"& h1":{marginTop:"30px"},"& h1 small":{display:"inline-flex",height:0,fontSize:"18px"},"& h1 small:first-child":{position:"relative",top:"-16px",fontSize:"26px"},"& ul li svg, & ul li .fab,& ul li .fas,& ul li .far,& ul li .fal,& ul li .material-icons":{position:"relative",top:"7px"}},cardPricingColor:{"& ul li":{color:"#FFF",borderColor:"rgba("+Zt("#FFF")+",0.3)","& b, & svg,& .fab,& .fas,& .far,& .fal,& .material-icons":{color:"#FFF",fontWeight:"700"}}},cardProduct:{marginTop:"30px"},primary:{background:"linear-gradient(60deg,"+nr[1]+","+nr[4]+")","& h1 small":{color:"rgba("+Zt("#FFF")+", 0.8)"},color:"#FFF"},info:{background:"linear-gradient(60deg,"+cr[1]+","+cr[4]+")","& h1 small":{color:"rgba("+Zt("#FFF")+", 0.8)"},color:"#FFF"},success:{background:"linear-gradient(60deg,"+ir[1]+","+ir[4]+")","& h1 small":{color:"rgba("+Zt("#FFF")+", 0.8)"},color:"#FFF"},warning:{background:"linear-gradient(60deg,"+ar[1]+","+ar[4]+")","& h1 small":{color:"rgba("+Zt("#FFF")+", 0.8)"},color:"#FFF"},danger:{background:"linear-gradient(60deg,"+or[1]+","+or[4]+")","& h1 small":{color:"rgba("+Zt("#FFF")+", 0.8)"},color:"#FFF"},rose:{background:"linear-gradient(60deg,"+lr[1]+","+lr[4]+")","& h1 small":{color:"rgba("+Zt("#FFF")+", 0.8)"},color:"#FFF"},cardChart:{"& p":{marginTop:"0px",paddingTop:"0px"}},cardLogin:{transform:"translate3d("+Zt("#000")+")",transition:"all 300ms linear"}},Ds=["className","children","plain","profile","blog","raised","background","pricing","color","product","testimonial","chart","login"],As=Object(Lt.a)(Ps);function $s(e){var t,r=As(),n=e.className,a=e.children,o=e.plain,c=e.profile,l=e.blog,s=e.raised,u=e.background,d=e.pricing,p=e.color,f=e.product,h=e.testimonial,m=e.chart,g=e.login,v=Object(Kt.a)(e,Ds),y=We()((t={},Object(O.a)(t,r.card,!0),Object(O.a)(t,r.cardPlain,o),Object(O.a)(t,r.cardProfile,c||h),Object(O.a)(t,r.cardBlog,l),Object(O.a)(t,r.cardRaised,s),Object(O.a)(t,r.cardBackground,u),Object(O.a)(t,r.cardPricingColor,d&&void 0!==p||d&&void 0!==u),Object(O.a)(t,r[p],p),Object(O.a)(t,r.cardPricing,d),Object(O.a)(t,r.cardProduct,f),Object(O.a)(t,r.cardChart,m),Object(O.a)(t,r.cardLogin,g),Object(O.a)(t,n,void 0!==n),t));return i.a.createElement("div",Object.assign({className:y},v),a)}var zs={cardBody:{padding:"0.9375rem 20px",flex:"1 1 auto",WebkitBoxFlex:"1",position:"relative"},cardBodyBackground:{position:"relative",zIndex:"2",minHeight:"280px",paddingTop:"40px",paddingBottom:"40px",maxWidth:"440px",margin:"0 auto"},cardBodyPlain:{paddingLeft:"5px",paddingRight:"5px"},cardBodyFormHorizontal:{paddingLeft:"15px",paddingRight:"15px","& form":{margin:"0"}},cardPricing:{padding:"15px!important",margin:"0px!important"},cardSignup:{padding:"0px 30px 0px 30px"},cardBodyColor:{borderRadius:"6px","& h1,& h2,& h3":{"& small":{color:"rgba("+Zt("#FFF")+", 0.8)"}}},cardBodyProfile:{marginTop:"15px"},cardBodyCalendar:{padding:"0px !important"}},Ms=["className","children","background","plain","formHorizontal","pricing","signup","color","profile","calendar"],Bs=Object(Lt.a)(zs);function Ys(e){var t,r=Bs(),n=e.className,a=e.children,o=e.background,c=e.plain,l=e.formHorizontal,s=e.pricing,u=e.signup,d=e.color,p=e.profile,f=e.calendar,h=Object(Kt.a)(e,Ms),m=We()((t={},Object(O.a)(t,r.cardBody,!0),Object(O.a)(t,r.cardBodyBackground,o),Object(O.a)(t,r.cardBodyPlain,c),Object(O.a)(t,r.cardBodyFormHorizontal,l),Object(O.a)(t,r.cardPricing,s),Object(O.a)(t,r.cardSignup,u),Object(O.a)(t,r.cardBodyColor,d),Object(O.a)(t,r.cardBodyProfile,p),Object(O.a)(t,r.cardBodyCalendar,f),Object(O.a)(t,n,void 0!==n),t));return i.a.createElement("div",Object.assign({className:m},h),a)}var Gs={cardHeader:{padding:"0.75rem 1.25rem",marginBottom:"0",borderBottom:"none",background:"transparent",zIndex:"3 !important","&$cardHeaderPlain,&$cardHeaderImage,&$cardHeaderContact,&$cardHeaderSignup,&$cardHeaderIcon,&$cardHeaderStats,&$warningCardHeader,&$successCardHeader,&$dangerCardHeader,&$infoCardHeader,&$primaryCardHeader,&$roseCardHeader, &$customCardHeader":{margin:"0 15px",padding:"0",position:"relative",color:"#FFF"},"&:first-child":{borderRadius:"calc(.25rem - 1px) calc(.25rem - 1px) 0 0"},"&$warningCardHeader,&$successCardHeader,&$dangerCardHeader,&$infoCardHeader,&$primaryCardHeader,&$roseCardHeader,&$customCardHeader":{"&:not($cardHeaderIcon):not($cardHeaderImage):not($cardHeaderText)":{borderRadius:"3px",marginTop:"-20px",padding:"15px"}},"&$cardHeaderStats svg":{fontSize:"36px",lineHeight:"56px",textAlign:"center",width:"36px",height:"36px",margin:"10px 10px 4px"},"&$cardHeaderStats .fab,&$cardHeaderStats .fas,&$cardHeaderStats .far,&$cardHeaderStats .fal,&$cardHeaderStats .material-icons":{fontSize:"36px",lineHeight:"56px",width:"56px",height:"56px",textAlign:"center",overflow:"unset",marginBottom:"1px"},"&$cardHeaderStats$cardHeaderIcon":{textAlign:"right"},"&$cardHeaderImage":{marginLeft:"15px",marginRight:"15px",marginTop:"-30px",borderRadius:"6px"},"&$cardHeaderText":{display:"inline-block"}},cardHeaderPlain:{marginLeft:"0px",marginRight:"0px","&$cardHeaderImage":{margin:"0 !important"}},cardHeaderImage:{position:"relative",padding:"0",zIndex:"1","& img":{width:"100%",borderRadius:"6px",pointerEvents:"none",boxShadow:"0 5px 15px -8px rgba("+Zt("#000")+", 0.24), 0 8px 10px -5px rgba("+Zt("#000")+", 0.2)"},"& a":{display:"block"}},cardHeaderContact:{margin:"0 15px",marginTop:"-20px"},cardHeaderSignup:{marginLeft:"20px",marginRight:"20px",marginTop:"-40px",padding:"20px 0",width:"100%",marginBottom:"15px"},cardHeaderStats:{"& $cardHeaderIcon":{textAlign:"right"},"& h1,& h2,& h3,& h4,& h5,& h6":{margin:"0 !important"}},cardHeaderIcon:{"&$warningCardHeader,&$successCardHeader,&$dangerCardHeader,&$infoCardHeader,&$primaryCardHeader,&$roseCardHeader,&$customCardHeader":{background:"transparent",boxShadow:"none"},"& .fab,& .fas,& .far,& .fal,& .material-icons":{width:"33px",height:"33px",textAlign:"center",lineHeight:"33px"},"& svg":{width:"24px",height:"24px",textAlign:"center",lineHeight:"33px",margin:"5px 4px 0px"}},cardHeaderText:{},warningCardHeader:{color:"#FFF","&:not($cardHeaderText):not($cardHeaderIcon)":Object(h.a)({},vr)},successCardHeader:{color:"#FFF","&:not($cardHeaderText):not($cardHeaderIcon)":Object(h.a)({},yr)},dangerCardHeader:{color:"#FFF","&:not($cardHeaderText):not($cardHeaderIcon)":Object(h.a)({},br)},infoCardHeader:{color:"#FFF","&:not($cardHeaderText):not($cardHeaderIcon)":Object(h.a)({},xr)},primaryCardHeader:{color:"#FFF","&:not($cardHeaderText):not($cardHeaderIcon)":Object(h.a)({},_r)},roseCardHeader:{color:"#FFF","&:not($cardHeaderText):not($cardHeaderIcon)":Object(h.a)({},wr)},customCardHeader:{color:"#FFF","&:not($cardHeaderText):not($cardHeaderIcon)":Object(h.a)({},{})}},Rs=["className","children","color","plain","image","contact","signup","stats","icon","text"],Hs=Object(Lt.a)(Gs);function Ws(e){var t,r=Hs(),n=e.className,a=e.children,o=e.color,c=e.plain,l=e.image,s=e.contact,u=e.signup,d=e.stats,p=e.icon,f=e.text,h=Object(Kt.a)(e,Rs),m=We()((t={},Object(O.a)(t,r.cardHeader,!0),Object(O.a)(t,r[o+"CardHeader"],o),Object(O.a)(t,r.cardHeaderPlain,c),Object(O.a)(t,r.cardHeaderImage,l),Object(O.a)(t,r.cardHeaderContact,s),Object(O.a)(t,r.cardHeaderSignup,u),Object(O.a)(t,r.cardHeaderStats,d),Object(O.a)(t,r.cardHeaderIcon,p),Object(O.a)(t,r.cardHeaderText,f),Object(O.a)(t,n,void 0!==n),t));return i.a.createElement("div",Object.assign({className:m},h),a)}var Us=r(1825),Vs=r(1805),qs=r(1804),Xs=r(1806),Js=r(1725);function Ks(){Ks=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}Object(Lt.a)((function(e){return{iconButtonStyleTransaparent:{margin:0,"&:hover":{backgroundColor:"rgba(250,250,250,0.9)"}},iconButtonStyleWhite:{margin:0,backgroundColor:"#FFFFFF","&:hover":{backgroundColor:"rgba(250,250,250,0.9)"}}}}));var Zs=Object($e.b)((function(e){return{cards:e.db.cards,timeline:e.timeline}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.db,n=t.timeline,a=i.a.useState(Ve()(new Date).tz("America/Sao_Paulo").subtract(720,"d").format("YYYY-MM-DD")),o=Object(Be.a)(a,2),c=o[0],l=o[1],s=i.a.useState(Ve()(new Date).tz("America/Sao_Paulo").format("YYYY-MM-DD")),u=Object(Be.a)(s,2),d=u[0],p=u[1],m=i.a.useState(!1),g=Object(Be.a)(m,2),v=g[0],y=g[1],b=i.a.useState({}),x=Object(Be.a)(b,2),_=x[0],w=x[1],E=i.a.useState({}),j=Object(Be.a)(E,2),S=j[0],k=j[1],L=i.a.useState(!0),C=Object(Be.a)(L,2),I=C[0],F=C[1],T=window.location.hash.split("/");T[0]=T[0].replace("#",""),i.a.useEffect((function(){return P(),function(){}}),[]),i.a.useEffect((function(){N()}),[e.cards]);var N=function(){var t=Object(Me.a)(Ks().mark((function t(){var r;return Ks().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ua(e.nodeId);case 2:r=t.sent,k(r);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),P=function(){var t=Object(Me.a)(Ks().mark((function t(){return Ks().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,uo(Object(h.a)(Object(h.a)({},e),{},{fnIdentification:"StrategyAndPlans/Dashboard/Widgers/timeSheet/init()"}),{ids:[e.nodeId],db:"cards",type:"timer",reqChildrens:!0});case 3:t.sent&&F(!1),t.next=11;break;case 7:t.prev=7,t.t0=t.catch(0),console.log(t.t0),F(!1);case 11:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}(),D={},A={},$=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="",n="";if(e<60)r="".concat(e," ").concat(lt("$__seconds",1)),r="".concat(e,"s");else if(e>3600){var a=Math.trunc(e/3600);e-=3600*a;var o=Math.trunc(e/60)>0?Math.trunc(e/60):0,i=(e-=60*o)>0?e:0;r="".concat(a," ").concat(lt("$__hour",1)).concat(a>1?"s":""," ").concat(o," ").concat(lt("$__minutes",1)," ").concat(i>0?"".concat(i," ").concat(lt("$__seconds",1)):""),n="".concat(a,"H ").concat(o,"M ").concat(i," S")}else{var c=Math.trunc(e/60)>0?Math.trunc(e/60):0,l=(e-=60*c)>0?e:0;r="".concat(c," ").concat(lt("$__minutes",1)," ").concat(l>0?"".concat(l," ").concat(lt("$__seconds",1)):""),n="".concat(c,"M ").concat(l," S")}return t?n:r};Object.keys(S).filter((function(e){return n[e]&&Object.keys(n[e]).filter((function(t){return"timer"===n[e][t].type})).length>0})).map((function(e){Object.keys(n[e]).filter((function(t){return"timer"===n[e][t].type&&!n[e][t].deleted})).map((function(t){n[e][t]._toUser&&Object.keys(n[e][t]._toUser).length>0?Object.keys(n[e][t]._toUser).map((function(r){A=Object(h.a)(Object(h.a)({},A),{},Object(O.a)({},r,Object(h.a)({},n[e][t]._toUser[r]?n[e][t]._toUser[r]:{})))})):A=Object(h.a)(Object(h.a)({},A),{},Object(O.a)({},n[e][t].user._id,Object(h.a)({},n[e][t].user)))})),Object.keys(n[e]).filter((function(t){return n[e]&&n[e][t]&&"timer"===n[e][t].type&&!n[e][t].deleted&&(0===Object.keys(_).length||Object.keys(_).length>0&&Object.keys(_).filter((function(r){return n[e]&&n[e][t]&&n[e][t].type&&"timer"===n[e][t].type&&_[r]&&n[e][t].user&&(n[e]&&n[e][t]&&n[e][t].user&&(!n[e][t]._toUser||n[e][t]._toUser&&!n[e][t]._toUser[r])&&n[e][t].user._id===r||n[e]&&n[e][t]&&n[e][t]._toUser&&n[e][t]._toUser[r]&&n[e][t]._toUser[r]!==n[e][t].user._id)})).length>0)})).map((function(t){n[e][t].message.indexOf("Primeira Entrevistas")>-1&&console.log(n[e][t]._toUser),Object.keys(A).map((function(r){if(r&&n[e]&&n[e][t]&&"timer"===n[e][t].type&&!n[e][t].deleted&&(parseInt(n[e][t].ini)>=Ve()("".concat(c," 00:00:01")).unix("X")||0===parseInt(n[e][t].ini))&&parseInt(n[e][t].fin)<=Ve()("".concat(d," 23:59:59")).unix("X")&&(n[e][t].user&&n[e][t].user._id===r&&n[e][t]._toUser&&0===Object.keys(n[e][t]._toUser).length||n[e][t]._toUser&&Object.keys(n[e][t]._toUser).length>0&&n[e][t]._toUser[r])){parseInt(n[e][t].fin)-parseInt(n[e][t].ini);var a=parseInt(n[e][t].fin)-parseInt(n[e][t].ini),o=a=D&&D[r]&&D[r].totalTimer?parseInt(D[r].totalTimer)+(parseInt(n[e][t].fin)-parseInt(n[e][t].ini)):parseInt(n[e][t].fin)-parseInt(n[e][t].ini),i="",l="";if(a<60)i="".concat(o," ").concat(lt("$__seconds",1)),i="".concat(o,"s");else if(a>3600){var s=Math.trunc(o/3600);o-=3600*s;var u=Math.trunc(o/60)>0?Math.trunc(o/60):0,p=(o-=60*u)>0?o:0;i="".concat(s," ").concat(lt("$__hour",1)).concat(s>1?"s":""," ").concat(u," ").concat(lt("$__minutes",1)," ").concat(p>0?"".concat(p," ").concat(lt("$__seconds",1)):""),l="".concat(s,"H ").concat(u,"M ").concat(p," S")}else{var f=Math.trunc(o/60)>0?Math.trunc(o/60):0,m=(o-=60*f)>0?o:0;i="".concat(f," ").concat(lt("$__minutes",1)," ").concat(m>0?"".concat(m," ").concat(lt("$__seconds",1)):""),l="".concat(f,"M ").concat(m," S")}D=Object(h.a)(Object(h.a)({},D),{},Object(O.a)({},r,Object(h.a)(Object(h.a)(Object(h.a)(Object(h.a)({},D[r]?D[r]:{}),A[r]?A[r]:{}),D&&D[r]&&D[r].totalTimer?{totalTimer:parseInt(D[r].totalTimer)+(parseInt(n[e][t].fin)-parseInt(n[e][t].ini))}:{totalTimer:parseInt(n[e][t].fin)-parseInt(n[e][t].ini)}),{},{timerText:i,timerTextMini:l,_times:Object(h.a)(Object(h.a)({},D[r]&&D[r]._times?D[r]._times:{}),{},Object(O.a)({},t,Object(h.a)(Object(h.a)({},n[e][t]),{},{cardId:e})))})))}1}))}))}));var z=function(e){return i.a.createElement("div",{style:{width:"100%",marginBottom:"10px",display:"flex",alignItems:"center"}},e.data&&e.data.name&&i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{width:"33px"}},i.a.createElement(Qe.a,{title:e.data.name},i.a.createElement(nn.a,{alt:e.data.name,src:e.data.image||null,style:{width:"33px",height:"33px"}},e.data.name.substr(0,1)))),i.a.createElement("div",{style:{marginLeft:"10px",fontWeight:"bold",color:dt("menu"),width:"33%",minWidth:"150px"}},e.data.name)),i.a.createElement("div",{style:{marginLeft:"10px",fontWeight:"bold",color:dt("menu")}},e.data.timerText))};return i.a.createElement($s,null,i.a.createElement(Io,{title:lt("$__timeSheet",1),icon:"update",color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"},customButtons:[!v&&{title:"$__timeSheetExport",icon:"file_download",color:dt("colorText"),onClick:function(){y(!v)}}]}),I?i.a.createElement("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(250,250,250,0.7)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:10}},i.a.createElement(Xr,null)):i.a.createElement(i.a.Fragment,null),v&&i.a.createElement("div",{style:{padding:"15px"}},i.a.createElement("fieldset",{style:{position:"relative",width:"100%",marginLeft:"7px",display:"flex",justifyContent:"space-between",marginBottom:"14px",marginTop:"7px"}},i.a.createElement("legend",null,lt("$__timeCourse",1)),i.a.createElement(La,{label:lt("$__initialDate",1),variant:dt("fieldVariant",1),name:"startDate",style:{marginRight:"15px"},InputLabelProps:{shrink:!0},type:"date",inputProps:{max:d||null},InputProps:{autoComplete:"new-password",onChange:function(e){l(e.target.value)}},value:c}),i.a.createElement(La,{label:lt("$__endDate",1),variant:dt("fieldVariant"),name:"endDate",type:"date",min:c||null,InputLabelProps:{shrink:!0},inputProps:{min:c||null},InputProps:{autoComplete:"new-password",onChange:function(e){p(e.target.value)}},value:d})),r.users&&Object.keys(r.users).length>0&&i.a.createElement(Us.a,{style:{width:"100%"}},i.a.createElement(qs.a,{style:{minWidth:"100%"},expandIcon:i.a.createElement(kt,null,"expand_more"),"aria-controls":"panel1a-content",id:"panel1a-header"},i.a.createElement("div",{style:{color:dt("color"),fontSize:"12px"}},lt("$__users"),i.a.createElement(Yo.a,{max:6},Object.keys(_).length>0&&Object.keys(_).map((function(e,t){return i.a.createElement(Qe.a,{title:r.users[e].name,key:t},i.a.createElement(nn.a,{alt:r.users[e].name,src:r.users[e].image||null},r.users[e].name.substr(0,1)))}))))),i.a.createElement(Vs.a,{style:{minWidth:"100%"}},i.a.createElement(Js.a,null,Object.keys(A).map((function(e){return r.users&&r.users[e]&&r.users[e]._id&&i.a.createElement(i.a.Fragment,{key:e},i.a.createElement(Xs.a,{key:e,style:{minWidth:"100%"},control:i.a.createElement(i.a.Fragment,null,i.a.createElement(nn.a,{alt:r.users[e].name.substr(0,1),src:r.users[e].image||null},r.users[e].name.substr(0,1)),i.a.createElement(Bo,{checked:!(!_||!_[e]),onChange:function(){!function(e){_[e]&&Object.keys(_).filter((function(e){return _[e]})).length<=1?w({}):w(Object(h.a)(Object(h.a)({},_),{},Object(O.a)({},e,!_[e])))}(e)},color:"default"})),label:r.users[e].name||r.users[e].name}))}))))),i.a.createElement("div",{style:{display:"flex",justifyContent:"center",marginTop:"7px"}},i.a.createElement(Ns,{data:D}),i.a.createElement(At,{title:lt("$__closeFilter"),text:lt("$__closeFilter"),color:"lightgrey",textColor:"lightgrey",icon:"cancel",onClick:function(){y(!v)},size:"25px"}))),i.a.createElement(Ws,{style:{height:"333px"}},i.a.createElement(Is.a,{data:Object(f.a)(Object.keys(D).sort((function(e,t){return parseInt(D[e].totalTimer)>parseInt(D[t].totalTimer)?-1:parseInt(D[e].totalTimer)<parseInt(D[t].totalTimer)?1:0})).map((function(e,t){return{id:D[e].name,label:D[e].name,value:D[e].totalTimer,color:"#929497",textMini:D[e].timerText}}))),valueFormat:function(e){return $(e,!0),$(e)},enableArcLabels:!1,colors:{scheme:"purpleRed_green"},activeOuterRadiusOffset:8,arcLabelsTextColor:{from:"color",modifiers:[["brighter",3]]},borderWidth:1,cornerRadius:3,enableArcLinkLabels:!0,innerRadius:.5,leavesOnly:!0,margin:{top:10,right:80,bottom:10,left:0},padAngle:1.3,sortByValue:!0})),i.a.createElement(Ys,null,i.a.createElement(vo,null,Object.keys(D).sort((function(e,t){return parseInt(D[e].totalTimer)>parseInt(D[t].totalTimer)?-1:parseInt(D[e].totalTimer)<parseInt(D[t].totalTimer)?1:0})).map((function(e,t){return i.a.createElement(z,{data:D[e],key:e})})))),i.a.createElement("div",{style:{color:"#CCCCCC",fontSize:"12px",padding:"15px",textAlign:"center"}},r.cards[e.nodeId]&&"plan"===r.cards[e.nodeId].type?lt("$__timeSheetShowingAllTimesRegisteredInAllActivitiesOfPlan"):lt("$__timeSheetShowingAllTimesRegisteredInActivityAndLinkedActivities")))})),Qs=function(e){return{btClose:{position:"relative",zIndex:e.zIndex.drawer+1,right:"0",top:"-64px",backgroundColor:"#FFFFFF",display:"flex"},data:{marginTop:"10px",padding:"10px","& fieldset":{border:"solid 1px rgba(0,0,0,0.1)","& legend":{marginBottom:"0px",fontSize:"16px",color:dt("color")}}},timeline:{position:"absolute",width:"100%",bottom:"0px"},avatar:{width:"22px",height:"22px"},switch:{fontSize:"16px",fontWeight:"bold",color:dt("medium")}}};var eu=Object($e.b)((function(){return{}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Qs)((function(e){var t=e.classes,r=De.getState(),n=r.db,a=r.sideModule,o=r.session,c=a.data||{},l=i.a.useState(!1),s=Object(Be.a)(l,2),u=s[0],d=s[1],p=i.a.useState(De.getState().db.cards[c._id]._users[o._id]?"timeline":"chart"),f=Object(Be.a)(p,2),h=f[0],m=f[1];xt(),o._id&&n.cards[c._id]&&n.cards[c._id]._users&&n.cards[c._id]._users[Object.keys(n.cards[c._id]._users).find((function(e){return e.indexOf(o._id)>-1}))]&&n.cards[c._id]._users[Object.keys(n.cards[c._id]._users).find((function(e){return e.indexOf(o._id)>-1}))];var g=window.location.hash.split("/");g[0]=g[0].replace("#","");var v=n.cards[c._id]._timeline||{};return v=Object.keys(v).filter((function(e){return"kpi"===v[e].type})).map((function(e){return v[e]})),c._parent&&c._parent!==g[0]&&De.getState().db.cards[c._parent],i.a.createElement("div",null,!u&&i.a.createElement("div",{style:{position:"relative",width:"100%",display:"flex"}},"chart"!==h&&De.getState().db.cards[c._id]._users[o._id]&&i.a.createElement(At,{title:lt("$__add"),text:lt("$__add"),icon:"more_time",size:"25px",onClick:function(){d(!0)}}),"chart"!==h&&i.a.createElement(At,{title:lt("$__showChart"),text:lt("$__showChart"),icon:"analytics",size:"25px",onClick:function(){m("chart")}}),"timeline"!==h&&i.a.createElement(At,{title:lt("$__showTimeline"),text:lt("$__showTimeline"),icon:"timeline",size:"25px",onClick:function(){m("timeline")}})),"chart"===h&&i.a.createElement("div",{style:{width:"calc(100% - 30px)",marginLeft:"15px"}},i.a.createElement(Zs,{nodeId:c._id})),(u||"timeline"===h)&&i.a.createElement("div",{style:{position:"absolute",top:35,left:0,right:0,bottom:0}},i.a.createElement(Xc,{nodeId:c._id,type:"timer",db:"cards",disabledSend:!0,loadTimeline:!0,noSearch:!0})),u&&i.a.createElement("div",{className:t.timeline,style:{top:"0px",zIndex:100,backgroundColor:"#FFFFFF"}},i.a.createElement(oi,{data:c,manualAdd:!0,callBack:function(){d(!1)}})))}))),tu=r(12),ru=r(1821),nu=Object(Lt.a)({root:{"&:hover":{backgroundColor:"transparent"}},icon:{borderRadius:"50%",width:16,height:16,boxShadow:"inset 0 0 0 1px ".concat(dt("color",.2),", inset 0 -1px 0 ").concat(dt("color",.1)),backgroundColor:"#f5f8fa",backgroundImage:"linear-gradient(180deg,hsla(0,0%,100%,.8),hsla(0,0%,100%,0))","$root.Mui-focusVisible &":{outline:"2px auto ".concat(dt("color",.6)),outlineOffset:2},"input:hover ~ &":{backgroundColor:"#ebf1f5"},"input:disabled ~ &":{boxShadow:"none",background:"rgba(206,217,224,.5)"}},checkedIcon:{backgroundColor:dt("color",1),backgroundImage:"linear-gradient(180deg,hsla(0,0%,100%,.1),hsla(0,0%,100%,0))","&:before":{display:"block",width:16,height:16,backgroundImage:"radial-gradient(#fff,#fff 28%,transparent 32%)",content:'""'},"input:hover ~ &":{backgroundColor:dt("color",1)}}});var au=function(e){var t=nu();return i.a.createElement(ru.a,Object.assign({className:t.root,disableRipple:!0,color:"default",checkedIcon:i.a.createElement("span",{className:Object(tu.default)(t.icon,t.checkedIcon)}),icon:i.a.createElement("span",{className:t.icon})},e))},ou=r(1807),iu=function(e){return{root:{position:"relative",float:"left",width:"calc(100% - 20px)",margin:"10px"},user:{position:"relative",width:"calc(100% - 20px)",margin:"10px",float:"left",height:"50px"},avatar:{position:"absolute",left:"-5px",top:"0px",border:"1px solid ".concat(dt("color")),width:"57px",height:"57px",borderRadius:"50%",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundColor:"#FFFFFF"},name:{position:"absolute",top:"5px",left:"36px",right:"0px",height:"30px",border:"1px solid ".concat(dt("color",.2)),borderRadius:"5px",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"16px",paddingRight:"7px",fontWeight:"bold",fontSize:"12px",color:dt("darkText"),boxShadow:"-5px 3px 7px 1px rgba(0,0,0,0.1)"},access:{position:"absolute",top:"33px",left:"45px",right:"0px",height:"30px",border:"1px solid ".concat(dt("color",.2)),borderRadius:"0 0 5px 5px",display:"flex",alignItems:"center",paddingLeft:"16px",fontSize:"12px",color:dt("color"),boxShadow:"0px 3px 7px 1px rgba(0,0,0,0.05)"},accessEditing:{position:"absolute",top:"33px",left:"0px",right:"0px",height:"auto",minHeight:"290px",padding:"7px",border:"1px solid ".concat(dt("color",.2)),borderRadius:"0 0 5px 5px",paddingTop:"15px",paddingLeft:"16px",fontSize:"12px",fontWeight:"bold",color:dt("color"),backgroundColor:"#FFFFFF",boxShadow:"0px 3px 7px 1px rgba(0,0,0,0.05)","& ul":{fontSize:"12px"}},btActions:{position:"absolute",right:"7px",top:"7px",display:"flex"},switch:{fontSize:"12px",fontWeight:"bold",color:dt("medium")},accessDescription:{fontSize:"12px",color:dt("medium")}}},cu=r(993),lu=r.n(cu);function su(){su=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var uu=Object($e.b)((function(e,t){return{users:e.db.users,cardUsers:e.db.cards[e.sideModule.data._id]}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(iu)((function(e){var t=e.classes,r=De.getState(),n=r.db,a=r.sideModule,o=r.session,c=i.a.useState({id:null}),l=Object(Be.a)(c,2),s=l[0],u=l[1],d=i.a.useState(!1),p=Object(Be.a)(d,2),m=p[0],g=p[1],v=i.a.useState(!1),y=Object(Be.a)(v,2),b=(y[0],y[1],i.a.useState("")),x=Object(Be.a)(b,2),_=x[0],w=x[1],E=i.a.useState(!1),O=Object(Be.a)(E,2),j=O[0],S=O[1],k=n.cards[a.data._id],L=Object(h.a)({},n.users),C=Object(h.a)({},n.users),I=Object(h.a)(Object(h.a)(Object(h.a)({},k&&k._users?Object(h.a)({},k._users):{}),k._parent&&n.cards[k._parent]&&n.cards[k._parent]._users?Object(h.a)({},n.cards[k._parent]._users):{}),k._planId&&n.cards[k._planId]&&n.cards[k._planId]._users?Object(h.a)({},n.cards[k._planId]._users):{}),F=[],T=ca(k._id,{isArray:!0});T=T.filter((function(e){return(!k._users||!k._users[e._id])&&(!_||_&&(e.name&&e.name.toLowerCase().indexOf(_.toLowerCase())>-1||e._parent&&De.getState().db.users&&De.getState().db.users[e._parent]&&De.getState().db.users[e._parent].name&&De.getState().db.users[e._parent].name.toLowerCase().indexOf(_.toLowerCase())>-1||_.indexOf(">")>-1&&e._parent&&De.getState().db.users&&De.getState().db.users[e._parent]&&De.getState().db.users[e._parent].name&&De.getState().db.users[e._parent].name.toLowerCase().indexOf(_.toLowerCase().replace(">",""))>-1))})).map((function(e){return e}));var N=window.location.hash.split("/");N[0]=N[0].replace("#","");var P=xt(),D=k&&k._id&&n.cards[k._id]&&n.cards[k._id]._users&&Object.keys(n.cards[k._id]._users).length>0?n.cards[k._id]._users[Object.keys(n.cards[k._id]._users).find((function(e){return e.indexOf(o._id)>-1}))]:0;if(!a||!a.data)return null;var A=function(){var t=Object(Me.a)(su().mark((function t(r,o,i){var c,l;return su().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=1,k&&"plan"===k.type&&(c=3),o?c=o:k._planId&&n.cards[k._planId]&&n.cards[k._planId]._users&&n.cards[k._planId]._users[r]&&n.cards[k._planId]._users[r].access&&(c=k._parent&&n.cards[k._parent]&&n.cards[k._parent]._users&&n.cards[k._parent]._users[r]&&n.cards[k._parent]._users[r].access&&parseInt(n.cards[k._parent]._users[r].access)>parseInt(n.cards[k._planId]._users[r].access)?parseInt(n.cards[k._parent]._users[r].access):parseInt(n.cards[k._planId]._users[r].access)),l=!!(n.cards[a.data._id]&&n.cards[a.data._id]._users&&n.cards[a.data._id]._users[r]),t.next=6,ao(e,r,c,a.data._id,l);case 6:if(!t.sent){t.next=11;break}return g(!1),u({_id:null}),t.abrupt("return",!0);case 11:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}(),$=function(){var t=Object(Me.a)(su().mark((function t(r,n){return su().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ot.put("cards/removeAccess/",{cardId:a.data._id,userIds:[r]});case 2:t.sent&&(n&&e.reduxFunction("ASYNC","CLEAR_MODULE"),g(!1),u({_id:null}));case 4:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}();if(!k)return null;if(L=L&&Object.keys(L).length>0&&Object.keys(L).filter((function(e){return k&&k._users&&k._users[L[e]._id]&&(!L[e]._parent||L[e]._parent&&L[e]._parent===o.account)&&!k._users[L[e]._id].deleted})).sort((function(e,t){return e.name<t.name?-1:0})).map((function(e){return L[e]})),C=Object.keys(C).filter((function(e){return!C[e].companyName&&(!_||_&&C[e].name.toLowerCase().indexOf(_.toLowerCase())>-1)&&"user"===C[e].type&&"external"!==C[e].type&&!C[e].deleted&&(!k._users||k._users&&!k._users[C[e]._id])})).sort((function(e,t){return e&&e.name&&t&&t.name&&e.name<t.name?-1:(e&&e.name&&t&&t.name&&(e.name,t.name),0)})).map((function(e){return C[e]})),I=Object.keys(I).filter((function(e){return 0===L.filter((function(t){return t._id===e})).length&&36===e.length&&!I[e].deleted&&k._users[e]&&(!_||_&&C[e]&&C[e].name.toLowerCase().indexOf(_.toLowerCase())>-1)})).map((function(e){return I[e]})).sort((function(e,t){return e.name<t.name?-1:(e.name,t.name,0)})),k._planId&&n.cards[k._planId]&&n.cards[k._planId].client||k.client){var z=k.client?k.client:n.cards[k._planId].client;F=Object.keys(C).filter((function(e){return C[e]._parent===z&&(!_||_&&C[e].name.toLowerCase().indexOf(_.toLowerCase())>-1)&&"user"===C[e].type&&"external"!==C[e].type})).map((function(e){return C[e]})).sort((function(e,t){return e.name<t.name?-1:e.name>t.name?1:0})),C=Object.keys(C).filter((function(e){return!C[e]._parent&&(!_||_&&C[e].name.toLowerCase().indexOf(_.toLowerCase())>-1)&&"unity"!==C[e].type&&"client"!==C[e].type&&"group"!==C[e].type&&"account"!==C[e].type})).sort((function(e,t){return e.name<t.name?-1:e.name>t.name?1:0})).map((function(e){return C[e]}))}k.client||(C=Object.keys(C).filter((function(e){return!C[e]._parent&&(!_||_&&C[e].name.toLowerCase().indexOf(_.toLowerCase())>-1)&&"unity"!==C[e].type&&"client"!==C[e].type&&"group"!==C[e].type&&"account"!==C[e].type})).map((function(e){return C[e]})).sort((function(e,t){return e.name<t.name?-1:e.name>t.name?1:0})));var M=function(){var e=Object(Me.a)(su().mark((function e(t){return su().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:w(""),t.map((function(e){A(e._id,null,e)}));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),B=function(r){var c=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=!0,d=r;r._id&&n.users[r._id]&&(d=n.users[r._id]),r.type&&"external"!==r.type||d._parent&&(!d._parent||n.users[d._parent])||(l=!1),k&&k._planId&&va(k._planId)&&(l=!0);var p=1;return d&&d._id&&k._users&&k._users[d._id]&&k._users[d._id].access&&(p=String(k._users[d._id].access)),i.a.createElement("div",{className:t.user},i.a.createElement("div",{className:t.name},d.name,k._users[d._id]&&k._users[d._id].isResponsible?i.a.createElement("span",{style:{fontSize:"9px",fontWeight:"normal",color:"#CCCCCC"}},lt("$__responsible",1)):"",c&&!s._id?i.a.createElement("div",null,i.a.createElement(At,{transparent:!0,title:lt("$__add"),icon:"person_add",size:"20px",onClick:function(){A(d._id,null,d)}})):i.a.createElement(i.a.Fragment,null),c?i.a.createElement(i.a.Fragment,null):i.a.createElement("div",{style:{zIndex:10}},i.a.createElement(En,{horizontalButton:!0,transparent:!0,size:"14px",btColor:dt("color"),options:[{name:"$__setAsResponsible",icon:"admin_panel_settings",onClick:function(){ft({message:lt("$__confirmSetAsResponsibleCard",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){oo(e,{cardId:a.data._id,userId:d._id})}})}}].concat(Object(f.a)(l&&(d&&(!d._access||d._access&&"owner"!==d._access)&&(D&&String(D.access)&&parseInt(D.access)>2&&parseInt(D.access)>=parseInt(p)||P&&P.plan&&(P.planAdmin||P.planModerate))||d._id===o._id)?[{name:"$__editAccess",icon:"manage_accounts",onClick:function(){u({_id:d._id,access:p})}},{name:"$__removeAccess",icon:"delete_forever",color:"red",onClick:function(){ft({message:d._id!==o._id?lt("$__confirmRemoveUser",1):lt("$__confirmGetOut",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){$(d._id,d._id===o._id)}})}}]:[]))}))),i.a.createElement("div",{className:t.avatar,style:{backgroundImage:'url("'.concat(d.image?d.image:lu.a,'")')}},d._parent&&n.users[d._parent]&&n.users[d._parent].image?i.a.createElement("div",{style:{position:"absolute",bottom:-4,right:-7,width:22,height:22,borderRadius:"50%",backgroundImage:"url(".concat(n.users[d._parent].image,")"),backgroundSize:"cover",backgroundRepeat:"no-repeat"}}):i.a.createElement(i.a.Fragment,null)),c?d._parent&&n.users[d._parent]&&n.users[d._parent].name?i.a.createElement("div",{className:t.access},i.a.createElement("div",null,n.users[d._parent].name)):i.a.createElement(i.a.Fragment,null):i.a.createElement("div",{className:t.access,style:{cursor:"pointer",paddingLeft:15,paddingRight:15,paddingTop:3,display:"block"},onClick:l?function(){(d&&(!d._access||d._access&&"owner"!==d._access)&&(D&&String(D.access)&&parseInt(D.access)>2&&parseInt(D.access)>=parseInt(p)||P&&P.plan&&(P.planAdmin||P.planModerate))||d._id===o._id)&&u({_id:d._id,access:p})}:null},d._parent&&n.users[d._parent]&&n.users[d._parent].name?i.a.createElement("div",{style:{position:"relative",float:"left"}},n.users[d._parent].name):i.a.createElement(i.a.Fragment,null),i.a.createElement("div",{style:{position:"relative",float:"right"}},"(","owner"===d._access?lt("$__owner",1):lt("0"===p?"$__reader":"1"===p?"$__executioner":"2"===p?"$__collaborator":"3"===p?"$__leadership":"4"===p?"$__supervisor":"5"===p?"$__admin":"$__reader",1),")")))};if(s&&s._id){var Y=1;k._users&&k._users[s._id]&&k._users[s._id].access&&(Y=String(k._users[s._id].access));var G=k._users[s._id],R=!1;return k&&k._planId&&va(k._planId)&&(R=!0),i.a.createElement(i.a.Fragment,null,B(G,!0),i.a.createElement("div",{style:{position:"relative",display:"flex",alignItems:"center",width:"100%",float:"left",justifyContent:"flex-end"}},m&&i.a.createElement(At,{transparent:!0,title:lt("$__save"),icon:"save",color:dt("color"),onClick:function(){A(s._id,s.access,G)}}),L.length>1&&i.a.createElement(At,{transparent:!0,title:s._id!==o._id?lt("$__removeAccess",1):lt("$__getOut",1),icon:s._id!==o._id?"delete_forever":"logout",color:"red",onClick:function(){ft({message:s._id!==o._id?lt("$__confirmRemoveUser",1):lt("$__confirmGetOut",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){$(s._id,s._id===o._id)}})}}),i.a.createElement(At,{transparent:!0,title:lt("$__close","*"),icon:"undo",color:dt("medium"),onClick:function(){m?ft({message:lt("$__confirmCloseWithUnsavedData",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){u({_id:null}),g(!1)}}):(u({_id:null}),g(!1))}})),i.a.createElement("div",{style:{position:"relative",width:"100%",padding:15,float:"left"}},(s._id!==o._id||P.plan&&P.planAdmin)&&i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%"}},i.a.createElement(ou.a,{defaultValue:String(Y),"aria-label":"gender",name:"customized-radios",onChange:function(e){u(Object(h.a)(Object(h.a)({},s),{},{access:e.target.value})),g(!0)}},"plan"!==k.type&&(D&&parseInt(D.access)>=0||R&&P&&P.plan&&(P.planAdmin||P.planModerate))&&i.a.createElement(Xs.a,{value:"0",control:i.a.createElement(au,null),label:lt("$__reader",1)}),"plan"!==k.type&&(D&&parseInt(D.access)>=1||R&&P&&P.plan&&(P.planAdmin||P.planModerate))&&i.a.createElement(Xs.a,{value:"1",control:i.a.createElement(au,null),label:lt("$__executioner",1)}),"plan"!==k.type&&"chatGroup"!==k.type&&(D&&parseInt(D.access)>=2||R&&P&&P.plan&&(P.planAdmin||P.planModerate))&&i.a.createElement(Xs.a,{value:"2",control:i.a.createElement(au,null),label:lt("$__collaborator",1)}),(D&&parseInt(D.access)>=3||R&&P&&P.plan&&(P.planAdmin||P.planModerate))&&i.a.createElement(Xs.a,{value:"3",control:i.a.createElement(au,null),label:lt("$__leadership",1)}),"chatGroup"!==k.type&&(D&&parseInt(D.access)>=4||R&&P&&P.plan&&(P.planAdmin||P.planModerate))&&i.a.createElement(Xs.a,{value:"4",control:i.a.createElement(au,null),label:lt("$__supervisor",1)}),(D&&parseInt(D.access)>=5||P&&P.plan&&R&&(P.planAdmin||P.planModerate))&&i.a.createElement(Xs.a,{value:"5",control:i.a.createElement(au,null),label:lt("$__admin",1)}))),"chatGroup"!==k.type?i.a.createElement("ul",{id:"ACTIVE_USERS_LIST",style:{position:"relative",float:"left",width:"100%"}},"0"===s.access&&i.a.createElement(i.a.Fragment,null,i.a.createElement("li",null,lt("$__readOnlyTodo",1)),i.a.createElement("li",null,lt("$__readTimeline",1))),parseInt(s.access)>=1&&i.a.createElement(i.a.Fragment,null,i.a.createElement("li",null,lt("$__executioner",1)),i.a.createElement("li",null,lt("$__timeSheetRegister",1)),i.a.createElement("li",null,lt("$__interactonTheTimeline",1))),parseInt(s.access)>1&&i.a.createElement("li",null,lt("$__ExecuteAndCreateSubTasks",1)),parseInt(s.access)>2&&i.a.createElement(i.a.Fragment,null,"plan"===a.data.type&&i.a.createElement(i.a.Fragment,null,i.a.createElement("li",null,lt("$__access",1)," BRIGHT & CONNECTED"),i.a.createElement("li",null,lt("$__access",1)," INSIGHTS")),i.a.createElement("li",null,lt("$__updateDueDate",1)),i.a.createElement("li",null,lt("$__updateTags",1)),i.a.createElement("li",null,lt("$__updateIndicators",1)),i.a.createElement("li",null,lt("$__addAndRemoveUsers",1)),i.a.createElement("li",null,lt("$__defineResponsible",1))),parseInt(s.access)>3&&i.a.createElement(i.a.Fragment,null,i.a.createElement("li",null,lt("$__updateData",1)),i.a.createElement("li",null,lt("$__usersManager",1))),parseInt(s.access)>=4&&i.a.createElement(i.a.Fragment,null,"plan"===a.data.type&&i.a.createElement(i.a.Fragment,null,i.a.createElement("li",null,lt("$__access",1)," MATRIX SWOT")),i.a.createElement("li",null,lt("$__settings",1))),5===parseInt(s.access)&&i.a.createElement("li",null,lt("$__deleteActivity",1))):i.a.createElement("ul",{id:"ACTIVE_USERS_LIST",style:{position:"relative",float:"left",width:"100%"}},parseInt(s.access)>1&&i.a.createElement("li",null,lt("$__viewAndInteract",1)),parseInt(s.access)>2&&i.a.createElement(i.a.Fragment,null,i.a.createElement("li",null,lt("$__addAndRemoveUsers",1)),i.a.createElement("li",null,lt("$__update",1))),5===parseInt(s.access)&&i.a.createElement("li",null,lt("$__deleteGroup",1))),k._users[s._id]&&!k._users[s._id].isResponsible&&i.a.createElement("div",{className:t.switch,style:{position:"relative",width:"100%",float:"left",display:"flex",alignItems:"center",justifyContent:"space-between"}},i.a.createElement(At,{transparent:!0,title:lt("$__setAsResponsible"),text:lt("$__setAsResponsible"),icon:"admin_panel_settings",size:"25px",onClick:function(){ft({message:lt("$__confirmSetAsResponsibleCard",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){oo(e,{cardId:a.data._id,userId:s._id})}})}}))))}return i.a.createElement("div",{className:t.root},j&&i.a.createElement("div",{style:{marginTop:15,width:"100%",padding:"4px 15px",fontSize:"16px",color:"lightGray"}},i.a.createElement(La,{id:"quickUser_Search",label:lt("$__searchByName",1),variant:dt("fieldVariant"),name:"fullName",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end",style:{cursor:"pointer"},onClick:function(){w(""),S(!1)}},i.a.createElement(kt,{icon:"close"})),onChange:function(e){w(e.target.value)},onBlur:function(e){}},value:_,placeholder:lt("$__searchByName",1),autoFocus:!0})),""!==_&&_?i.a.createElement(i.a.Fragment,null):i.a.createElement("fieldset",null,i.a.createElement("legend",{style:{color:dt("color")}},lt("$__permittedUsers",1)),L&&L.map((function(e,t){return i.a.createElement(i.a.Fragment,{key:e._id},B(e))}))),I&&I.length>0&&i.a.createElement("fieldset",{style:{marginTop:"7px"}},i.a.createElement("legend",{style:{color:dt("color")}},lt("$__activeExternalUsers",1)),I.map((function(e,t){return i.a.createElement(i.a.Fragment,{key:e._id},B(e))}))),F&&F.length>0&&!s._id&&i.a.createElement("fieldset",{style:{marginTop:"7px"}},i.a.createElement("legend",{style:{color:dt("color")}},lt("$__accountUsers",1)),F.map((function(e,t){return i.a.createElement(i.a.Fragment,{key:e._id},B(e,!0))}))),C&&C.length>0&&!s._id&&i.a.createElement("fieldset",{style:{marginTop:"7px"}},i.a.createElement("legend",{style:{color:dt("color")}},lt("$__accountUsers",1)),C.map((function(e,t){return i.a.createElement(i.a.Fragment,{key:e._id},B(e,!0))}))),console.log(T),T&&T.length>0&&i.a.createElement("fieldset",{style:{marginTop:"7px"}},i.a.createElement("legend",{style:{color:dt("color")}},lt("$__externalUsers",1)),j?i.a.createElement("div",null,i.a.createElement(At,{transparent:!0,title:lt("$__add"),icon:"person_add",text:lt("$__addAllUsers"),size:"20px",onClick:function(){M(T)}})):i.a.createElement(i.a.Fragment,null),T.sort((function(e,t){return e.name<t.name?-1:e.name>t.name?1:0})).map((function(e,t){return i.a.createElement(i.a.Fragment,{key:e._id},B(e,!0))}))),j?i.a.createElement(i.a.Fragment,null):i.a.createElement("div",{style:{position:"absolute",right:15,top:0}},i.a.createElement(At,{title:lt("$__search",1),color:dt("menu"),icon:"search",onClick:function(){S(!0)},size:"25px"})))}))),du=function(e){return{btClose:{position:"relative",zIndex:e.zIndex.drawer+1,right:"0",top:"-64px",backgroundColor:"#FFFFFF",display:"flex"},image:{width:"100%",backgroundColor:"rgb(0,88,0)",paddingTop:"45%"},data:{position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px",overflowY:"auto",marginTop:"10px",padding:"10px","& fieldset":{border:"solid 1px rgba(0,0,0,0.1)","& legend":{marginBottom:"0px",fontSize:"16px",color:dt("color")}}},loader:{position:"relative",width:"100%",height:"40px",textAlign:"center","& .MuiCircularProgress-root":{color:"".concat(dt("color")," !important")}},preview:{listStyle:"none",padding:"0px","& li":{padding:"7px",backgroundColor:"rgba(0,0,0,0.05)",marginBottom:"15px",boxShadow:"0 0 7px 3px rgba(0,0,0,0.1)"}},previewTitle:{position:"relative",width:"100%",fontWeight:"bold",marginBottom:"7px"},feedTitle:{position:"relative",width:"100%",marginBottom:"7px",borderBottom:"solid 1px ".concat(dt("medium",.2))},feedContent:{position:"relative",width:"100%"},feedFooter:{width:"100%",textAlign:"right",height:"16px",borderTop:"1px solid rgba(0,0,0,0.05)",paddingTop:"3px"},feedDate:{position:"relative",left:"0px",fontSize:"12px",float:"left"},feedLink:{position:"relative",left:"0px",fontSize:"12px",float:"right"},switch:{fontSize:"16px",fontWeight:"bold",color:dt("medium")}}};function pu(){pu=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var fu=function(){var e=Object(Me.a)(pu().mark((function e(t){var r,n,a;return pu().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=De.getState().sideModule.data).status&&delete r.status,(n=window.location.hash.split("/"))[0]=n[0].replace("#",""),e.prev=4,e.next=7,ot.post("feed/save",Object(h.a)(Object(h.a)({},r),{},{feed:JSON.stringify(r.feed),_parent:n[0]||null}));case 7:if(!(a=e.sent)){e.next=14;break}return r._id||(r._id=a.data._id),t.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{id:a.data._id,data:Object(h.a)({},r)})),console.log(a),t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{feeds:Object(h.a)(Object(h.a)({},De.getState().db.feeds),{},Object(O.a)({},r._id,Object(h.a)(Object(h.a)(Object(h.a)({},r),De.getState().db.feeds&&De.getState().db.feeds[r._id]?De.getState().db.feeds[r._id]:{}),{},{_parent:Object(h.a)(Object(h.a)({},De.getState().db.feeds&&De.getState().db.feeds[r._id]&&De.getState().db.feeds[r._id]._parent?De.getState().db.feeds[r._id]._parent:{}),{},Object(O.a)({},n[0]||null,{_id:a.data._id,idRel:a.data.idRel}))})))})),e.abrupt("return",!0);case 14:e.next=19;break;case 16:return e.prev=16,e.t0=e.catch(4),e.abrupt("return",!1);case 19:case"end":return e.stop()}}),e,null,[[4,16]])})));return function(t){return e.apply(this,arguments)}}(),hu=function(){var e=Object(Me.a)(pu().mark((function e(t){var r,n,a,o=arguments;return pu().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},n=new Promise(function(){var e=Object(Me.a)(pu().mark((function e(n,a){var o,i;return pu().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Sn.post("/Feed_List_V2",r);case 3:(o=e.sent)&&o.data&&(i={},o.data.map((function(e){var t={};e.parents&&e.parents.length>0&&e.parents.map((function(e){t=Object(h.a)(Object(h.a)({},t),{},Object(O.a)({},e._id,Object(h.a)({idRel:e.idRel},e.i)))})),i=Object(h.a)(Object(h.a)({},i),{},Object(O.a)({},e.data._id,Object(h.a)(Object(h.a)(Object(h.a)({},e.data),e.hide?{hide:!0}:{}),{},{feed:[Object(h.a)({},e.cover)],_parent:t},e.tags&&e.tags.filter((function(e){return e.value})).length>0?{_tags:e.tags}:{})))})),t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{feeds:Object(h.a)(Object(h.a)({},De.getState().db.feeds),i)})),n(!0)),e.next=13;break;case 7:e.prev=7,e.t0=e.catch(0),console.group("loadFeeds::ERR::"),console.log(e.t0),console.groupEnd(),n(!0);case 13:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t,r){return e.apply(this,arguments)}}()),e.next=4,n;case 4:return a=e.sent,e.abrupt("return",a);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function mu(){mu=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var gu=Object(Lt.a)(du);var vu=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=gu(),r=De.getState(),n=r.sideModule,a=r.session,o=r.db,c=n.data||{},l=i.a.useState(!1),s=Object(Be.a)(l,2),u=s[0],d=s[1],p=i.a.useState(!1),f=Object(Be.a)(p,2),m=f[0],g=f[1],v=i.a.useState(!1),y=Object(Be.a)(v,2),b=y[0],x=(y[1],i.a.useRef()),_=0,w=xt(),E=window.location.hash.split("/");E[0]=E[0].replace("#",""),E[0]&&36===E[0].length&&(_=ia(E[0]));var j=function(t){""===c.name||"name"===t.name&&""===t.value?d(!1):c._lock&&(t.value&&!n.data[t.name]||n.data[t.name]&&n.data[t.name]!==t.value)&&d(!0),e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},n),{},{data:Object(h.a)(Object(h.a)({},n.data),{},Object(O.a)({},t.name,t.value))}))},S=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];u&&!t?ft({message:lt("$__confirmCloseWithUnsavedData",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){e.reduxFunction("ASYNC","CLEAR_MODULE")}}):e.reduxFunction("ASYNC","CLEAR_MODULE")},k=function(){var t=Object(Me.a)(mu().mark((function t(r){return mu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(d(!1),n.data.name){t.next=5;break}ft({message:lt("$__fillName",1),variant:"warning",persist:!1,horizontal:"right",confirm:null}),t.next=9;break;case 5:return t.next=7,fu(e,!0);case 7:t.sent?(ft({message:lt("$__feedSigned",1),variant:null,persist:!1,horizontal:"right",confirm:null}),r&&S(!0)):(ft({message:lt("$__AnErrorHasOccurredPleaseTryAgain",1),variant:"error",persist:!1,horizontal:"right",confirm:null}),d(!0));case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),L=function(){var t=Object(Me.a)(mu().mark((function t(r){var a,o,i,c;return mu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!r){t.next=41;break}if(-1!==r.indexOf("http")){t.next=6;break}ft({message:"".concat(lt("$__invalidUrl",1),": ").concat(lt("$__urlMustContainHttps",1)),variant:"error",persist:!1,horizontal:"right",confirm:null}),e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},n),{},{data:Object(h.a)(Object(h.a)({},n.data),{},{url:""})})),t.next=41;break;case 6:if(!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[&a-z\\d%_.~+=-]*)?(\\@[a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(r)){t.next=40;break}if(g(!0),"/"===(a=r)[r.length-1]&&(a=a.substring(0,r.length-1)),"/"===a.indexOf("http://")&&(a=a.replace("http://","https://")),"feed"!==n.data.type){t.next=25;break}return t.prev=13,t.next=16,ot.post("/feed/exist",{url:r});case 16:o=t.sent,e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},n),{},{data:Object(h.a)(Object(h.a)({},n.data),{},{_id:o.data.id,url:a,_lock:!0,feed:o.data.feed,name:o.data.title,customTitle:o.data.customTitle,customDescription:o.data.customDescription})})),o&&g(!1),o.data.title&&d(!0),t.next=25;break;case 22:t.prev=22,t.t0=t.catch(13),C(r);case 25:if("link"!==n.data.type){t.next=40;break}return t.prev=26,(i=window.location.hash.split("/"))[0]=i[0].replace("#",""),t.next=31,ot.post("/link/exist",{idRel:i[0],url:a});case 31:c=t.sent,e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{id:"new",activeModule:"cardEdit",db:"cards",data:{_id:"new",type:"link",name:c.data.title,description:c.data.contentSnippet,image:c.data.img,url:c.data.link,content:c.data.article}})),c&&g(!1),c.data.title&&d(!0),t.next=40;break;case 37:t.prev=37,t.t1=t.catch(26),ft({message:"".concat(lt("$__invalidFeedUrl",1),": ").concat(lt("$__pleaseVerifyTheFeedAddress",1)),variant:"error",persist:!1,horizontal:"right",confirm:null});case 40:return t.abrupt("return");case 41:return t.abrupt("return",!1);case 42:case"end":return t.stop()}}),t,null,[[13,22],[26,37]])})));return function(e){return t.apply(this,arguments)}}(),C=function(){var t=Object(Me.a)(mu().mark((function t(r){var a;return mu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,ot.post("/feed/request/",{url:r});case 3:a=t.sent,e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},n),{},{data:Object(h.a)(Object(h.a)({},n.data),{},{_id:a.data.id,url:r,_lock:!0,feed:a.data.feed,name:a.data.title,customTitle:a.data.customTitle,customDescription:a.data.customDescription})})),a&&g(!1),a.data.title&&d(!0),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0),ft({message:"".concat(lt("$__invalidFeedUrl",1),": ").concat(lt("$__pleaseVerifyTheFeedAddress",1)),variant:"error",persist:!1,horizontal:"right",confirm:null});case 12:case"end":return t.stop()}}),t,null,[[0,9]])})));return function(e){return t.apply(this,arguments)}}(),I=!!e.permission&&e.permission;return!I&&parseInt(_)>=3&&(I=!0),i.a.createElement("div",null,i.a.createElement("div",{className:t.btClose},i.a.createElement("div",{style:{position:"fixed",display:"inline-flex",paddingLeft:"10px",top:"7px",right:0,backgroundColor:"#FFFFFF"}},I&&u&&i.a.createElement(Nc,{save:u?function(){k()}:null,saveClose:u?function(){k(!0)}:null,saveLoader:b,close:function(){e.onClose&&e.onClose()}}),i.a.createElement(At,{title:lt("$__close",1),color:"lightgrey",icon:"cancel",onClick:function(){e.onClose&&e.onClose()},size:"25px"}))),i.a.createElement("div",{className:t.data},c._lock?i.a.createElement(i.a.Fragment,null,i.a.createElement(La,Object.assign({label:lt("$__titleOfFeed",1),variant:dt("fieldVariant"),name:"name",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"view_headline"})),onChange:function(e){j(e.target)}},value:c&&c.name?c.name:"",placeholder:lt("$__titleOfFeed_placeholder")},a&&"7806912b-4c7d-4f4f-b9e0-b93fc8f08776"!==a.account||c&&c.name?{disabled:!0}:{})),i.a.createElement(La,{label:lt("$__customTitle",1),variant:dt("fieldVariant"),name:"customTitle",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"title"})),onChange:function(e){j(e.target)}},value:c&&c.customTitle?c.customTitle:"",placeholder:lt("$__customTitle",1)}),a&&"7806912b-4c7d-4f4f-b9e0-b93fc8f08776"!==a.account?i.a.createElement(i.a.Fragment,null,i.a.createElement(La,{label:lt("$__nameOfFontData",1),variant:dt("fieldVariant"),name:"font",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"copyright"})),onChange:function(e){j(e.target)}},value:c&&c.font?c.font:"",placeholder:lt("$__nameOfFontData",1)}),i.a.createElement(La,{label:lt("$__descriptionOfRss",1),variant:dt("fieldVariant"),name:"description",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"subtitles"})),onChange:function(e){j(e.target)}},value:c&&c.description?c.description:"",placeholder:lt("$__descriptionOfRss",1)})):i.a.createElement(i.a.Fragment,null),i.a.createElement(La,{label:lt("$__customDescription",1),variant:dt("fieldVariant"),name:"customDescription",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"subtitles"})),onChange:function(e){j(e.target)}},value:c&&c.customDescription?c.customDescription:"",placeholder:lt("$__customDescription",1)}),i.a.createElement(La,{label:lt("$__url","*"),variant:dt("fieldVariant"),ref:x,name:"url",InputProps:{autoComplete:"new-password",multiline:!0,endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"http"})),onChange:function(e){j(e.target)},onBlur:function(e){L(e.target.value)}},value:c&&c.url?c.url:"",placeholder:"http://www.domain.xpto/rss...",disabled:!!c._lock}),w&&w.feed&&(w.feedAdmin||w.feedModerate)&&i.a.createElement("fieldset",{style:{marginBottom:"14px"}},i.a.createElement("legend",null,lt("$__tags",1)),i.a.createElement(Gl,{data:{values:c._tags?c._tags:[]},callBack:function(e){j({name:"_tags",value:e})}})),w&&w.feed&&w.feedAdmin?i.a.createElement("fieldset",{style:{marginBottom:"14px"}},i.a.createElement(Zc,{id:"combo-box-demo",options:o.plans,getOptionLabel:function(e){return lt(e.label,1)},style:{width:"100%"},name:"plans",disableClearable:!0,value:c&&c.plans&&o.plans?o.plans.filter((function(e){return String(e.value)===String(c.plans)}))[0]:o.plans[0],renderInput:function(e){return i.a.createElement(La,Object.assign({},e,{label:lt("$__avaiablefromplan",1),variant:dt("fieldVariant"),value:c&&c.plans&&o.plans?o.plans.filter((function(e){return String(e.value)===String(c.plans)}))[0]:o.plans[0]}))},onChange:function(e,t){I&&j({name:"plans",value:t.value})}})):i.a.createElement(i.a.Fragment,null),i.a.createElement("div",{className:t.switch},i.a.createElement(vi,{checked:!!c.private,onChange:function(e){j({name:"private",value:!c.private})},name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__private",1))):i.a.createElement(La,{label:lt("$__feedUrl","*"),variant:dt("fieldVariant"),ref:x,name:"url",InputProps:{autoComplete:"new-password",multiline:!0,endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"rss_feed"})),onChange:function(e){j(e.target)},onBlur:function(e){L(e.target.value)}},value:c&&c.url?c.url:"",placeholder:"http://www.domain.xpto/rss...",disabled:!!c._lock}),!c._lock&&!m&&i.a.createElement(rn,{text:lt("link"===n.data.type?"$__validUrl":"$__validFeedUrl",1),icon:"check",onClick:function(){return L(x.current.value)}}),m&&i.a.createElement("div",{className:t.loader},i.a.createElement(Ft,null)),c.feed&&c.feed.length>0&&i.a.createElement("ul",{className:t.preview},i.a.createElement("div",{className:t.previewTitle},lt("$__preview",1)),c.feed.map((function(e,r){return i.a.createElement("li",{key:r},e&&e.title&&i.a.createElement("div",{dangerouslySetInnerHTML:{__html:e.title},className:t.feedTitle}),i.a.createElement("div",{dangerouslySetInnerHTML:{__html:e.contentSnippet},className:t.feedContent}),i.a.createElement("div",{className:t.feedFooter},i.a.createElement("div",{className:t.feedDate},Ve()(e.pubDate).format("DD/MM/YYYY HH:MM")),i.a.createElement("div",{className:t.feedLink},i.a.createElement("a",{href:e.link,target:"_blank"},lt("$__openLink","*")))))})))))}));function yu(){yu=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var bu=Object(Lt.a)(du);var xu=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=bu(),r=De.getState().sideModule,n=r.data||{},a=i.a.useState(!1),o=Object(Be.a)(a,2),c=o[0],l=o[1],s=i.a.useState(!1),u=Object(Be.a)(s,2),d=u[0],p=u[1],f=i.a.useState(!1),m=Object(Be.a)(f,2),g=m[0],v=(m[1],i.a.useRef()),y=0,b=window.location.hash.split("/");b[0]=b[0].replace("#",""),b[0]&&36===b[0].length&&(y=ia(b[0]));var x=function(t){""===n.name||"name"===t.name&&""===t.value?l(!1):n._lock&&(t.value&&!r.data[t.name]||r.data[t.name]&&r.data[t.name]!==t.value)&&l(!0),e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},r),{},{data:Object(h.a)(Object(h.a)({},r.data),{},Object(O.a)({},t.name,t.value))}))},_=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];c&&!t?ft({message:lt("$__confirmCloseWithUnsavedData",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){e.reduxFunction("ASYNC","CLEAR_MODULE")}}):e.reduxFunction("ASYNC","CLEAR_MODULE")},w=function(){var t=Object(Me.a)(yu().mark((function t(n){return yu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(l(!1),r.data.name){t.next=5;break}ft({message:lt("$__fillName",1),variant:"warning",persist:!1,horizontal:"right",confirm:null}),t.next=9;break;case 5:return t.next=7,fu(e,!0);case 7:t.sent?(ft({message:lt("$__feedSigned",1),variant:null,persist:!1,horizontal:"right",confirm:null}),n&&_(!0)):(ft({message:lt("$__AnErrorHasOccurredPleaseTryAgain",1),variant:"error",persist:!1,horizontal:"right",confirm:null}),l(!0));case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),E=function(){var t=Object(Me.a)(yu().mark((function t(n){var a,o,i;return yu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(a=n.trim())){t.next=29;break}if(-1!==a.indexOf("http")){t.next=7;break}ft({message:"".concat(lt("$__invalidUrl",1),": ").concat(lt("$__urlMustContainHttps",1)),variant:"error",persist:!1,horizontal:"right",confirm:null}),e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},r),{},{data:Object(h.a)(Object(h.a)({},r.data),{},{url:""})})),t.next=29;break;case 7:if(!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(a)){t.next=26;break}return p(!0),t.prev=10,(o=window.location.hash.split("/"))[0]=o[0].replace("#",""),t.next=15,ot.post("/link/exist",{idRel:o[0],url:a});case 15:i=t.sent,e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{id:"new",activeModule:"cardEdit",db:"cards",data:{_id:"new",type:"link",name:i.data.title,description:i.data.contentSnippet,image:i.data.img,url:i.data.link,content:i.data.article}})),i&&p(!1),i.data.title&&l(!0),t.next=24;break;case 21:t.prev=21,t.t0=t.catch(10),ft({message:"".concat(lt("$__invalidFeedUrl",1),": ").concat(lt("$__pleaseVerifyTheFeedAddress",1)),variant:"error",persist:!1,horizontal:"right",confirm:null});case 24:t.next=28;break;case 26:ft({message:"".concat(lt("$__invalidUrl",1),": ").concat(lt("$__pleaseVerifyTheUrl",1)),variant:"error",persist:!1,horizontal:"right",confirm:null}),e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},r),{},{data:Object(h.a)(Object(h.a)({},r.data),{},{url:""})}));case 28:return t.abrupt("return",!0);case 29:return t.abrupt("return",!1);case 30:case"end":return t.stop()}}),t,null,[[10,21]])})));return function(e){return t.apply(this,arguments)}}(),j=!!e.permission&&e.permission;return!j&&parseInt(y)>=3&&(j=!0),i.a.createElement("div",null,i.a.createElement("div",{className:t.btClose},i.a.createElement("div",{style:{position:"fixed",display:"inline-flex",paddingLeft:"10px",top:"7px",right:0,backgroundColor:"#FFFFFF"}},g&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Ft,{size:"25px"})),j&&c&&i.a.createElement(i.a.Fragment,null,i.a.createElement(At,{title:lt("$__save","*"),color:dt("color"),icon:"save",onClick:function(){w()},size:"25px"}),i.a.createElement(At,{title:lt("$__saveAndClose",1),color:"green",icon:"playlist_add_check",onClick:function(){w(!0)},size:"25px"})),i.a.createElement(At,{title:lt("$__close",1),color:"lightgrey",icon:"cancel",onClick:function(){e.onClose&&e.onClose()},size:"25px"}))),i.a.createElement("div",{className:t.data},n._lock&&i.a.createElement(i.a.Fragment,null,i.a.createElement(La,{label:lt("$__titleOfUrl",1),variant:dt("fieldVariant"),name:"name",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"view_headline"})),onChange:function(e){x(e.target)}},value:n&&n.name?n.name:"",placeholder:lt("$__titleOfUrl_placeholder"),disabled:!0}),i.a.createElement(La,{label:lt("$__customTitle",1),variant:dt("fieldVariant"),name:"customTitle",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"title"})),onChange:function(e){x(e.target)}},value:n&&n.customTitle?n.customTitle:"",placeholder:lt("$__customTitle",1)}),i.a.createElement(La,{label:lt("$__nameOfFontData",1),variant:dt("fieldVariant"),name:"font",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"copyright"})),onChange:function(e){x(e.target)}},value:n&&n.font?n.font:"",placeholder:lt("$__nameOfFontData",1)}),i.a.createElement(La,{label:lt("$__descriptionOfUrl",1),variant:dt("fieldVariant"),name:"description",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"subtitles"})),onChange:function(e){x(e.target)}},value:n&&n.description?n.description:"",placeholder:lt("$__descriptionOfUrl",1)}),i.a.createElement(La,{label:lt("$__customDescription",1),variant:dt("fieldVariant"),name:"customDescription",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"subtitles"})),onChange:function(e){x(e.target)}},value:n&&n.customDescription?n.customDescription:"",placeholder:lt("$__customDescription",1)}),i.a.createElement("div",{className:t.switch},i.a.createElement(vi,{checked:!!n.private,onChange:function(e){x({name:"private",value:!n.private})},name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__private",1))),i.a.createElement(La,{label:lt("$__url","*"),variant:dt("fieldVariant"),ref:v,name:"url",InputProps:{autoComplete:"new-password",multiline:!0,endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"http"})),onChange:function(e){x(e.target)},onBlur:function(e){E(e.target.value)}},value:n&&n.url?n.url:"",placeholder:"http://www.domain.com/",disabled:!!n._lock}),!n._lock&&!d&&i.a.createElement(rn,{text:lt("$__validUrl",1),icon:"check",onClick:function(){return E(v.current.value)}}),d&&i.a.createElement("div",{className:t.loader},i.a.createElement(Ft,null)),n.feed&&n.feed.length>0&&i.a.createElement("ul",{className:t.preview},i.a.createElement("div",{className:t.previewTitle},lt("$__preview",1)),n.feed.map((function(e,r){return i.a.createElement("li",{key:r},e&&e.title&&i.a.createElement("div",{dangerouslySetInnerHTML:{__html:e.title},className:t.feedTitle}),i.a.createElement("div",{dangerouslySetInnerHTML:{__html:e.contentSnippet},className:t.feedContent}),i.a.createElement("div",{className:t.feedFooter},i.a.createElement("div",{className:t.feedDate},Ve()(e.pubDate).format("DD/MM/YYYY HH:MM")),i.a.createElement("div",{className:t.feedLink},i.a.createElement("a",{href:e.link,target:"_blank"},lt("$__openLink","*")))))})))))}));var _u=Object($e.b)((function(e){return{sideModuleWindow:e.session.sideModuleWindow,sideModule:e.sideModule,cards:e.db.cards}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Pc)((function(e){var t,r,n=De.getState(),a=n.sideModule,o=n.db,c=n.session,l=i.a.useState(!1),s=Object(Be.a)(l,2),u=s[0],d=s[1],p=i.a.useState(!1),m=Object(Be.a)(p,2),g=m[0],v=m[1];if(i.a.useEffect((function(){return a.id&&(g||"timeline"!==a.activeModule||(v(!0),d(!1))),function(){}}),[a]),!a.data||!a.data.type||0===o.dataType.filter((function(e){return e.name===a.data.type})).length)return null;if(a&&!a.id)return null;var y=e.classes,b=a.data,x=window.location.hash.split("/");x[0]=x[0].replace("#","");var _=o.cards[b._id]?"cards":"users",w=xt(),E=ia(a.id),O=!1;!b||!b._planId||o.cards[b._planId]&&va(b._planId)||(O=!1),!(O=!(!a||!("new"===a.id||("user"===b.type||"client"===b.type)&&w&&w.user&&(w.userAdmin||w.userModerate)||"user"!==b.type&&"client"!==b.type&&"chatGroup"!==b.type&&w&&(w.owner||w.plan&&(w.planAdmin||w.planModerate))||"chatGroup"===b.type&&(!b.client||b.client&&o.users[b.client])&&w&&(w.owner||w.plan&&(w.planAdmin||w.planModerate)))))&&parseInt(E)>=4&&(O=!0),!O&&va(b._planId)&&w&&w.admin&&w.plan&&(w.planAdmin||w.planModerate)&&(O=!0);var j=[{name:"userEdit",icon:"notes",title:"$__userEdit",reqId:!1,module:ul,closeOption:!1,permission:0},{name:"feedEdit",icon:"rss_feed",title:"$__feedEdit",reqId:!1,module:vu,closeOption:!1,permission:3,template:!0},{name:"link",icon:"link",title:"$__link",reqId:!1,module:xu,permission:3,closeOption:!1,hide:!0,template:!0},{name:"timeline",icon:"timeline",title:"$__timeline",reqId:!0,module:Xc,props:{type:"comment",nodeId:a.id,db:"cards",loadTimeline:!0,disabledSend:"0"===String(E)},closeOption:!0,permission:0,count:"comment"},{name:"log",icon:"history",title:"$__log",reqId:!0,module:Xc,props:{type:"log",nodeId:a.id,db:"cards",loadTimeline:!0,noSearch:!0,disabledSend:!0},closeOption:!0,permission:0,count:"log"},{name:"checklist",icon:"checklist",title:"$__list",reqId:!0,module:Si,closeOption:!0,permission:1,props:{nodeId:a.data._id,db:a.db?a.db:"cards",permission:O,showProgress:!0},template:!0},{name:"recurrence",icon:"update",title:"$__recurrence",reqId:!0,module:js,closeOption:!0,permission:3,props:{nodeId:a.data._id,db:a.db?a.db:"cards"},template:!0},{name:"files",icon:"folder",title:"$__files",reqId:!0,module:ws,closeOption:!0,permission:3,props:{nodeId:a.id,db:a.db}},{name:"access",icon:c._id===b._id?"vpn_key":"security",title:c._id===b._id?"$__changePassword":"$__access",reqId:!0,module:hl,closeOption:!1,permission:c._id===b._id?0:4}].concat(Object(f.a)(c._id===b._id?[{name:"twoFactor",icon:"pin",title:"$__twoFactorAuthenticator",reqId:!0,module:gl,closeOption:!1,permission:c._id===b._id?0:6,ownerLock:!0},{name:"mobile",icon:"phone_iphone",title:"$__mobile",reqId:!0,module:Fl,closeOption:!1,permission:c._id===b._id?0:6,ownerLock:!0}]:[]),[{name:"resume",icon:"blur_on",title:"$__resume",resume:!0,reqId:!0,module:Ql,closeOption:!0,permission:2,template:!0},{name:"cardEdit",icon:"subject",title:"$__edition",reqId:!1,module:Wl,closeOption:!1,permission:0,buttonsCount:3,template:!0},{name:"columnEdit",icon:"tune",title:"$__edition",reqId:!1,module:hs,closeOption:!1,permission:0,buttonsCount:3,template:!0},{name:"users",icon:"supervised_user_circle",title:"$__users",reqId:!0,module:uu,closeOption:!0,permission:3,template:!0}],Object(f.a)("users"===_?[{name:"delete",icon:"delete_sweep",title:"$__delete",reqId:!0,module:ys,closeOption:!0}]:[{name:"delete",icon:"delete_sweep",title:"$__delete",reqId:!0,module:gs,closeOption:!0,permission:5,template:!0}]),Object(f.a)(E>=4||E&&E<4&&b.kpi_type&&"task"!==b.kpi_type||w&&w.plan&&w.planAdmin?[{name:"kpi",icon:"analytics",title:"$__kpi",reqId:!0,module:Kl,closeOption:!1,permission:3,count:"kpi"}]:[]),[{name:"timeLog",icon:"timer",title:"$__timerLog",reqId:!0,module:eu,closeOption:!0,permission:1,count:"timer"},{name:"sendTo",icon:"share",title:"$__sendTo",reqId:!0,module:Cs,closeOption:!0,permission:3,template:!0}],Object(f.a)("client"===b.type||"group"===b.type||"unity"===b.type?[{name:"settings",icon:"admin_panel_settings",title:"$__settings",reqId:!0,module:jl,closeOption:!1,permission:1,template:!0}]:[]),Object(f.a)("user"===b.type&&c._id===b._id?[{name:"settings",icon:"admin_panel_settings",title:"$__settings",reqId:!0,module:yl,closeOption:!1,permission:1,template:!0}]:"user"!==b.type?[{name:"settings",icon:"settings",title:"$__settings",reqId:!0,module:as,closeOption:!1,permission:5,template:!0}]:[])),S=j.filter((function(e){return e.name===a.activeModule}))[0];if(!S||!S.module)return null;var k=function(t){u?ft({message:lt("$__confirmCloseWithUnsavedData",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){d(!1),a.activeModule=t,e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)({},a))}}):(a.activeModule=t,e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)({},a)))},L=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];u||t?ft({message:lt("$__confirmCloseWithUnsavedData",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){e.reduxFunction("ASYNC","CLEAR_MODULE"),d(!1)}}):(e.reduxFunction("ASYNC","CLEAR_MODULE"),d(!1))},C=la(b._id),I=(a.data.type?o.dataType.filter((function(e){return e.name===a.data.type}))[0]:[]).modules;return a&&a.id?i.a.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:3e3,backgroundColor:"rgba(0,0,0,0.7)",backdropFilter:"blur(3px)"},onClick:function(e){e.stopPropagation(),L()}},i.a.createElement("div",{className:c.sideModuleWindow&&"popup"===c.sideModuleWindow?y.modulePopup:c.sideModuleWindow&&"expanded"===c.sideModuleWindow?y.moduleExpanded:c.sideModuleWindow&&"fullScreen"===c.sideModuleWindow?y.moduleFullScreen:y.module,id:"sideModule",onClick:function(e){e.stopPropagation()}},i.a.createElement("div",{className:y.menu,style:{background:dt("menuColor"),borderRight:"solid 3px ".concat(dt("color"))},id:"sideModule_menu"},i.a.createElement("div",{className:y.menuButtons_resume}),I.map((function(e,t){var r=!0;!b||!b._planId||o.cards[b._planId]&&va(b._planId)||(r=!1);var n=j.filter((function(t){return t.name.trim()===e.trim()&&!t.resume&&!t.hide}))[0];if(n&&(("user"===b.type||"client"===b.type)&&(w&&w.user&&(w.userAdmin||w.userModerate&&n.permission<=4||w.userEdit&&n.permission<=3)||b._id===c._id&&n.permission<=3)||"user"!==b.type&&"client"!==b.type&&"account"!==b.type&&"unity"!==b.type&&r&&w&&w.plan&&(w.planAdmin||w.planModerate&&n.permission<=4)||("user"!==b.type||"client"!==b.type||"account"!==b.type)&&String(E)&&parseInt(E)>=parseInt(n.permission))){if(n.ownerLock&&w&&!w.owner&&b._access&&b._access.owner&&c._id!==b._id)return null;if((!C||a.data&&C&&n.template)&&(n&&!n.reqId||n&&(n.reqId||!n.reqId)&&36===a.id.length)){if("recurrence"===n.name&&Object.keys(De.getState().db.cards).filter((function(e){if(!De.getState().db.cards[e].deleted&&!De.getState().db.cards[e].checklist&&De.getState().db.cards[e]._recurrenceId&&De.getState().db.cards[e]._recurrenceId===a.data._id)return!0})).length>0)return i.a.createElement(Nl,{key:t,icon:n.icon,module:n.name,title:lt(n.title,1),count:n.count?n.count:null,openModule:function(e){k(e)}});if("recurrence"!==n.name)return i.a.createElement(Nl,{key:t,icon:n.icon,module:n.name,title:lt(n.title,1),count:n.count?n.count:null,openModule:function(e){k(e)}})}}}))),i.a.createElement("div",{id:"sideModule_header"},i.a.createElement(Io,Object.assign({title:a&&a.data&&a.data.name||"".concat(lt("$__create")," ").concat(lt("$__".concat(a.data.type))),icon:(null===a||void 0===a||null===(t=a.data)||void 0===t?void 0:t.icon)||a&&a.data&&a.data.type&&o.dataType.filter((function(e){return e.name===a.data.type}))[0].icon||"view_comfy",style:{paddingLeft:"50px",width:"calc(100% - 0px)",minHeight:"50px",marginTop:"-4px"},color:dt("menu")},O&&(null===a||void 0===a||null===(r=a.data)||void 0===r?void 0:r._id)?{editable:!0,onChangeIcon:function(t){pa(Object(h.a)(Object(h.a)({},e),{},{data:{_id:a.data._id}}),{icon:t})}}:{})),S.closeOption&&i.a.createElement(Nc,{close:function(){return L()}})),i.a.createElement("div",{className:y.content},i.a.createElement(Ut,null,i.a.createElement(S.module,Object.assign({},S.props,{permission:O,onClose:function(e){L(e)},reqSave:function(e){d(e)}})))),i.a.createElement("div",{className:y.subTitle,id:"sideModule_subTitle",style:Object(h.a)(Object(h.a)({},a&&a.data&&a.data.private?{background:"gray"}:{}),{},{display:"flex",justifyContent:"space-between"})},lt(S.title.toLowerCase(),1),a&&a.data&&a.data.private?i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},lt("$__isPrivate","*"),i.a.createElement(kt,{icon:"lock",color:"#FFFFFF",size:20,style:{marginLeft:7}})):i.a.createElement(i.a.Fragment,null)))):null}))),wu=r(994),Eu=r.n(wu),Ou=Object(Ze.a)({root:{"& .MuiPaper-root":{overflow:"visible"}}})(Ko.a);function ju(){ju=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Su=function(e,t){var r=De.getState().db.tag;r.filter((function(e){return e.value===t.value})).length>0?r.map((function(e,n){e.value===t.value&&(r[n]=Object(h.a)(Object(h.a)({},r[n]),t))})):r.push(t),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{tag:Object(f.a)(r)}))},ku=function(){var e=Object(Me.a)(ju().mark((function e(t,r){return ju().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:ot.delete("/tag/unique/".concat(r._id),Object(h.a)({},r))&&Lu(t,r);case 2:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),Lu=function(e,t){var r=[];De.getState().db.tag.map((function(e){e.value!==t._id&&r.push(e)})),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{tag:r}))},Cu=function(){var e=Object(Me.a)(ju().mark((function e(t,r){return ju().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:ot.put("/tag/unlink/",Object(h.a)({},r))&&Iu(t,r);case 2:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),Iu=function(e,t){var r=[],n=De.getState(),a=n.session,o=n.db;o.tag.map((function(e){var n=e;e.value===t._id&&(n=Object(h.a)(Object(h.a)({},n),{},{count:0})),r.push(n)}));var i=Object(h.a)({},o.cards);Object.keys(i).filter((function(e){return i[e]._users&&i[e]._users[a._id]&&i[e]._tags&&i[e]._tags.filter((function(e){return e.value===t._id})).length>0})).map((function(e){var r=[];i[e]._tags.map((function(e){e.value!==t._id&&r.push(e)})),i[e]._tags=r})),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},o),{},{tag:r,cards:i}))},Fu=function(e){return Object(h.a)(Object(h.a)({},rr),{},{menu:{position:"relative",borderRight:dt("color")},menuExpanded:{position:"relative",borderRight:dt("color")},button:{position:"relative",float:"left",width:"100%",padding:"7px"},buttonColor:{position:"relative",float:"left",width:"calc(100% + 20px)",padding:"20px 12px",marginLeft:"-12px",display:"flex",justifyContent:"center",backgroundColor:dt("color")},buttonColorExpanded:{position:"relative",float:"left",width:"calc(100% + 20px)",padding:"12px 12px 12px 20px",marginLeft:"-12px",display:"flex",backgroundColor:dt("color")},separator:{position:"relative",float:"left",width:"100%",padding:"7px",borderTop:"1px solid ".concat(dt("medium",.5)),marginTop:"15px",marginBottom:"0px",height:"1px"}})};r(1448);function Tu(){Tu=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Nu=Object($e.b)((function(e){return{tag:e.db.tag}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=Object(Lt.a)(Fu)(),r=De.getState(),n=r.db,a=r.session,o=e.tag,c=i.a.useState(!1),l=Object(Be.a)(c,2),u=l[0],d=l[1],p=i.a.useState(null),m=Object(Be.a)(p,2),g=m[0],v=m[1],y=i.a.useState(!1),b=Object(Be.a)(y,2),x=b[0],_=b[1],w=i.a.useState(!1),E=Object(Be.a)(w,2),O=E[0],j=E[1],S=i.a.useState(!1),k=Object(Be.a)(S,2),L=k[0],C=k[1],I=i.a.useState({}),F=Object(Be.a)(I,2),T=F[0],N=F[1],P=i.a.useState(!1),D=Object(Be.a)(P,2),A=D[0],$=D[1],z=i.a.useState(null),M=Object(Be.a)(z,2),B=M[0],Y=M[1],G=i.a.useState([]),R=Object(Be.a)(G,2),H=R[0],W=R[1];i.a.useEffect((function(){return console.log("61TAGSSSSSSSSSSSSS"),u||(d(!0),V(),e.onLoad&&e.onLoad()),function(){}}),[]),i.a.useEffect((function(){return V(),function(){}}),[B,JSON.stringify(e.tag)]);var U=xt(),V=function(){var e=[];o.filter((function(e){var t=B?vt(B.toLowerCase().trim()):"",r=vt(e.label.toLowerCase().trim());if(!B||B&&r.indexOf(t)>-1)return!0})).sort((function(e,t){return vt(e.label.toLowerCase().trim())<vt(t.label.toLowerCase().trim())?-1:vt(e.label.toLowerCase().trim())>vt(t.label.toLowerCase().trim())?1:0})).map((function(t){var r=t;r._count=Object.keys(n.cards).filter((function(e){return n.cards[e]._users&&n.cards[e]._users[a._id]&&n.cards[e]._tags&&n.cards[e]._tags.filter((function(e){return e.value===r.value})).length>0})).length>parseInt(r._count)?Object.keys(n.cards).filter((function(e){return n.cards[e]._users&&n.cards[e]._users[a._id]&&n.cards[e]._tags&&n.cards[e]._tags.filter((function(e){return e.value===r.value})).length>0})).length:parseInt(r._count),r._countOthers=Object.keys(n.cards).filter((function(e){return n.cards[e]._users&&!n.cards[e]._users[a._id]&&n.cards[e]._tags&&n.cards[e]._tags.filter((function(e){return e.value===r.value})).length>0})).length>parseInt(r._countOthers)?Object.keys(n.cards).filter((function(e){return n.cards[e]._users&&!n.cards[e]._users[a._id]&&n.cards[e]._tags&&n.cards[e]._tags.filter((function(e){return e.value===r.value})).length>0})).length:parseInt(r._countOthers),(L||!L&&parseInt(r._count)>0)&&0===e.filter((function(e){return e.id===r.label.substr(0,1)})).length?e.push({id:r.label.substr(0,1),text:r.label.substr(0,1),children:[Object(h.a)({id:r.value,text:r.label},r)]}):e.filter((function(e){return e.id===r.label.substr(0,1)})).length>0&&0===e.filter((function(e){return e.id===r.label.substr(0,1)}))[0].children.filter((function(e){return e.value===r.value})).length&&e.filter((function(e){return e.id===r.label.substr(0,1)}))[0].children.push(Object(h.a)({id:r.value,text:r.label},r))})),W(e)},q=function(){N({}),$(!1),j(!1)},X=function(e){j(!0),N(e||{})},J=function(){var t=Object(Me.a)(Tu().mark((function t(){var r;return Tu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if($(!0),!T.value){t.next=15;break}return t.prev=2,t.next=5,ot.put("tag/update",{_id:T.value,name:T.name?T.name:T.label,color:T.newColor?T.newColor:T.color?T.color:null});case 5:t.sent&&(Su(e,{value:T.value,label:T.name?T.name:T.label,color:T.newColor?T.newColor:T.color},!0),$(!1),q()),t.next=13;break;case 9:t.prev=9,t.t0=t.catch(2),console.log(t.t0),$(!1);case 13:t.next=26;break;case 15:return t.prev=15,t.next=18,ot.post("tag/add",{name:T.name,color:T.newColor?T.newColor:T.color?T.color:null});case 18:(r=t.sent)&&r.data&&(C(!0),Su(e,r.data,!0),$(!1),q()),t.next=26;break;case 22:t.prev=22,t.t1=t.catch(15),console.log(t.t1),$(!1);case 26:case"end":return t.stop()}}),t,null,[[2,9],[15,22]])})));return function(){return t.apply(this,arguments)}}(),K=function(){var t=Object(Me.a)(Tu().mark((function t(r){return Tu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:ft({message:lt("$__confirmDeleteTag",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){ku(e,{_id:r.value})}});case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Z=function(){var t=Object(Me.a)(Tu().mark((function t(r){return Tu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:ft({message:lt("$__confirmUnlinkTag",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){Cu(e,{_id:r.value})}});case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return i.a.createElement("div",{onMouseLeave:function(){x||setTimeout((function(){v(null)}),1e3)}},i.a.createElement("div",{className:t.menu},i.a.createElement("div",{style:{marginTop:"5px"}},i.a.createElement(Fa,{title:lt("$__tags",1),icon:"bookmarks",iconTitle:lt("$__tags",1),color:dt("colorText"),fontSize:"16px",moreButton:!0,options:[{name:"$__addTag",icon:"add_box",color:dt("color"),show:"hover",onClick:function(){X()}},U&&U.plan&&U.planAdmin&&!L&&{name:"$__showAllTags",icon:"style",color:dt("color"),show:"hover",onClick:function(){C(!0)}},L&&{name:"$__onlyMyTags",icon:"loyalty",color:dt("color"),show:"hover",onClick:function(){C(!1)}}],optionsProps:{transparent:!0}})),i.a.createElement("div",{className:t.separator}),i.a.createElement("div",null,i.a.createElement(La,{label:lt("$__search",1),variant:dt("fieldVariant"),name:"name",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:B?i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"cancel",color:"green",onClick:function(){return Y(null)}})):null,onChange:function(e){Y(e.target.value)}},placeholder:lt("$__nameOfTagSearch_placeholder",1)}))),i.a.createElement("div",{style:{position:"absolute",top:"112px",bottom:0,overflow:"auto",padding:"3px",paddingTop:"7px",listStyle:"none",width:"100%"}},i.a.createElement(Eu.a,{collapse:"ALL",items:H,renderItem:function(e){return e.item.value?i.a.createElement("div",{style:{width:"100%",cursor:"pointer",display:"flex"},onMouseOver:function(){U&&U.plan&&U.planAdmin&&v(e.item.value)}},i.a.createElement("div",{style:Object(h.a)({zIndex:0,maxWidth:"90%",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},e.item.color?{borderLeft:"solid 6px ".concat(e.item.color),paddingLeft:"7px"}:{}),onClick:function(){var t;t=e.item,s.push("tags#".concat(t.value))}},e.item.text," ",e.item._count?"(".concat(e.item._count,")"):""),g&&e.item.value===g&&i.a.createElement("div",{style:{zIndex:1}},i.a.createElement(En,{horizontalButton:!0,transparent:!0,size:"14px",btColor:dt("color"),onOpen:function(){_(!0)},onClose:function(){_(!1)},options:[].concat(Object(f.a)(U&&U.plan&&U.planAdmin?[{name:"$__edit",icon:"edit",onClick:function(){X(e.item)}}]:[]),[(0===parseInt(e.item._count)&&0===parseInt(e.item._countOthers)||parseInt(e.item._count)>0&&0===parseInt(e.item._countOthers))&&{name:"$__delete",icon:"delete_forever",onClick:function(){K(e.item)}},parseInt(e.item._count)>0&&parseInt(e.item._countOthers)>0&&{name:"$__unlinkMyActivities",icon:"label_off",onClick:function(){Z(e.item)}}])}))):i.a.createElement("div",{style:{fontWeight:"bold",color:dt("color"),fontSize:"12px"}},e.item.text)},onChange:function(e){}})),i.a.createElement(Ou,{fullWidth:!0,"aria-labelledby":"simple-dialog-title",open:O,style:{overflow:"visible !important"}},i.a.createElement("div",{style:{position:"relative",marginLeft:"10px",marginTop:"5px",width:"calc(100% - 10px)"}},i.a.createElement(Fa,{title:T.value?lt("$__editTag",1):lt("$__newTag",1),icon:"label",onCancel:function(){j(!1)}})),i.a.createElement("div",{style:{color:"#CCCCCC",padding:"15px"}},"Etiquetas permitem que voc\xea adicione palavras-chave \xe0s atividades (Tarefas, Insights, Not\xedcias), organizando-as e permitindo melhor navega\xe7\xe3o e praticidade no seu dia a dia."),i.a.createElement("div",{style:{padding:"15px"}},i.a.createElement(La,{error:!(!T||T.label&&0!==T.label.length),helperText:"Campo de nome da etiqueta deve ter o compimento m\xednimo de 1 caractere",label:lt("$__name",1),variant:dt("fieldVariant"),name:"name",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",onChange:function(e){N(Object(h.a)(Object(h.a)({},T),{},{name:e.target.value}))}},defaultValue:T&&T.label?T.label:null,placeholder:lt("$__nameOfTag_placeholder",1)})),i.a.createElement("div",{style:{display:"flex",padding:"15px",overflow:"visible"}},i.a.createElement("span",{style:{marginRight:"7px"}},lt("$__tagColor"),":"),i.a.createElement(vn,{disablePortal:!0,color:T.color,onChange:function(e){N(Object(h.a)(Object(h.a)({},T),{},{newColor:e}))}},T.color||T.newColor?i.a.createElement("div",{className:"tag",style:{backgroundColor:T.newColor?T.newColor:T.color,width:"22px",height:"22px",borderRadius:"50%",cursor:"pointer"}}):i.a.createElement("div",{className:"tag",style:{fontWeight:"bold"}},lt("$__clickHereToAddColor")))),i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",padding:"15px"}},i.a.createElement(At,{shadow:!0,title:lt("$__cancel"),text:lt("$__cancel"),color:"lightgrey",icon:"close",size:"25px",onClick:function(){j(!1)}}),T&&(T.name||T.newColor)&&i.a.createElement("div",{style:{marginLeft:"15px"}},i.a.createElement(At,{shadow:!0,title:lt("$__save"),text:lt("$__save"),icon:"save",size:"25px",load:!!A,onClick:function(){J()}})))))}));var Pu=Object($e.b)((function(e,t){return{timeline:e.timeline}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=po();return document.title="".concat(t&&t.total>0?"(".concat(t.total,") "):"","MACHEN"),i.a.createElement(i.a.Fragment,null,i.a.createElement(Pt.a,{badgeContent:t&&t.total?t.total:0,color:"secondary",overlap:"rectangular"},e.children))})),Du=r(1704),Au=r(1732),$u=r(1705),zu=r(1701),Mu={disabled:{"&:before":{borderColor:"transparent !important"}},underline:{"&:hover:not($disabled):before,&:before":{borderColor:sr[4]+"!important",borderWidth:"1px !important"},"&:after":{borderColor:nr[0]},"& + p":{fontWeight:"300"}},underlineError:{"&:after":{borderColor:or[0]}},underlineSuccess:{"&:after":{borderColor:ir[0]}},labelRoot:Object(h.a)(Object(h.a)({},rr),{},{color:sr[3]+" !important",fontWeight:"400",fontSize:"12px",lineHeight:"1.42857",top:"10px",letterSpacing:"unset","& + $underline":{marginTop:"0px"}}),labelRootError:{color:or[0]+" !important"},labelRootSuccess:{color:ir[0]+" !important"},formControl:{margin:"0 0 16px 0",paddingTop:"27px",position:"relative",verticalAlign:"unset","& svg,& .fab,& .far,& .fal,& .fas,& .material-icons":{color:sr[14]}},whiteUnderline:{"&:hover:not($disabled):before,&:before":{backgroundColor:"#FFF"},"&:after":{backgroundColor:"#FFF"}},input:{color:sr[14],height:"unset","&,&::placeholder":{fontSize:"12px",fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif',fontWeight:"400",lineHeight:"1.42857",opacity:"1"},"&::placeholder":{color:sr[3]}},whiteInput:{"&,&::placeholder":{color:"#FFF",opacity:"1"}}},Bu=Object(Lt.a)(Mu);function Yu(e){var t,r,n,a,o,c=Bu(),l=e.formControlProps,s=e.labelText,u=e.id,d=e.labelProps,p=e.inputProps,f=e.error,h=e.white,m=e.inputRootCustomClasses,g=e.success,v=e.helperText,y=We()((t={},Object(O.a)(t," "+c.labelRootError,f),Object(O.a)(t," "+c.labelRootSuccess,g&&!f),t)),b=We()((r={},Object(O.a)(r,c.underlineError,f),Object(O.a)(r,c.underlineSuccess,g&&!f),Object(O.a)(r,c.underline,!0),Object(O.a)(r,c.whiteUnderline,h),r)),x=We()(Object(O.a)({},m,void 0!==m)),_=We()((n={},Object(O.a)(n,c.input,!0),Object(O.a)(n,c.whiteInput,h),n));o=void 0!==l?We()(l.className,c.formControl):c.formControl;var w=We()((a={},Object(O.a)(a,c.labelRootError,f),Object(O.a)(a,c.labelRootSuccess,g&&!f),a));return i.a.createElement(Du.a,Object.assign({},l,{className:o}),void 0!==s?i.a.createElement(Au.a,Object.assign({className:c.labelRoot+" "+y,htmlFor:u},d),s):null,i.a.createElement(zu.a,Object.assign({classes:{input:_,root:x,disabled:c.disabled,underline:b},id:u},p)),void 0!==v?i.a.createElement($u.a,{id:u+"-text",className:w},v):null)}var Gu={cardFooter:{padding:"0",paddingTop:"10px",margin:"0 15px 10px",borderRadius:"0",justifyContent:"space-between",alignItems:"center",display:"flex",backgroundColor:"transparent",border:"0"},cardFooterProfile:{marginTop:"-15px"},cardFooterPlain:{paddingLeft:"5px",paddingRight:"5px",backgroundColor:"transparent"},cardFooterPricing:{zIndex:"2"},cardFooterTestimonial:{display:"block"},cardFooterStats:{borderTop:"1px solid"+sr[8],marginTop:"20px","& svg":{position:"relative",top:"4px",marginRight:"3px",marginLeft:"3px",width:"16px",height:"16px"},"& .fab,& .fas,& .far,& .fal,& .material-icons":{position:"relative",top:"4px",marginRight:"3px",marginLeft:"3px",fontSize:"12px",lineHeight:"16px"}},cardFooterChart:{borderTop:"1px solid"+sr[8]}},Ru=["className","children","plain","profile","pricing","testimonial","stats","chart","product"],Hu=Object(Lt.a)(Gu);function Wu(e){var t,r=Hu(),n=e.className,a=e.children,o=e.plain,c=e.profile,l=e.pricing,s=e.testimonial,u=e.stats,d=e.chart,p=e.product,f=Object(Kt.a)(e,Ru),h=We()((t={},Object(O.a)(t,r.cardFooter,!0),Object(O.a)(t,r.cardFooterPlain,o),Object(O.a)(t,r.cardFooterProfile,c||s),Object(O.a)(t,r.cardFooterPricing,l),Object(O.a)(t,r.cardFooterTestimonial,s),Object(O.a)(t,r.cardFooterStats,u),Object(O.a)(t,r.cardFooterChart,d||p),Object(O.a)(t,n,void 0!==n),t));return i.a.createElement("div",Object.assign({className:h},f),a)}var Uu=function(e){return{container:Object(h.a)(Object(h.a)({},tr),{},Object(O.a)({zIndex:"4"},e.breakpoints.down("sm"),{paddingBottom:"100px"})),cardTitle:Object(h.a)(Object(h.a)({},jr),{},{color:"#FFF"}),textCenter:{textAlign:"center"},justifyContentCenter:{justifyContent:"center !important"},customButtonClass:{"&,&:focus,&:hover":{color:"#FFF"},marginLeft:"5px",marginRight:"5px"},inputAdornment:{marginRight:"18px"},inputAdornmentIcon:{color:sr[6]},cardHidden:{opacity:"0",transform:"translate3d(0, -60px, 0)"},cardHeader:{marginBottom:"20px"},socialLine:{padding:"0.9375rem 0"}}};function Vu(){Vu=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var qu=Object(Lt.a)(Uu);var Xu,Ju,Ku=r(1824),Zu=r(1809),Qu=r(1816);function ed(){ed=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var td=Xe.default.div(Xu||(Xu=Object(ze.a)(["\n background-color:none;\n\n "]))),rd=Xe.default.div(Ju||(Ju=Object(ze.a)(["\n min-width:300px;\n background-color: rgba(255,255,255,0.9);\n padding: 7px;\n margin-bottom:10px;\n box-shadow: 0 0 7px rgba(0,0,0,0.2);\n display:flex;\n "]))),nd=Object($e.b)((function(e){return{store:e}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=i.a.useState(null),r=Object(Be.a)(t,2),n=r[0],a=r[1],o=i.a.useState(""),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.useState(""),d=Object(Be.a)(u,2),p=d[0],f=d[1],m=i.a.useState({}),g=Object(Be.a)(m,2),v=g[0],y=g[1],b=i.a.useState({open:!1,name:""}),x=Object(Be.a)(b,2),_=x[0],w=x[1],E=De.getState().db,j=De.getState().functions.socket,S=function(){var e=Object(Me.a)(ed().mark((function e(t){var r,n,a,o,i,c;return ed().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.destination,n=t.source,a=t.draggableId,r){e.next=3;break}return e.abrupt("return",!1);case 3:if(r.droppableId!==n.droppableId||r.id!==n.index){e.next=5;break}return e.abrupt("return",!1);case 5:return o=Array.from(E.cards.boardModels.boards[n.droppableId].columnOrder),i=n.droppableId,o.splice(n.index,1),o.splice(r.index,0,a),ot.put("column/reorder",{columns:o}),c={_parent:"boardModels",_board:i,_order:o},j.emit("column.REORDER",c),e.abrupt("return");case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),k=function(){var e=Object(Me.a)(ed().mark((function e(t){var r,o,i,c;return ed().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Array.from(E.cards.boardModels.boards[t].columnOrder),e.prev=1,i={},n){e.next=10;break}return e.next=6,ot.post("column/add",{board:t,name:l,icon:p});case 6:o=e.sent,i={cards:[],name:l,_id:o.data.id,icon:p},e.next=14;break;case 10:return e.next=12,ot.put("column/update",{_id:n,board:t,name:l,icon:p});case 12:o=e.sent,i={name:l,_id:o.data.id,icon:p};case 14:o&&(n||r.push(o.data.id),c={_parent:"boardModels",_columnId:o.data.id,_board:t,_cardColumn:"boardModels",_columnData:i,_columnsOrder:r},j.emit("column.UPD",c),y(!1),s(""),f(""),a(null)),e.next=20;break;case 17:e.prev=17,e.t0=e.catch(1),console.log(e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t){return e.apply(this,arguments)}}(),L=function(){var e=Object(Me.a)(ed().mark((function e(t,r){var n,a;return ed().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=De.getState().functions.socket,e.prev=1,e.next=4,ot.delete("column/run/".concat(r,"__").concat(t),{board:t,name:l,icon:p});case 4:e.sent&&(a={_parent:"boardModels",_board:t,_deleted:r},n.emit("column.DELETE",a)),e.next=10;break;case 8:e.prev=8,e.t0=e.catch(1);case 10:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,r){return e.apply(this,arguments)}}(),C=function(){var t=Object(Me.a)(ed().mark((function t(){var r;return ed().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,ot.post("boards/add",{name:_.name});case 3:r=t.sent,e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},{boardModels:Object(h.a)(Object(h.a)({},De.getState().db.cards.boardModels),{},{boards:Object(h.a)(Object(h.a)({},De.getState().db.cards.boardModels.boards),r.data)})})})),w({name:"",open:!1}),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),console.log(t.t0);case 11:case"end":return t.stop()}}),t,null,[[0,8]])})));return function(){return t.apply(this,arguments)}}();return i.a.createElement(vo,null,E.cards&&E.cards.boardModels&&E.cards.boardModels.boards&&Object.keys(E.cards.boardModels.boards).map((function(t){return i.a.createElement(di.a,{onDragEnd:S,key:t},i.a.createElement(xo,{md:3},i.a.createElement("fieldset",{style:{width:"100%"}},i.a.createElement("legend",null,E.cards.boardModels.boards[t].name),i.a.createElement(di.c,{droppableId:t,type:"column",direction:"vertical"},(function(r,n){return i.a.createElement(td,Object.assign({ref:r.innerRef},r.droppableProps,{isDraggingOver:n.isDraggingOver}),!e.noList&&E.cards&&E.cards.boardModels&&E.cards.boardModels.boards&&E.cards.boardModels.boards[t]&&E.cards.boardModels.boards[t].columnOrder&&E.cards.boardModels.boards[t].columnOrder.map((function(e,r){return i.a.createElement(di.b,{draggableId:e,index:r,key:"".concat(e,"-").concat(r)},(function(r){return i.a.createElement(rd,Object.assign({},r,{ref:r.innerRef},r.draggableProps,{isDragging:n.isDragging},r.dragHandleProps),E.cards.boardModels.boards[t].columns[e].name&&i.a.createElement(Io,{title:E.cards.boardModels.boards[t].columns[e].name||"",icon:E.cards.boardModels.boards[t].columns[e].icon||null,iconTitle:"A",fontSize:"16px",customButtons:[{name:"delete",icon:"delete_forever",onClick:function(){L(t,e)},show:"hover"},{name:"edit",icon:"edit",onClick:function(){s(E.cards.boardModels.boards[t].columns[e].name),f(E.cards.boardModels.boards[t].columns[e].icon||null),a(e),y(Object(O.a)({},t,{open:!0}))},show:"hover"}]}))}))})),v&&v[t]&&v[t].open?i.a.createElement(i.a.Fragment,null,i.a.createElement(rd,null,i.a.createElement("div",{style:{position:"relative",float:"left",width:"40px",height:"auto",display:"flex",justifyContent:"center",alignItems:"center"}},i.a.createElement(jo,{callBack:function(e){f(e)}})),i.a.createElement("div",{style:{position:"relative",float:"left",width:"calc(100% - 40px)"}},i.a.createElement(La,{label:lt("$__nameOfColumn",1),variant:"outlined",name:"NewColumn",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",onChange:function(e){s(e.target.value)},onKeyPress:function(e){"Enter"===e.key&&e.target.value.length>0&&k(t)}},value:l,placeholder:lt("$__name",1),styles:{marginBotton:"0px !important"},autoFocus:!0}))),i.a.createElement("div",{style:{display:"inline-flex",alignItems:"center",width:"100%",justifyContent:"center"}},i.a.createElement(rn,{icon:"save",text:lt("$__save","*"),onClick:function(){k(t)}}),i.a.createElement(rn,{icon:lt("$__cancel","*"),iconColor:"red",text:lt("$__cancel","*"),onClick:function(){s(""),y({})}}))):i.a.createElement(rn,{icon:"add_box",text:lt("$__addColumn",1),onClick:function(){y(Object(O.a)({},t,{open:!0}))}}),r.placeholder)})))))})),i.a.createElement("div",null,_.open?i.a.createElement("div",{style:{position:"relative",float:"left",width:"calc(100% - 40px)"}},i.a.createElement(La,{label:lt("$__boardName",1),variant:"outlined",name:"boardName",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",onChange:function(e){w(Object(h.a)(Object(h.a)({},_),{},{name:e.target.value}))},onKeyPress:function(e){"Enter"===e.key&&e.target.value.length>0&&C()}},value:_&&_.name,placeholder:lt("$__name",1),styles:{marginBotton:"0px !important"},autoFocus:!0}),i.a.createElement("div",{style:{display:"inline-flex",alignItems:"center",width:"100%",justifyContent:"center"}},i.a.createElement(rn,{icon:"save",text:lt("$__save","*"),onClick:function(){C()}}),i.a.createElement(rn,{icon:"cancel",iconColor:"red",text:lt("$__cancel","*"),onClick:function(){s(""),w({open:!1,name:""})}}))):i.a.createElement(rn,{icon:"add_box",text:lt("$__addBoard",1),onClick:function(){w(Object(h.a)(Object(h.a)({},_),{},{open:!0}))}})))})),ad=r(1819),od=function(e){return{root:Object(h.a)(Object(h.a)({},rr),{},{width:"100%",marginBottom:e.spacing(2),padding:"7px",height:"calc(100vh - 220px)",overflowX:"auto"}),header:{position:"relative",float:"left",width:"auto",minWidth:"100%",height:"50px",display:"flex",alignItems:"center",backgroundColor:dt("dark"),color:dt("light")},column:{padding:"7px 15px",fontWeight:"bold",borderRight:"solid 1px ".concat(dt("light",.4)),width:"300px"},column2:{padding:"7px 15px",fontWeight:"bold",borderRight:"solid 1px ".concat(dt("light",.4)),width:"calc(100% - 300px)"},body:{color:dt("medium"),position:"relative",clear:"both",display:"flex",alignItems:"center",borderBottom:"solid 1px ".concat(dt("medium",.2)),"& ul":{position:"relative",padding:"0px",margin:"0px",float:"left",minWidth:"100%","& li":{minWidth:"100%",width:"fit-content",display:"flex",listStyle:"none",padding:"15px 0px",borderBottom:"1px solid ".concat(dt("medium",.2))}}},chip:{margin:"3px"}}};function id(){id=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var cd=Object($e.b)((function(e){return{languages:e.languages}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(od)((function(e){var t=e.classes,r=De.getState(),n=r.languages,a=r.db,o=De.getState().functions.socket,c=i.a.useState(!1),l=Object(Be.a)(c,2),s=l[0],d=l[1],p=i.a.useState(0),f=Object(Be.a)(p,2),h=f[0],m=f[1],g=i.a.useState(25),v=Object(Be.a)(g,2),y=v[0],b=v[1],x=i.a.useState(""),_=Object(Be.a)(x,2),w=_[0],E=_[1],O=function(){var e=Object(Me.a)(id().mark((function e(t,r,n,a){return id().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t?o.emit("language.UPD",{alias:r,locale:n,text:a}):o.emit("data",{module:"language",method:"post",action:"addLocale"},{alias:r,locale:n,text:a});case 1:case"end":return e.stop()}}),e)})));return function(t,r,n,a){return e.apply(this,arguments)}}();return a.myTasksMenuExpanded,i.a.createElement("div",{style:{width:"100%"}},i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",left:"0px",right:"0px",padding:"15px",display:"flex",alignItems:"center",justifyContent:"center"}},lt("$__page")," ",h+1," ",lt("$__of")," ",Math.ceil(Object.keys(n).length/y),i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},i.a.createElement(ad.a,{component:"div",count:Object.keys(n).length,page:h,onChangePage:function(e,t){m(t)},rowsPerPage:y,onChangeRowsPerPage:function(e){b(parseInt(e.target.value,10))},labelRowsPerPage:lt("$__cardsPerPage")}))),i.a.createElement("div",{style:{width:"100%",display:"flex",alignItems:"center"}},i.a.createElement(La,{label:lt("$__search",1),variant:dt("fieldVariant"),value:w,onChange:function(e){E(e.target.value)}}),i.a.createElement(rn,{text:lt("$__showOnlyEmpty","*"),icon:s?"subtitles_off":"subtitles",iconColor:dt("medium"),onClick:function(){d(!s)}})),i.a.createElement(hn.a,{className:t.root},i.a.createElement("div",{className:t.header},i.a.createElement("div",{className:t.column},lt("alias",1)),i.a.createElement("div",{className:t.column},"Portugues"),i.a.createElement("div",{className:t.column},"Ingles")),i.a.createElement("div",{className:t.body},i.a.createElement("ul",null,n&&Object.keys(n)&&Object.keys(n).length>0&&Object.keys(n).filter((function(e){if((!w||w&&(e.indexOf(w)>-1||n[e]&&n[e].locales&&Object.keys(n[e].locales).filter((function(t){return n[e].locales[t].name.indexOf(w)>-1})).length>0))&&(s&&n[e]&&(!n[e].locales||!n[e].locales["pt-BR"]||!n[e].locales["pt-BR"].name)||!s))return!0})).sort((function(e,t){return e<u.b?-1:e>t?1:0})).map((function(e,r){if(r<=(h+1)*y&&r>=h*y)return i.a.createElement("li",{key:e.trim()},i.a.createElement("div",{className:t.column},e),i.a.createElement("div",{className:t.column},i.a.createElement("div",{style:{position:"relative"}},i.a.createElement(Io,{key:"".concat(e,"_pt-BR"),title:n[e].locales&&n[e].locales["pt-BR"]&&n[e].locales["pt-BR"].name&&n[e].locales["pt-BR"].name,editable:!0,_id:n[e].locales&&n[e].locales["pt-BR"]&&n[e].locales["pt-BR"].id&&n[e].locales["pt-BR"].id,onEdit:function(e,t){console.log(e)},color:dt("menu"),noAutoFocus:!0,multiline:!0}))),i.a.createElement("div",{className:t.column},i.a.createElement("div",{style:{position:"relative"}},i.a.createElement(Io,{key:"".concat(e,"_en-US"),title:n[e].locales&&n[e].locales["en-US"]&&n[e].locales["en-US"].name&&n[e].locales["en-US"].name,editable:!0,_id:n[e].locales&&n[e].locales["en-US"]&&n[e].locales["en-US"].id&&n[e].locales["en-US"].id,onEdit:function(t,r){O(r,e,"en-US",t)},color:dt("menu"),noAutoFocus:!0,multiline:!0}))))}))))))}))),ld=function(e){Object(Ht.a)(r,e);var t=Object(Wt.a)(r);function r(e){var n;return Object(Gt.a)(this,r),(n=t.call(this,e)).change=function(e){n.setState({input:ht(e.target.value)})},n.state={input:""},n.start=0,n}return Object(Rt.a)(r,[{key:"render",value:function(){return i.a.createElement("div",null,i.a.createElement("input",Object.assign({type:"text",onBlur:this.blur,onChange:this.change,value:this.state.input,style:{fontSize:"22px",padding:"4px"}},this.props)),i.a.createElement("pre",{style:{color:"#999",height:"30px"}},mt(this.state.input)))}}]),r}(i.a.Component);var sd=Object($e.b)((function(){return{}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(od)((function(e){e.classes;var t=De.getState(),r=!!(t.languages,t.db).myTasksMenuExpanded;return i.a.createElement("div",{style:r?{width:"calc(100% - 400x)",marginLeft:"388px"}:{width:"calc(100% - 138px)",marginLeft:"138px"}},i.a.createElement(ld,null))}))),ud=["children","value","index"];function dd(e){var t=e.children,r=e.value,n=e.index,a=Object(Kt.a)(e,ud);return i.a.createElement("div",Object.assign({role:"tabpanel",hidden:r!==n,id:"scrollable-strength-tabpanel-".concat(n),"aria-labelledby":"scrollable-strength-tab-".concat(n)},a),r===n&&i.a.createElement(Ku.a,{p:3},t))}function pd(e){return{id:"scrollable-strength-tab-".concat(e),"aria-controls":"scrollable-strength-tabpanel-".concat(e)}}var fd=Object(Lt.a)((function(e){return{root:{flexGrow:1,width:"100%",backgroundColor:e.palette.background.paper}}}));var hd=Object($e.b)((function(e){return{history:e.db.history}}),(function(e){return Object(u.b)(n,e)}))((function(e){fd();var t=De.getState().db,r=i.a.useState(0),n=Object(Be.a)(r,2),a=n[0],o=n[1],c=i.a.useState(!1),l=Object(Be.a)(c,2),u=l[0],d=l[1],p=i.a.useState(""),f=Object(Be.a)(p,2),h=f[0],m=f[1];i.a.useEffect((function(){if(!u){var e=window.location.hash.split("/");e[0]=e[0].replace("#",""),String(e[0])&&o(Math.ceil(e[0])),d(!0)}}));var g=function(e){De.getState().functions.socket.emit("global",{fn:e})};return t.myTasksMenuExpanded,i.a.createElement("div",null,i.a.createElement(qt.a,{position:"static",color:"default"},i.a.createElement(Qu.a,{value:a,onChange:function(e,t){o(t),s.push("#".concat(t))},variant:"scrollable",scrollButtons:"on",indicatorColor:"primary",textColor:"primary","aria-label":""},i.a.createElement(Zu.a,Object.assign({label:"Data",icon:i.a.createElement(kt,{color:(dt(0===a?"medium":"color"),1)},"Data")},pd(0))),i.a.createElement(Zu.a,Object.assign({label:"Languages",icon:i.a.createElement(kt,{color:(dt(1===a?"medium":"color"),1)},"translate")},pd(1))),i.a.createElement(Zu.a,Object.assign({label:"Versions",icon:i.a.createElement(kt,{color:(dt(2===a?"medium":"color"),1)},"app_registration")},pd(2))))),i.a.createElement(dd,{value:a,index:0},i.a.createElement("div",null,i.a.createElement(sd,null))),i.a.createElement(dd,{value:a,index:1},i.a.createElement("div",null,i.a.createElement(cd,null))),i.a.createElement(dd,{value:a,index:2},i.a.createElement("div",null,i.a.createElement("input",{type:"text",value:h,onChange:function(e){m(e.target.value)}}),i.a.createElement(es,{style:{position:"relative",float:"left",margin:"3px"},color:"primary",onClick:function(){g("version")}},lt("$__send","*")),i.a.createElement(es,{style:{position:"relative",float:"left",margin:"3px"},color:"primary",onClick:function(){g("logout")}},lt("$__logout","*")),i.a.createElement(es,{style:{position:"relative",float:"left",margin:"3px"},color:"primary",onClick:function(){g("reload")}},lt("$__reload","*")))),i.a.createElement(dd,{value:a,index:3},i.a.createElement("div",null,i.a.createElement(nd,null))),i.a.createElement(dd,{value:a,index:4},lt("$__accounts",1)),i.a.createElement(dd,{value:a,index:5},lt("$__users",1)),i.a.createElement(dd,{value:a,index:6},lt("$__support",1)),i.a.createElement(dd,{value:a,index:7},lt("$__finance",1)))}));var md=Object($e.b)((function(e){return{loaders:e.sessionLoads.cards.load}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Xl)((function(e){return i.a.createElement(i.a.Fragment,null,e.loaders&&Object.keys(e.loaders).length>0&&Object.keys(e.loaders).filter((function(t){return"loading"===e.loaders[t]})).length>0&&i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%"}},i.a.createElement("span",{style:{color:dt("menu"),fontSize:"12px",paddingRight:"15px",whiteSpace:"nowrap"}},lt("$__loadingData")),i.a.createElement(Fo,null)))}))),gd=function(){return Object(h.a)(Object(h.a)({},rl),{},{appBar:{boxShadow:"none",borderBottom:"0",marginBottom:"0",position:"fixed",width:"100%",zIndex:"100",color:"#FFFFFF",border:"0",minHeight:"0px",display:"flex",height:"50px",justifyContent:"center",userSelect:"none"},container:{},separator:{position:"absolute",left:"0px",right:"0px",bottom:"-2px",height:"2px",backgroundColor:dt("line")},search:{position:"absolute",left:"62px",right:"0px",bottom:"-35px",height:"33px",boxShadow:"0 3px 3px rgba(0,0,0,0.33)",display:"block",padding:"0 15px",zIndex:1,backgroundColor:dt("menu"),"& .selectedCard":{position:"relative",float:"left",width:"250px",height:"33px",display:"flex !important",alignItems:"center"}},searchMobile:{position:"absolute",left:"0px",right:"0px",paddingLeft:"15px",bottom:"-35px",height:"33px",boxShadow:"0 3px 3px rgba(0,0,0,0.33)",display:"block",padding:"0 15px",backgroundColor:dt("menu"),"& .selectedCard":{position:"relative",float:"left",width:"250px",height:"33px",display:"flex !important",alignItems:"center"}},flex:{flex:1},title:Object(h.a)(Object(h.a)({},rr),{},{lineHeight:"30px",fontSize:"18px",borderRadius:"3px",textTransform:"none",color:"inherit",paddingTop:"0.625rem",paddingBottom:"0.625rem",margin:"0 !important",letterSpacing:"unset","&:hover,&:focus":{background:"transparent"}}),logo:{position:"fixed",padding:"7px 0px",margin:"0",display:"flex",zIndex:"4",alignItems:"center",justifyContent:"center"},logoMini:{transition:"all 300ms linear",opacity:1,textAlign:"center",width:"40px",maxHeight:"40px",marginLeft:"10px",marginRight:"8px",color:"inherit"},logoImg:{width:"100%"},logoNormal:Object(h.a)(Object(h.a)({},rr),{},{margin:"auto",transition:"all 300ms linear",opacity:"1",transform:"translate3d(0px, 0, 0)",textTransform:"uppercase",fontSize:"18px",whiteSpace:"nowrap",fontWeight:"400",overflow:"hidden",color:"".concat(dt("light")," !important"),"&,&:hover,&:focus":{color:"inherit"}}),page:{position:"relative",color:dt("line"),fontSize:"16px",textTransform:"uppercase",cursor:"pointer","& a":{color:"#FFFFFF"}},pageLink:{position:"relative",float:"left",color:dt("light"),margin:"7px",fontSize:"14px",cursor:"pointer",userSelect:"none","&:hover":{fontWeight:"bold"},"& a":{color:"#FFFFFF"}},pageLinkActive:{color:dt("line"),margin:"7px",fontSize:"14px",cursor:"pointer",userSelect:"none",fontWeight:"bold"},activeArrow:{position:"absolute",left:"calc(50% - 11px)",bottom:"-23px",transform:"rotate(-90deg)"}})},vd=Object(Lt.a)(gd);var yd=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=vd(),r=De.getState(),n=r.session,a=r.search,o=r.db,c=i.a.useState(!1),l=Object(Be.a)(c,2),s=(l[0],l[1],xt(),[]),u=window.location.hash.split("/");u[0]=u[0].replace("#",""),36!==u[0].length&&(u[0]=null);var d=window.location.pathname.split("/"),p="/".concat(d[1]),f=1;if(u[0]){var h=o.cards[u[0]]||{};(f=h&&h._users&&Object.keys(h._users).length>0?h._users[Object.keys(h._users).find((function(e){return e.indexOf(n._id)>-1}))]:0)&&f.access&&(f=f.access)}return u[1]&&$m.filter((function(e){return e.path===p})).length>0&&$m.filter((function(e){return e.path===p}))[0].tabs&&$m.filter((function(e){return e.path===p}))[0].tabs.length>0?($m.filter((function(e){return e.path===p}))[0].tabs&&$m.filter((function(e){return e.path===p}))[0].tabs).map((function(e){e.path===u[1]&&(s=e.searchFields)})):$m.filter((function(e){return e.path===p})).length>0&&$m.filter((function(e){return e.path===p}))[0].searchFields&&(s=$m.filter((function(e){return e.path===p}))[0].searchFields),JSON.stringify(ie)===JSON.stringify(a)?i.a.createElement(i.a.Fragment,null):i.a.createElement("div",{style:{}},i.a.createElement(vo,null,i.a.createElement(xo,{xs:12,sm:9,md:9,lg:9,xl:9},i.a.createElement("span",{style:{color:dt("medium"),fontWeight:"bold",fontSize:"18px",display:"flex",alignItems:"center"}},i.a.createElement(kt,{size:"18px"},"search"),lt("$__appliedFilters"))),i.a.createElement(xo,{xs:12,sm:3,md:3,lg:3,xl:3},i.a.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},i.a.createElement(rn,{reverse:!0,icon:"clear_all",text:lt("$__clearFilter","*"),onClick:function(){e.reduxFunction("ASYNC","SEARCH_CLEAR")}}))),s&&s.indexOf("text")>-1&&a.text&&i.a.createElement(xo,{xs:6,sm:4,md:2,lg:2,xl:2},i.a.createElement("div",{className:t.textField,style:{width:"100%"}},lt("$__text"),": ",a.text)),s&&s.indexOf("status")>-1&&JSON.stringify(a.cards.status)!==JSON.stringify(ie.cards.status)&&i.a.createElement(xo,{xs:6,sm:4,md:2,lg:2,xl:2},i.a.createElement("div",{style:{color:dt("color"),fontSize:"16px"}},i.a.createElement("div",{style:{position:"relative",float:"left"}},lt("$__status")),Object.keys(a.cards.status).map((function(e,t){if(a.cards.status[e]&&"all"!==e)return i.a.createElement(Qe.a,{title:lt(o.status.filter((function(t){return t.value===e}))[0].label,1),key:t},i.a.createElement("div",{style:{position:"relative",float:"left",width:"11px",height:"11px",borderRadius:"50%",backgroundColor:o.status.filter((function(t){return t.value===e}))[0].color,margin:"7px 3px"}}))})))),s&&s.indexOf("priority")>-1&&JSON.stringify(a.cards.priority)!==JSON.stringify(ie.cards.priority)&&i.a.createElement(xo,{xs:6,sm:4,md:2,lg:2,xl:2},i.a.createElement("div",{style:{color:dt("color"),fontSize:"16px"}},i.a.createElement("div",{style:{position:"relative",float:"left"}},lt("$__priority")),Object.keys(a.cards.priority).map((function(e,t){if(a.cards.priority[e]&&"all"!==e)return i.a.createElement(Qe.a,{title:lt(o.priority.filter((function(t){return String(t.value)===String(e)}))[0].label,1),key:t},i.a.createElement("div",{style:{position:"relative",float:"left",width:"11px",height:"11px",borderRadius:"50%",backgroundColor:o.priority.filter((function(t){return String(t.value)===String(e)}))[0].color,margin:"7px 3px"}}))})))),s&&s.indexOf("users")>-1&&JSON.stringify(a.users)!==JSON.stringify(ie.users)&&i.a.createElement(xo,{xs:6,sm:4,md:2,lg:2,xl:2},i.a.createElement("div",{style:{color:dt("color"),fontSize:"16px"}},lt("$__users"),i.a.createElement(Yo.a,{max:6},Object.keys(De.getState().search.users.selected).length>0&&Object.keys(De.getState().search.users.selected).map((function(e,t){return"unassigned"!==e&&De.getState().search.users.selected[e]?i.a.createElement(Qe.a,{title:o.users[e].name,key:t},i.a.createElement(nn.a,{style:{width:"30px",height:"30px"},alt:o.users[e].name,src:o.users[e].image||null},o.users[e].name.substr(0,1))):"unassigned"===e&&De.getState().search.users.selected[e]&&i.a.createElement(Qe.a,{title:lt("$__unassigned",1),key:t},i.a.createElement(nn.a,{style:{width:"30px",height:"30px"},alt:lt("$__unassigned",1),src:on.a},lt("$__unassigned",1)))}))))),s&&s.indexOf("units")>-1&&JSON.stringify(a.units)!==JSON.stringify(ie.units)&&Object.keys(o.users).filter((function(e){return"user"!==o.users[e].type})).length>0&&s.indexOf("units")>-1&&i.a.createElement(xo,{xs:6,sm:4,md:2,lg:2,xl:2},i.a.createElement("div",{style:{color:dt("color"),fontSize:"16px"}},lt("$__units"),i.a.createElement(Yo.a,{max:6},Object.keys(De.getState().search.units.selected).length>0&&Object.keys(De.getState().search.units.selected).map((function(e,t){return"unassigned"!==e&&De.getState().search.units.selected[e]?i.a.createElement(Qe.a,{title:o.users[e].name,key:t},i.a.createElement(nn.a,{style:{width:"30px",height:"30px"},alt:o.users[e].name,src:o.users[e].image||null},o.users[e].name.substr(0,1))):"unassigned"===e&&De.getState().search.units.selected[e]&&i.a.createElement(Qe.a,{title:lt("$__unassigned",1),key:t},i.a.createElement(nn.a,{style:{width:"30px",height:"30px"},alt:lt("$__unassigned",1),src:on.a},lt("$__unassigned",1)))}))))),De.getState().search.plans&&De.getState().search.plans.selected&&Object.keys(De.getState().search.plans.selected).length>0&&Object.keys(o.cards).filter((function(e){return"plan"===o.cards[e].type})).length>0&&s&&s.indexOf("plans")>-1&&i.a.createElement(xo,{xs:6,sm:4,md:2,lg:2,xl:2},i.a.createElement("div",{style:{color:dt("color"),fontSize:"16px"}},lt("$__plans"),i.a.createElement(Yo.a,{max:6},Object.keys(De.getState().search.plans.selected).length>0&&Object.keys(De.getState().search.plans.selected).map((function(e,t){return"unassigned"!==e&&De.getState().search.plans.selected[e]?i.a.createElement(Qe.a,{title:o.cards[e].name,key:t},i.a.createElement(nn.a,{style:{width:"30px",height:"30px"},alt:o.cards[e].name,src:o.cards[e].image||null},o.cards[e].name.substr(0,1))):"unassigned"===e&&De.getState().search.plans.selected[e]&&i.a.createElement(Qe.a,{title:lt("$__unassigned",1),key:t},i.a.createElement(nn.a,{style:{width:"30px",height:"30px"},alt:lt("$__unassigned",1),src:on.a},lt("$__unassigned",1)))}))))),i.a.createElement(xo,{xs:12,sm:12,md:12,lg:12,xl:12})))})),bd=function(e){return{card:{width:"calc(20% - 20px)",minWidth:"250px",maxWidth:"400px",margin:"10px",placeSelf:"flex-end"}}};function xd(){xd=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var _d=Object($e.b)((function(e,t){return{cards:e.db.cards,search:e.search}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(bd)((function(e){var t=De.getState(),r=t.db,n=t.search,a=t.session,o=i.a.useState(0),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.useState(21),d=Object(Be.a)(u,2),p=d[0],f=(d[1],i.a.useState(!1)),m=Object(Be.a)(f,2),g=m[0],v=m[1],y=i.a.useState(!1),b=Object(Be.a)(y,2),x=b[0],_=b[1];i.a.useEffect((function(){return w(l,p),function(){}}),[]),i.a.useEffect((function(){g||x||w(l,p)}),[l,p]);var w=function(){var t=Object(Me.a)(xd().mark((function t(r,n){var a;return xd().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v(!0),t.next=3,In(e,{cardLoad:"insights",limit:n,skip:r*n,ignoreLoader:!0});case 3:(a=t.sent)&&(v(!1),a.total<n&&_(!0));case 5:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),E=window.location.hash.split("/");E[0]=E[0].replace("#","");var O={};return O=(O=Object.keys(r.cards).filter((function(e){return"insight"===r.cards[e].type&&!r.cards[e].deleted&&r.cards[e]._users&&r.cards[e]._users[a._id]})).sort((function(e,t){return r.cards[e].created_at>r.cards[t].created_at?-1:0})).map((function(e){return r.cards[e]}))).filter((function(e){return e.description&&e.description.toLowerCase().indexOf(n.text.toLowerCase())>-1||e.name&&e.name.toLowerCase().indexOf(n.text.toLowerCase())>-1})).map((function(e){return e})),n.tags.length>0&&(O=O.filter((function(e){return e._tags&&e._tags.length>0&&e._tags.filter((function(e){var t=!1;return n.tags.map((function(r){r.value===e.value&&(t=!0)})),t})).length>0})).map((function(e){return e}))),i.a.createElement("div",{id:"insightList",style:e.horizontal?{position:"relative",justifyContent:"space-between",margin:"auto",width:"100%"}:{position:"absolute",top:0,bottom:0,left:0,right:0,display:"flex",overflowY:"auto"},onScroll:e.horizontal?null:function(e){!function(e){var t=document.getElementById("insightList");t.scrollTop+window.innerHeight+150>t.scrollHeight&&s(l+1)}()}},i.a.createElement(vo,{style:Object(h.a)({},e.horizontal?{overflowX:"auto",flexFlow:"row",display:"-webkit-inline-box"}:{})},Object.keys(O).filter((function(t,r){return!e.max||e.max&&r<e.max})).map((function(e,t){return i.a.createElement(xo,{key:O[e]._id,xs:12,sm:6,md:4,lg:3,xl:2},i.a.createElement(oc,{db:"cards",data:O[e],expanded:!0,Avatar:!0,Resume:!0,showConnectedIn:!0,LoadParent:!0}))}))))}))),wd=function(e){return{feed:{backgroundColor:"rgba(255,255,255,1)",margin:"auto",boxShadow:"0 0 7px 3px rgba(0,0,0,0.05)",width:"-webkit-fill-available",marginBottom:"15px",borderTopRightRadius:22},infos:{padding:"7px",cursor:"pointer"},feedRotate:{width:"calc(20% - 20px)",minWidth:"250px",maxWidth:"400px",backgroundColor:"rgba(255,255,255,1)",padding:"7px 7px 20px 7px",boxShadow:"0 0 7px 3px rgba(0,0,0,0.05)",placeSelf:"flex-end",cursor:"pointer"},image:{width:"100%",paddingTop:"calc((9 / 16) * 100%)",backgroundPosition:"center",backgroundRepeat:"no-repeat"},linkTitle:{marginTop:"7px",width:"100%",height:"auto",fontWeight:"bold",minHeight:"65px"},linkContent:{width:"100%",marginTop:"7px",height:"87px",textOverflow:"ellipsis",overflow:"hidden"},feedFooter:{marginTop:"7px",width:"100%",textAlign:"right",justifyContent:"space-between",borderTop:"1px solid rgba(0,0,0,0.05)",paddingTop:"3px",display:"flex",marginBottom:"7px"},feedDate:{position:"relative",left:"0px",fontSize:"12px",float:"left"},feedLink:{position:"relative",left:"0px",fontSize:"12px",float:"right",display:"flex"}}};var Ed=Object($e.b)((function(e){return{store:e}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(wd)((function(e){e.data;var t=e.classes;return i.a.createElement("div",{className:t.feed},i.a.createElement(Ra.a,{variant:"rect",animation:"wave",style:{borderRadius:0,paddingTop:"calc((9 / 16) * 100%)",width:"100%",borderTopRightRadius:22}}),i.a.createElement("div",{className:t.infos},i.a.createElement("div",{className:t.linkTitle},i.a.createElement(Ra.a,{variant:"rect",animation:"wave",style:{width:"100%",height:"12px",marginBottom:10}}),i.a.createElement(Ra.a,{variant:"rect",animation:"wave",style:{width:"100%",height:"12px",marginBottom:10}}),i.a.createElement(Ra.a,{variant:"rect",animation:"wave",style:{width:"100%",height:"12px",marginBottom:10}})),i.a.createElement("div",{className:t.linkContent},i.a.createElement(Ra.a,{variant:"rect",style:{marginTop:15,borderRadius:7,width:"100%",height:8,marginBottom:12}}),i.a.createElement(Ra.a,{variant:"rect",style:{borderRadius:7,width:"100%",height:8,marginBottom:12}}),i.a.createElement(Ra.a,{variant:"rect",style:{borderRadius:7,width:"100%",height:8,marginBottom:12}}),i.a.createElement(Ra.a,{variant:"rect",style:{borderRadius:7,width:"100%",height:8,marginBottom:12}})),i.a.createElement("div",{className:t.feedFooter},i.a.createElement("div",{className:t.feedDate,style:{width:"50%",height:"20px",display:"flex",alignItems:"center"}},i.a.createElement("div",{style:{width:"100%",height:"8px"}},i.a.createElement(Ra.a,{variant:"rect",style:{borderRadius:7,width:"100%",height:8}}))))))})));function Od(){Od=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var jd=Object($e.b)((function(e,t){return{cards:e.db.cards,search:e.search}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.db,n=t.search,a=t.session,o=i.a.useState(0),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.useState(18),d=Object(Be.a)(u,2),p=d[0],f=(d[1],i.a.useState(!1)),m=Object(Be.a)(f,2),g=m[0],v=m[1],y=i.a.useState(!1),b=Object(Be.a)(y,2),x=b[0],_=b[1],w=i.a.useState(0),E=Object(Be.a)(w,2),O=(E[0],E[1]);i.a.useEffect((function(){return j(l,p),function(){}}),[]),i.a.useEffect((function(){g||x||j(l,p)}),[l,p]);var j=function(){var t=Object(Me.a)(Od().mark((function t(r,n){var a;return Od().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v(!0),t.next=3,In(e,{cardLoad:"links",limit:n,skip:r*n,ignoreLoader:!0});case 3:(a=t.sent)&&(v(!1),O(parseInt(a.total)),a.total<n&&_(!0));case 5:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),S=window.location.hash.split("/");S[0]=S[0].replace("#","");var k={};k=(k=Object.keys(r.cards).filter((function(e){return"link"===r.cards[e].type&&r.cards[e]._users&&r.cards[e]._users[a._id]&&!r.cards[e].deleted})).sort((function(e,t){return r.cards[e].created_at>r.cards[t].created_at?-1:0})).map((function(e){return r.cards[e]}))).filter((function(e){return e.description&&e.description.toLowerCase().indexOf(n.text.toLowerCase())>-1||e.name&&e.name.toLowerCase().indexOf(n.text.toLowerCase())>-1})).map((function(e){return e})),n.tags.length>0&&(k=k.filter((function(e){return e._tags&&e._tags.length>0&&e._tags.filter((function(e){var t=!1;return n.tags.map((function(r){r.value===e.value&&(t=!0)})),t})).length>0})).map((function(e){return e})));var L=function(){for(var e=[],t=0;t<p;t++)e.push(i.a.createElement(xo,{xs:12,sm:6,md:4,lg:3,xl:2,key:"sk_".concat(t)},i.a.createElement(Ed,null)));return i.a.createElement(i.a.Fragment,null,e)};return i.a.createElement("div",{id:"linkList",style:e.horizontal?{position:"relative",justifyContent:"space-between",margin:"auto",width:"100%"}:{position:"absolute",top:0,bottom:0,left:0,right:0,display:"flex",overflowY:"auto"},onScroll:e.horizontal?null:function(e){!function(e){var t=document.getElementById("linkList");t.scrollTop+window.innerHeight+150>t.scrollHeight&&s(l+1)}()}},i.a.createElement(vo,{style:Object(h.a)({},e.horizontal?{overflowX:"auto",flexFlow:"row",display:"-webkit-inline-box"}:{})},i.a.createElement("div",null),Object.keys(k).filter((function(t,r){return!e.max||e.max&&r<e.max})).map((function(e,t){return i.a.createElement(xo,{key:k[e]._id,xs:12,sm:6,md:4,lg:3,xl:2},i.a.createElement(oc,{db:"cards",data:k[e],expanded:!0,Avatar:!0,Resume:!0,showConnectedIn:!0,LoadParent:!0}))})),g?i.a.createElement(L,null):i.a.createElement(i.a.Fragment,null)))})),Sd=r(995),kd=r.n(Sd),Ld=r(713),Cd=r.n(Ld),Id=r(714),Fd=r.n(Id);var Td=Object($e.b)((function(e){return{}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(wd)((function(e){var t=e.data,r=e.classes,n=i.a.useState(t.img),a=Object(Be.a)(n,2),o=a[0],c=a[1],l=i.a.useState({backgroundSize:"contain"}),s=Object(Be.a)(l,2),u=s[0],d=s[1];return i.a.createElement("div",{className:r.feed,onClick:e.clickChannel?function(){return e.clickChannel()}:null,style:Object(h.a)(Object(h.a)({},e.clickChannel?{cursor:"pointer"}:{}),{},{position:"relative"})},i.a.createElement("div",{style:{display:"none"}},i.a.createElement("img",{src:o,onError:function(){c(null)},onLoad:function(e){var t=e.target;t&&t.width&&t.height&&(t.width>t.height&&t.width/t.height>1.75?d({backgroundSize:"contain"}):d({backgroundSize:"cover"}))}})),i.a.createElement("div",{className:r.image,style:Object(h.a)({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},o?Object(h.a)({backgroundImage:'url("'.concat(o,'")')},u):{background:dt("AvatarBackground")}),onClick:function(){e.clickChannel||window.open(t.link,"_blank")}},!o&&i.a.createElement("div",{style:{marginTop:"calc(-48% - 10px)",display:"flex",justifyContent:"center",alignItems:"center"}},i.a.createElement(kt,{icon:U.a,size:"39px",color:dt("textColor")})),!e.clickChannel&&i.a.createElement("div",{style:{position:"absolute",top:7,right:7}},i.a.createElement(At,{title:lt("$__sendToRadar","*"),color:dt("menu"),icon:"settings_input_antenna",onClick:function(){e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{id:"new",activeModule:"cardEdit",db:"cards",data:{_id:"new",type:"link",name:t.title,description:t.contentSnippet,pubDate:t.isoDate?t.isoDate:t.pubDate,image:t.img,url:t.link}}))},size:"25px"})),i.a.createElement("div",{style:{position:"absolute",bottom:0,left:0,backgroundColor:"rgba(0,0,0,0.5)",padding:"3px 7px",color:"white",fontSize:11}},Ve()(t.isoDate?t.isoDate:t.pubDate).format("DD/MM/YYYY HH:MM"))),i.a.createElement(et,{title:i.a.createElement(i.a.Fragment,null,!e.clickChannel&&i.a.createElement("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",style:{fontSize:"14px",fontWeight:"bold"}},lt("$__clickHereToReadNews",1)))},i.a.createElement("div",{className:r.infos,onClick:function(){e.clickChannel||window.open(t.link,"_blank")}},i.a.createElement("div",{className:r.linkTitle},i.a.createElement("div",{dangerouslySetInnerHTML:{__html:t&&t.title&&Fd()(t.title)?t.title:t.title?Cd()(t.title):""}})),i.a.createElement("div",{dangerouslySetInnerHTML:{__html:t.contentSnippet&&Fd()(t.contentSnippet)?t.contentSnippet:t.contentSnippet?Cd()(t.contentSnippet):""},className:r.linkContent}),i.a.createElement("div",{className:r.feedFooter},i.a.createElement("div",{className:r.feedLink},!e.clickChannel&&i.a.createElement("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",style:{fontSize:"14px",fontWeight:"bold"}},lt("$__readMore",1)))))),i.a.createElement("div",{style:{top:-30}},i.a.createElement(bn,{options:e._tags})))})));var Nd=Object(Ze.a)(wd)((function(e){var t=e.data,r=e.classes;return i.a.createElement("div",{className:r.feed,onClick:e.clickChannel?function(){return e.clickChannel()}:null},i.a.createElement("div",{className:r.image,style:{background:dt("AvatarBackground"),display:"flex",alignItems:"center",justifyContent:"center"}},i.a.createElement("div",{style:{marginTop:"calc(-48% + 0px)",display:"flex",justifyContent:"center",alignItems:"center"}},i.a.createElement(kt,{icon:U.a,size:"47px",color:"rgba(250,250,250,0.77)"}))),i.a.createElement("div",{className:r.infos},i.a.createElement("div",{className:r.linkTitle},lt("$__attention")),i.a.createElement("div",{className:r.linkContent},lt("$__weHaveNotFoundYetLink")),i.a.createElement("div",{className:r.feedFooter},i.a.createElement("div",{className:r.feedDate},Ve()(t.created_at&&t.created_at.low?t.created_at.low:t.created_at).format("DD/MM/YYYY HH:MM")))))}));function Pd(){Pd=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Dd=Object($e.b)((function(e){return{store:e}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(wd)((function(e){var t=De.getState(),r=t.db,n=t.session,a=e.data,o=xt(),c=window.location.hash.split("/");if(c[0]=c[0].replace("#",""),!a)return null;var l=function(){var t=Object(Me.a)(Pd().mark((function t(o){var i,l;return Pd().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=c[0]&&36===c[0].length?a._parent[c[0]].idRel:a._parent[n.account].idRel,a._parent&&1===Object.keys(a._parent).length&&0===Object.keys(a._parent).filter((function(e){return De.getState().db.cards[e]})).length&&a._parent[Object.keys(a._parent)[0]].idRel&&(i=a._parent[Object.keys(a._parent)[0]].idRel),t.next=4,ot.put("/rel/update",{_id:i,customTitle:o});case 4:t.sent,l=De.getState().db.feeds,a._parent&&1===Object.keys(a._parent).length&&0===Object.keys(a._parent).filter((function(e){return De.getState().db.cards[e]})).length&&a._parent[Object.keys(a._parent)[0]].idRel?l[a._id]=Object(h.a)(Object(h.a)({},l[a._id]),{},{_parent:Object(h.a)(Object(h.a)({},l[a._id]._parent),{},Object(O.a)({},Object.keys(a._parent)[0],Object(h.a)(Object(h.a)({},l[a._id]._parent[Object.keys(a._parent)[0]]),{},{customTitle:o})))}):l[a._id]=Object(h.a)(Object(h.a)({},l[a._id]),{},{_parent:Object(h.a)(Object(h.a)({},l[a._id]._parent),{},Object(O.a)({},c[0],Object(h.a)(Object(h.a)({},l[a._id]._parent[c[0]]),{},{customTitle:o})))}),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},r),{},{feeds:l})),e.onChange&&e.onChange();case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),u=function(){var e=Object(Me.a)(Pd().mark((function e(t){return Pd().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:ft({message:lt("$__confirmDeleteThis",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){d(t)}});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),d=function(){var t=Object(Me.a)(Pd().mark((function t(n){var o,i;return Pd().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=n||c[0],t.next=3,ot.delete("feed/unfollow/".concat(o,"__").concat(a._id));case 3:t.sent,(i=Object(h.a)({},De.getState().db.feeds))[a._id]&&i[a._id]._parent&&i[a._id]._parent[o]&&delete i[a._id]._parent[o],n&&i[a._id]&&delete i[a._id],e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},r),{},{feeds:Object(h.a)({},i)})),e.onChange&&setTimeout((function(){e.onChange()}),400);case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),p=function(){var t=Object(Me.a)(Pd().mark((function t(n){var o,i=arguments;return Pd().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i.length>1&&void 0!==i[1]&&i[1],t.next=3,ot.put("feed/visible/",{feedId:a._id,visible:!a||!a.hide});case 3:t.sent,o=a,o=Object(h.a)(Object(h.a)({},o),{},{hide:!a||!a.hide}),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},r),{},{feeds:Object(h.a)(Object(h.a)({},r.feeds),{},Object(O.a)({},a._id,Object(h.a)(Object(h.a)({},r.feeds[a._id]),o)))}));case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return a._parent&&Object.keys(a._parent).map((function(e){c[0]&&36===c[0].length&&c[0]===e?a.customTitle=a._parent[e].customTitle:Object.keys(a._parent).length>0&&(a.customTitle=a._parent[Object.keys(a._parent)[0]].customTitle)})),i.a.createElement("div",{style:{position:"relative",height:"auto",cursor:"pointer",width:"100%"}},i.a.createElement(Fa,Object.assign({title:a.customTitle?a.customTitle:a.name,icon:"chrome_reader_mode",fontSize:"20px",onEdit:function(e,t){return l(e)},color:dt("color"),editable:!!(c[0]&&36===c[0].length&&o&&o.plan&&(o.planAdmin||o.planModerate)||a._parent&&1===Object.keys(a._parent).length&&0===Object.keys(a._parent).filter((function(e){return De.getState().db.cards[e]})).length),moreButton:!0},c[0]&&"tab"===c[0]&&o&&o.plan&&(o.planAdmin||o.planModerate)?Object(h.a)({},a._parent&&Object.keys(a._parent).length>0&&{options:[{name:a.hide?lt("$__folowRSS"):lt("$__hideRSS"),icon:a.hide?"visibility":"visibility_off",onClick:function(){p()}}].concat(Object(f.a)(o&&o.feed&&(o.feedAdmin||o.feedModerate)?[{name:lt("$__edit"),icon:"settings_suggest",onClick:function(){e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{db:"feeds",id:a._id,module:"feedEdit",activeModule:"feedEdit",data:Object(h.a)(Object(h.a)({},a),{},{_lock:!0,_admin:!!e.admin})}))}}]:[]),Object(f.a)(function(){if(e.data._parent){var t=[];return Object.keys(e.data._parent).map((function(a){if(De.getState().db.cards[a]&&De.getState().db.cards[a]._users&&De.getState().db.cards[a]._users[n._id]){var o=De.getState().db.cards[a];t=[].concat(Object(f.a)(t),[{name:o.name,icon:"view_comfy",render:i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{marginRight:"10px",width:"100%",display:"flex",color:dt("color")}},i.a.createElement("div",{style:{width:"33px"}},i.a.createElement(Qr,{overlap:"rectangular",icon:o.type&&r&&r.dataType?r.dataType.filter((function(e){return e.name===o.type}))[0].icon:"topic",title:"$__".concat(o.type),size:"22px",color:dt("menu")})),i.a.createElement("div",{style:{width:"calc(100% - 7px)",display:"flex",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"}},o.name))),onClick:function(){s.push("sp#".concat(a,"/bright-and-connected"))}}])}else 1===Object.keys(e.data._parent).length&&(t=[].concat(Object(f.a)(t),[{name:lt("$__globalAccount"),icon:"rss_feed",render:i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{marginRight:"10px",width:"100%",display:"flex"}},i.a.createElement("div",{style:{width:"33px"}},i.a.createElement(Qr,{overlap:"rectangular",icon:"rss_feed",title:lt("$__globalAccount"),size:"22px",color:dt("menu")})),i.a.createElement("div",{style:{width:"calc(100% - 7px)",display:"flex",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"}},lt("$__globalAccount}")),i.a.createElement("div",{style:{width:"16px"}},i.a.createElement(Qr,{overlap:"rectangular",icon:"delete_forever",title:lt("$__delete"),size:"22px",color:"red",onClick:function(){u(a)}})))),onClick:function(){u(a)}}]))})),t}}()))}):o&&o.plan&&(o.planAdmin||o.planModerate)?{options:[{name:lt("$__deleteRSS"),icon:"delete_forever",onClick:function(){u()}}]}:{})),i.a.createElement("div",{style:{padding:"0",display:"flex",marginBottom:"15px",flexFlow:"wrap",marginTop:"15px"}},a.feed&&Object.keys(a.feed).length>0?Object.keys(a.feed).sort((function(e,t){return a.feed[e].isoDate&&a.feed[t].isoDate&&a.feed[e].isoDate<a.feed[t].isoDate?1:-1})).map((function(e,t){var r=a.feed[e],n=kd.a.MD5(r.link);if(a&&0===t)return i.a.createElement(Td,{key:n,data:r,_tags:a._tags,clickChannel:function(){s.push("".concat(window.location.pathname).concat(window.location.hash,"/").concat(a._id))}})})):i.a.createElement(Nd,{data:a,clickChannel:function(){s.push("".concat(window.location.pathname).concat(window.location.hash,"/").concat(a._id))}})))})));function Ad(){Ad=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var $d=Object($e.b)((function(e){return{}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=e.data,r=De.getState().db,n=i.a.useState(0),a=Object(Be.a)(n,2),o=a[0],c=a[1],l=i.a.useState(0),s=Object(Be.a)(l,2),u=s[0],d=s[1],p=i.a.useState(21),f=Object(Be.a)(p,2),m=f[0],g=f[1],v=i.a.useState([]),y=Object(Be.a)(v,2),b=y[0],x=y[1],_=i.a.useState([]),w=Object(Be.a)(_,2),E=w[0],j=w[1],S=i.a.useState(0),k=Object(Be.a)(S,2),L=(k[0],k[1]),C=i.a.useState(!0),I=Object(Be.a)(C,2),F=I[0],T=I[1],N=i.a.useState(!1),P=Object(Be.a)(N,2),D=P[0],A=P[1];i.a.useEffect((function(){var t=window.location.hash.split("/");return t[0]=t[0].replace("#",""),JSON.stringify(t)!==JSON.stringify(b)&&x(t),T(!0),e.max&&(L(e.max),g(e.max)),function(){}}),[]),i.a.useEffect((function(){b.length>0&&!D&&($(o,m),b[2]&&36!==b[2].length&&T(!0),A(!0))}),[b]),i.a.useEffect((function(){u>Object.keys(E).length&&(T(!0),$(o,m))}),[o,m]),i.a.useEffect((function(){T(!1)}),[E]);var $=function(){var e=Object(Me.a)(Ad().mark((function e(t,r){var n,a;return Ad().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(0===u||u>Object.keys(E).length)){e.next=9;break}return T(!0),e.next=4,Sn.post("/Feed_Links",{ids:b[2]&&b[2].length?b[2]:null,skip:t*r,limit:r});case 4:n=e.sent,a=Array.from(E),n&&n.data&&n.data.links&&n.data.links.map((function(e){0===a.filter((function(t){return t.link===e.link})).length&&a.push(e)})),n.data&&n.data.total&&0===u&&d(n.data.total),j(a);case 9:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),z=function(){var n=Object(Me.a)(Ad().mark((function n(a){var o;return Ad().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,ot.put("/rel/update",{_id:t.idRel,customTitle:a});case 2:n.sent,(o=r.cards[b[0].replace("#","")]._feeds)[t._id]=Object(h.a)(Object(h.a)({},o[t._id]),{},{customTitle:a}),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},r),{},{cards:Object(h.a)(Object(h.a)({},r.cards),{},Object(O.a)({},b[0].replace("#",""),Object(h.a)(Object(h.a)({},r.cards[b[0].replace("#","")]),{},{_feeds:o})))}));case 6:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}(),M=function(){var n=Object(Me.a)(Ad().mark((function n(a){var o,i;return Ad().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return window.history.back(),o=a.replace("#",""),n.next=4,ot.delete("feed/unfollow/".concat(o,"__").concat(t._id));case 4:n.sent,delete(i=r.cards[o]._feeds)[t._id],e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},r),{},{cards:Object(h.a)(Object(h.a)({},r.cards),{},Object(O.a)({},o,Object(h.a)(Object(h.a)({},r.cards[o]),{},{_feeds:i})))}));case 8:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}(),B=function(){for(var e=[],t=0;t<m;t++)e.push(i.a.createElement(xo,{xs:12,sm:6,md:4,lg:3,xl:2,key:"sk_".concat(t)},i.a.createElement(Ed,null)));return i.a.createElement(i.a.Fragment,null,e)};return i.a.createElement("div",null,t&&(t.customTitle||t.name)&&i.a.createElement("div",{style:{position:"absolute",top:0,left:0,right:0,height:33}},i.a.createElement("div",{style:{position:"relative",width:"100%",float:"left",marginBottom:"15px",display:"flex"}},i.a.createElement(rn,{icon:"undo",text:lt("$__back","*"),onClick:function(){return window.history.back()}}),b[0]&&"bright-and-connected"===b[1]&&b[2]&&i.a.createElement(rn,{icon:"delete_sweep",text:lt("$__removeChannel","*"),onClick:function(){ft({message:lt("$__confirmRemoveChannel",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){M(b[0])}})}})),i.a.createElement(Io,{title:"".concat(t.customTitle?t.customTitle:t.name),icon:"chrome_reader_mode",fontSize:"20px",onEdit:function(e,t){return z(e)},editable:!0})),i.a.createElement("div",{style:Object(h.a)(Object(h.a)({},e.horizontal?{position:"relative",width:"100%"}:{position:"absolute",top:t&&(t.customTitle||t.name)?50:0,left:0,right:0,bottom:0}),{},{padding:"0px 15px",overflow:"auto"}),id:"linkList",onScroll:function(t){!function(t){var r=document.getElementById("linkList");!F&&r.scrollTop+window.innerHeight+400>r.scrollHeight&&!e.horizontal&&c(o+1)}()}},i.a.createElement(vo,{style:Object(h.a)({},e.horizontal?{overflowX:"auto",flexFlow:"row",display:"-webkit-inline-box"}:{})},u>0&&E.filter((function(t,r){return!e.max||e.max&&r<e.max})).sort((function(e,t){return e.isoDate&&t.isoDate&&e.isoDate<t.isoDate?1:e.isoDate&&t.isoDate&&e.isoDate>t.isoDate?-1:0})).map((function(e){return i.a.createElement(xo,{key:e._id,xs:12,sm:6,md:4,lg:3,xl:2},i.a.createElement(Td,{db:"cards",data:e}))})),F?i.a.createElement(B,null):i.a.createElement(i.a.Fragment,null))))})),zd=function(e){return{}};function Md(){Md=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Bd=Object($e.b)((function(e,t){return{store:{feeds:e.db.feeds}}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(zd)((function(e){var t,r=De.getState(),n=r.search,a=r.session,o=i.a.useState(!0),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.useState({}),d=Object(Be.a)(u,2),p=d[0],f=d[1],m=window.location.hash.split("/");m[0]=m[0].replace("#",""),i.a.useEffect((function(){v()}),[e.store.feeds]),i.a.useEffect((function(){g()}),[]);var g=function(){var t=Object(Me.a)(Md().mark((function t(){return Md().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s(!0),"hideFeeds"!==m[1]){t.next=8;break}return t.next=4,hu(Object(h.a)(Object(h.a)({},e),{},{fnIdentification:"Views/BrightAndConnected/Feeds -- iniFeeds()"}),{showHidden:!0});case 4:t.sent&&v(),t.next=16;break;case 8:if(0!==Object.keys(De.getState().db.feeds).filter((function(e){return!De.getState().db.feeds[e].hide})).length){t.next=15;break}return t.next=11,hu(Object(h.a)(Object(h.a)({},e),{},{fnIdentification:"Views/BrightAndConnected/Feeds -- iniFeeds()"}));case 11:t.sent&&v(),t.next=16;break;case 15:v();case 16:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),v=function(){var e={};Object.keys(De.getState().db.feeds).length>0&&(e=Object(h.a)(Object(h.a)({},e),De.getState().db.feeds));var t={};Object.keys(e).filter((function(t){return e[t]&&e[t].name&&e[t].name.toLowerCase().indexOf(n.text.toLowerCase())>-1||e[t].customTitle&&e[t].customTitle.toLowerCase().indexOf(n.text.toLowerCase())>-1||e[t].customDescription&&e[t].customDescription.toLowerCase().indexOf(n.text.toLowerCase())>-1})).map((function(r){(Object.keys(n.plans.selected).length>0&&Object.keys(n.plans.selected).map((function(t){return n.plans.selected[t]&&e[r]._parent[t]})).length>0||0===Object.keys(n.plans.selected).length)&&(t=Object(h.a)(Object(h.a)({},t),{},Object(O.a)({},r,e[r])))})),f(t),s(!1)};return l?i.a.createElement("div",{style:{position:"absolute",top:"0px",bottom:0,left:0,right:0}},i.a.createElement(Fo,null)):m[2]&&36===m[2].length?i.a.createElement("div",null,i.a.createElement($d,{follow:!0})):i.a.createElement("div",{style:(t={width:"100%"},Object(O.a)(t,"width","calc(100% - 20px)"),Object(O.a)(t,"position","relative"),Object(O.a)(t,"display","flex"),t)},i.a.createElement(vo,null,p&&Object.keys(p).length>0&&Object.keys(p).filter((function(t){if(36===m[0].length&&De.getState().db.cards[m[0]]&&p[t]._parent&&Object.keys(p[t]._parent).length>0&&p[t]._parent[m[0]])return!0;if("tab"===m[0]){var r=!1;if(p[t].hide&&(r=!0),!e.showHidden&&!r)return!0;if(e.showHidden&&r)return!0}})).sort((function(e,t){var r=p[e].customTitle?p[e].customTitle.toLowerCase().trim():p[e].name.toLowerCase().trim(),n=p[t].customTitle?p[t].customTitle.toLowerCase().trim():p[t].name.toLowerCase().trim();return m[0]&&36!==m[0].length&&(a&&a.account&&p[e]._parent&&p[e]._parent[a.account]&&p[e]._parent[a.account].customTitle&&(r=p[e]._parent[a.account].customTitle.toLowerCase().trim()),a&&a.account&&p[t]._parent&&p[t]._parent[a.account]&&p[t]._parent[a.account].customTitle&&(n=p[t]._parent[a.account].customTitle.toLowerCase().trim())),r<n?-1:r>n?1:0})).map((function(e,t){var r=p[e];return i.a.createElement(xo,{xs:12,sm:6,md:4,lg:3,xl:2,key:e},i.a.createElement(Dd,{data:r,follow:!0,onChange:function(){v()}}))}))))}))),Yd={control:{backgroundColor:"#fff",fontSize:14,fontFamily:"Roboto",fontWeight:"normal",lineHeight:"17px"},"&multiLine":{control:{fontFamily:"Roboto"},highlighter:{padding:9,border:"1px solid transparent",boxSizing:"border-box",overflow:"hidden",maxHeight:150},input:{padding:9,border:"1px solid silver",overflow:"auto",maxHeight:150,borderColor:"transparent"}},"&singleLine":{display:"inline-block",width:180,lineHeight:"17px",highlighter:{lineHeight:"17px",padding:1,border:"2px inset transparent"},input:Object(O.a)({border:"none",lineHeight:"17px",padding:1},"border","2px inset")},suggestions:{position:"absolute",bottom:"100%",top:"none",left:"33px",maxHeight:"217px !important",overflow:"auto !important",list:{position:"absolute",width:"300px",backgroundColor:"white",border:"1px solid rgba(0,0,0,0.15)",borderRadius:"7px 7px",boxShadow:"0 0 3px 5px rgba(0,0,0,0.09)",fontSize:14,maxHeight:"217px",overflow:"auto"},item:{padding:"5px 15px",borderBottom:"1px solid rgba(0,0,0,0.15)","&focused":{backgroundColor:dt("color")}}}},Gd=function(e){var t,r,n;return{root:{position:"absolute",top:0,left:0,right:0,bottom:0},rootRelative:{position:"relative",top:0,left:0,right:0,bottom:0},content:{position:"absolute",top:0,left:0,right:0,bottom:0,overflowY:"auto",backgroundColor:"rgba(249,249,249,1)"},timeline:{listStyle:"none",padding:0,position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",width:"100%","& .file-drop-target":{width:"100%",display:"flex",position:"absolute",bottom:0,left:0,right:0,height:"auto"}},scrollEnd:{marginTop:"160px",position:"relative",width:"100%",height:0,marginBottom:"-100px"},timelineSimple:{position:"relative",overflow:"hidden",padding:0,width:"-webkit-fill-available","&:before":{left:"15px"}},item:{marginBottom:"5px",position:"relative",width:"calc(100% - 15px)","&:before,&:after":{content:'" "',display:"table"},"&:after":{clear:"both"}},timelineBadge:(t={},Object(O.a)(t,e.breakpoints.down("sm"),{left:"30px !important"}),Object(O.a)(t,"color","#FFF"),Object(O.a)(t,"width","30px"),Object(O.a)(t,"height","30px"),Object(O.a)(t,"lineHeight","25px"),Object(O.a)(t,"fontSize","12px"),Object(O.a)(t,"textAlign","center"),Object(O.a)(t,"position","absolute"),Object(O.a)(t,"bottom","23px"),Object(O.a)(t,"left","50%"),Object(O.a)(t,"marginLeft","-24px"),Object(O.a)(t,"zIndex","1"),Object(O.a)(t,"borderTopRightRadius","50%"),Object(O.a)(t,"borderTopLeftRadius","50%"),Object(O.a)(t,"borderBottomRightRadius","50%"),Object(O.a)(t,"borderBottomLeftRadius","50%"),Object(O.a)(t,"display","flex"),Object(O.a)(t,"alignItems","center"),Object(O.a)(t,"justifyContent","center"),t),timelineSimpleBadge:{left:"30px"},custom:{backgroundColor:dt("color"),boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt("#000")+", 0.4)"},info:{backgroundColor:cr[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(cr[0])+", 0.4)"},success:{backgroundColor:ir[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(ir[0])+", 0.4)"},danger:{backgroundColor:or[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(or[0])+", 0.4)"},warning:{backgroundColor:ar[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(ar[0])+", 0.4)"},primary:{backgroundColor:nr[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(nr[0])+", 0.4)"},badgeIcon:{width:"14px",height:"14px"},timelinePanel:(r={},Object(O.a)(r,e.breakpoints.down("sm"),{float:"right !important",width:"calc(100% - 60px) !important","&:before":{borderLeftWidth:"0 !important",borderRightWidth:"15px !important",left:"-20px !important",right:"auto !important"},"&:after":{borderLeftWidth:"0 !important",borderRightWidth:"14px !important",left:"-19px !important",right:"auto !important"}}),Object(O.a)(r,"width","45%"),Object(O.a)(r,"float","left"),Object(O.a)(r,"padding","7px"),Object(O.a)(r,"marginBottom","5px"),Object(O.a)(r,"position","relative"),Object(O.a)(r,"boxShadow","0 1px 4px 0 rgba("+Zt("#000")+", 0.14)"),Object(O.a)(r,"borderRadius","6px"),Object(O.a)(r,"color","rgba("+Zt("#000")+", 0.87)"),Object(O.a)(r,"background","#FFF"),Object(O.a)(r,"&:before",{position:"absolute",bottom:"16px",right:"-15px",display:"inline-block",borderTop:"15px solid transparent",borderLeft:"15px solid "+sr[10],borderRight:"0 solid "+sr[10],borderBottom:"15px solid transparent",content:'" "'}),Object(O.a)(r,"&:after",{position:"absolute",bottom:"16px",right:"-14px",display:"inline-block",borderTop:"14px solid transparent",borderLeft:"14px solid #FFF",borderRight:"0 solid #FFF",borderBottom:"14px solid transparent",content:'" "'}),r),timelineSimplePanel:{width:"calc(100% - 60px)"},timelinePanelInverted:Object(O.a)({},e.breakpoints.up("sm"),{float:"right",backgroundColor:"#FFF","&:before":{borderLeftWidth:0,borderRightWidth:"15px",left:"-15px",right:"auto"},"&:after":{borderLeftWidth:0,borderRightWidth:"14px",left:"-14px",right:"auto"}}),timelineHeading:{marginBottom:0},timelineBody:{fontSize:"12px",lineHeight:"21px"},timelineFooter:{zIndex:"1",position:"relative",float:"left",width:"100%",display:"inline-flex",justifyContent:"space-between"},footerUser:{display:"flex",alignItems:"center",fontSize:"12px",fontWeight:"bold",color:dt("medium")},footerLine:{position:"relative",marginTop:"10px",marginBottom:"5px"},dropFile:{display:"none"},onDropFile:Object(O.a)({position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:"5",display:"flex",alignItems:"center",justifyContent:"center",color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.77)"},"zIndex",11),editor:{position:"absolute",bottom:0,height:"auto",width:"calc(100% - 0px)"},editorRelative:{position:"relative",bottom:0,minHeight:"50px",height:"auto",width:"calc(100% - 0px)",zIndex:10},files:{display:"inline-table",position:"relative",backgroundColor:"rgba(250,250,250,0.9)",width:"100%"},textEditor:{},textEditorIcon:{cursor:"pointer",color:dt("color")},progressBar:{backgroundColor:"".concat(dt("color","0.1")," !important"),"& .MuiLinearProgress-indeterminate":{backgroundColor:"".concat(dt("color")," !important")},"& .MuiLinearProgress-bar":{backgroundColor:"".concat(dt("color")," !important")}},actionButton:{alignItems:"center",cursor:"pointer",float:"left",height:"20px",position:"relative",textAlign:"center",width:"30px"},sendingMessage:{width:"100%"},valuePositive:{positive:"relative",float:"left",color:"blue"},valueNegative:{positive:"relative",float:"left",color:"red"},lastValue:{positive:"relative",float:"right",color:"grey"},timeInfo:{display:"flex",alignItems:"center",color:"grey",width:"100%",position:"relative",float:"left",marginBottom:"7px","& .text":{marginLeft:"7px"}},urlPreview:{position:"absolute",width:"100%",top:"-90px",maxHeight:"120px",background:"linear-gradient(60deg, rgba(250,250,250,1), rgba(250,250,250,0.9))",padding:"7px",display:"flex",overflow:"auto",alignItems:"center","& img":{maxWidth:"20%",height:"auto",position:"relative",float:"left",marginTop:0,marginRight:"7px"},"& .data":{position:"relative",float:"left",width:"75%","& .title":{fontSize:"16px",fontWeight:"bold"},"& .siteName":{fontSize:"14px",fontWeight:"bold",color:"#909090"},"& .contentSnippet":{fontSize:"12px",color:"#909090"}}},mentionInput:Object(h.a)(Object(h.a)({},rr),{},{"& textarea":Object(h.a)(Object(h.a)({},rr),{},{padding:"7px",borderRadius:"7px",fontSize:"16px",width:"calc(100% - 14px)",minHeight:"38px",border:"solid 1px rgba(0,0,0,0.1)"}),"& .sugestions":{top:"none !important",bottom:"40px",border:"solid 10px red"},"& textarea::placeholder":{color:"rgba(0,0,0,0.2)"}}),mentionWrapper:{width:"100%",background:"transparent",fontSize:"0.9rem",color:" #a9b5c4","&&.mentionWrapper__control":{borderRadius:"25px",border:"1px solid #3a546f",minHeight:"45px","&& .mentionWrapper__highlighter":{padding:"0.7rem 1rem"},"&& .mentionWrapper__input":(n={padding:"0.7rem 1rem",outline:0,border:0,resize:"none"},Object(O.a)(n,"outline","none"),Object(O.a)(n,"fontSize","0.9rem"),Object(O.a)(n,"color","#7288a3"),Object(O.a)(n,"borderColor"," #3a546f"),Object(O.a)(n,"overflow","hidden"),Object(O.a)(n,"&& :: placeholder",{color:"#7288a3"}),n)}}}};function Rd(){Rd=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Hd=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Gd)((function(e){var t=De.getState(),r=t.db,n=t.session,a=(t.chat,e.classes),o=De.getState().functions.socket,c=i.a.useState(!1),l=Object(Be.a)(c,2),s=l[0],u=l[1],d=i.a.useState(""),p=Object(Be.a)(d,2),m=p[0],g=p[1],v=i.a.useState(!1),y=Object(Be.a)(v,2),b=y[0],x=y[1],_=i.a.useState(!1),w=Object(Be.a)(_,2),E=w[0],O=w[1],j=i.a.useState([]),S=Object(Be.a)(j,2),k=S[0],L=S[1],C=i.a.useState([]),I=Object(Be.a)(C,2),F=I[0],T=I[1],N=i.a.useState(null),P=Object(Be.a)(N,2),D=P[0],A=P[1],$=i.a.useState(!1),z=Object(Be.a)($,2),M=z[0],B=z[1],Y=i.a.useState([]),G=Object(Be.a)(Y,2),R=G[0],H=G[1],W=i.a.useState(!1),U=Object(Be.a)(W,2),V=U[0],q=U[1],X=i.a.createRef(),J=i.a.createRef(),K=xt(),Z=0;n._id&&r.cards[e.nodeId]&&r.users&&r.users[Object.keys(r.users).find((function(e){return e.indexOf(n._id)>-1}))]&&(Z=r.users[Object.keys(r.users).find((function(e){return e.indexOf(n._id)>-1}))]);var Q=window.location.hash.split("/");Q[0]=Q[0].replace("#",""),i.a.useEffect((function(){s||u(!0)}));var ee=function(){var e,t=[];if(e=m){var r=e.split("@[");r.length>0&&r.map((function(e){if(e){"@[".concat(e.split(")")[0],")");var r=e.split("](")[1];r&&(r=r.split(")")[0])&&36===r.length&&t.push(r)}}))}return t},te=function(){var t=Object(Me.a)(Rd().mark((function t(){var a,i,c;return Rd().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:q(!1),x(!0),a=[],i=ee(),console.log(e),c={_id:Object(Pn.a)(),idRel:e.nodeId,replyData:e.replyData?e.replyData:{},reply:e.replyData?e.replyData._id:null,message:m,type:"comment",mentions:ee(),notifyUsers:a,filesCount:k.length>0?k.length:0,_parent:e.nodeId,_client:r.cards[e.nodeId]&&r.cards[e.nodeId].client?r.cards[e.nodeId].client:null},D&&(c=Object(h.a)(Object(h.a)({},c),{},{urlPreview:JSON.stringify(D)})),so(e,Object(h.a)(Object(h.a)({},c),{},{user:Object(h.a)({},r.users[n._id]),files:{}})),o.emit("data",{module:"timeline",method:"post",action:"add"},c,(function(t){if(console.log(t),t._id)if(k.length>0)re(t);else{e.onSending&&e.onSending();var n=Object(h.a)(Object(h.a)({},t),{},{_parent:e.nodeId,_client:r.cards[e.nodeId]&&r.cards[e.nodeId].client?r.cards[e.nodeId].client:null});D&&(n=Object(h.a)(Object(h.a)({},n),{},{urlPreview:JSON.stringify(D)})),i.map(function(){var t=Object(Me.a)(Rd().mark((function t(n){return Rd().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!r.cards[e.nodeId]||r.users&&(!r.users||r.users[n])){t.next=3;break}return t.next=3,ao(e,n,2,e.nodeId,!0);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),T([]),L([]),H([]),g(""),A(null),x(!1),e.onSending&&e.onSending()}})),g(""),A(null);case 11:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),re=function(){var t=Object(Me.a)(Rd().mark((function t(r){var n;return Rd().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=Array.from(k),t.next=3,Promise.all(n.map(function(){var e=Object(Me.a)(Rd().mark((function e(t,n){var a;return Rd().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T([].concat(Object(f.a)(F),[t])),e.next=3,Ln(r._id,t,!0);case 3:return a=e.sent,e.abrupt("return",a);case 5:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}())).then((function(t){e.onSending&&e.onSending(),r.files=t,r._parent=e.nodeId,o.emit("timeline.COMMENT",{node:e.nodeId,comment:r,db:e.db?e.db:"cards"},(function(e){})),T([]),L([]),g(""),A(null),x(!1),e.onSending&&e.onSending()}));case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),ne=function(){var e=Object(Me.a)(Rd().mark((function e(t){return Rd().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:L([].concat(Object(f.a)(k),Object(f.a)(Object.keys(t).map((function(e){return t[e]}))))),O(!1);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ae=function(){var e=Object(Me.a)(Rd().mark((function e(t){var r,n,a,i;return Rd().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(g(t),!t||!(t.indexOf("http://")>-1||t.indexOf("https://")>-1)){e.next=9;break}return r="",n=[],t.indexOf(" ")>-1?n=t.split(" "):t.indexOf("\n")>-1?n=t.split("\n"):n.push(t),a=new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i"),e.next=8,n.map((function(e){(e.indexOf("http://")>-1||e.indexOf("https://")>-1)&&a.test(e)&&(r=e)}));case 8:if(!D&&r&&-1===R.indexOf(r)||r&&D&&-1===R.indexOf(r)&&D.link!==r){B(!0);try{o.emit("data",{module:"link",method:"post",action:"exist"},{idRel:Q[0],url:r},(function(e){A(e),B(!1)}))}catch(c){B(!1),(i=R).push(r),H(i),console.log(c)}}case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),oe=[];return r.cards[e.nodeId]&&r.users&&Object.keys(r.users).map((function(e){if(e&&null!==e&&void 0!==e&&e!==n._id&&r.users[e].name&&r.users[e]&&!r.users[e].deleted){var t=r.users[e]._id,a=r.users[e].name?r.users[e].name:r.users[e].name.split(" ").length>0?r.users[e].name.split(" ")[0]:r.users[e].name;t&&0===Object.keys(oe).filter((function(e){return oe[e].id===t})).length&&oe.push({id:t,display:a})}})),(K&&(K.owner||K.planAdmin||K.planModerate)||Z&&Z.access&&parseInt(Z.access)>3)&&Object.keys(r.users).filter((function(e){return!r.users[e].deleted&&"client"!==r.users[e].type&&"group"!==r.users[e].type&&"account"!==r.users[e].type&&!r.users[e]._parent})).map((function(t){t&&null!==t&&void 0!==t&&t!==n._id&&0===Object.keys(oe).filter((function(e){if(oe[e].id===t)return!0})).length&&oe.push({id:t,display:e.nodeId&&r.cards[e.nodeId]&&r.users&&r.users[t]&&r.users[t].name?r.users[t].name:r.users[t].displayName?r.users[t].displayName:r.users[t].name})})),i.a.createElement(Aa.FileDrop,{ref:X,className:e.relative?a.rootRelative:a.root,onDragOver:function(){!e.disabledSend&&O(!0)},onClick:function(){J&&J.current&&J.current.focus()},onDrop:ne,accept:".png, .jpg, .jpeg, .bpm, .svg, .gif, .pdf, .mp4, .3gp, .ts, .mkv, .avi, .mov, .mts, m2ts, .mxf, .aac, aiff, .caf, .ogg, .mp3, .wav, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .txt, .zip, .rar"},i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:e.relative?a.editorRelative:a.editor,style:e.editorStyle?e.editorStyle:{},onClick:function(){J&&J.current&&J.current.focus()}},i.a.createElement("div",{className:a.files},k&&k.length>0&&k.map((function(t,r){var n=t.name.split("."),a="attachment";return e.store.db.fileExtensions.filter((function(e){return e.ext.indexOf(n[n.length-1].toLowerCase())>-1})).length>0&&(a=e.store.db.fileExtensions.filter((function(e){return e.ext.indexOf(n[n.length-1].toLowerCase())>-1}))[0].icon||URL.createObjectURL(t)),i.a.createElement("div",{key:r,style:{position:"relative",float:"left",width:"100%",display:"flex",alignItems:"center",marginBottom:"5px"}},i.a.createElement("div",{style:{position:"relative",float:"left",width:"50px",height:"50px",marginRight:"7px",overflow:"hidden"}},"string"===typeof a&&-1===a.indexOf("blob:")&&-1===a.indexOf("svg")?i.a.createElement(kt,{icon:a,size:"50px"}):i.a.createElement("img",{src:a,style:{width:"100%",height:"100%"}})),F.length>0&&F[r]&&F[r].name===t.name?i.a.createElement(kt,{icon:"cloud_done",color:"green"}):b?i.a.createElement(i.a.Fragment,null):i.a.createElement(kt,{icon:"delete_forever",color:"red",onClick:function(){return function(e){var t=Array.from(k);t.splice(e,1),L(t)}(r)}}),t.name)}))),i.a.createElement("div",{className:a.textEditor},M&&!D&&i.a.createElement("div",{className:a.urlPreview,style:{width:"100%",height:"150px"}},i.a.createElement("div",{style:{display:"flex"}},i.a.createElement("div",{style:{marginLeft:"7px",width:"200px",height:"110px",maxWidth:"50%"}},i.a.createElement(Ra.a,{variant:"rect",style:{width:"200px",height:"110px",maxWidth:"100%"}})),i.a.createElement("div",{style:{marginLeft:"7px",width:"100%",height:"25px"}},i.a.createElement(Ra.a,{variant:"text",height:25,style:{marginBottom:"7px"}}),i.a.createElement(Ra.a,{variant:"text",height:10}),i.a.createElement(Ra.a,{variant:"text",height:10}),i.a.createElement(Ra.a,{variant:"text",height:10}),i.a.createElement(Ra.a,{variant:"text",height:10}),i.a.createElement(Ra.a,{variant:"text",height:10}),i.a.createElement(Ra.a,{variant:"text",height:10})))),D&&i.a.createElement("div",{className:a.urlPreview},i.a.createElement("img",{src:"".concat(D.img?D.img:on.a),onError:function(e){e.target.src=on.a},alt:D.title}),i.a.createElement("div",{className:"data"},i.a.createElement("div",{className:"title"},D.title),D.site&&i.a.createElement("div",{className:"siteName"},D.site),D.contentSnippet&&i.a.createElement("div",{className:"contentSnippet"},D.contentSnippet)),i.a.createElement(Ya,{title:lt("$__removeLink",1),icon:"delete_forever",color:"red",onClick:function(){return A(null)}})),b?i.a.createElement("div",{className:a.sendingMessage},lt("$__sending",1),i.a.createElement(Ga.a,{className:a.progressBar})):i.a.createElement("div",{style:{position:"relative",height:"auto",backgroundColor:"#ffffff",border:"solid 1px rgba(0,0,0,0.05)",display:"flex",alignItems:"center",zIndex:1}},i.a.createElement($a.b,{ref:J,value:m,onChange:function(e){ae(e.target.value)},onPaste:function(e){ne(e.clipboardData.files)},placeholder:e.placeholder?e.placeholder:lt("$__writeMessage"),style:Object(h.a)(Object(h.a)({},Yd),{},{position:"relative",width:"calc(100% - 130px)",paddingRight:"7px",background:"none",border:"none",overflow:"auto !important"}),onKeyDown:function(e){13==e.keyCode&&(e.shiftKey?e.stopPropagation():m.trim()&&te())},placement:"top",forceSuggestionsAboveCursor:!0,autosize:{minRows:1,maxRows:6}},i.a.createElement($a.a,{trigger:"@",data:oe,renderSuggestion:function(e,t,n){if(e&&e.id)return i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},i.a.createElement(nn.a,{style:{width:"25px",height:"25px",marginRight:"7px"},alt:n,src:r.users[e.id]&&r.users[e.id].image||r.users[e.id]&&r.users[e.id].image?r.users[e.id].image:null}),n)}})),i.a.createElement("div",{style:{position:"absolute",right:"0px",bottom:"0px",cursor:"pointer",display:"flex",alignItems:"center"}},i.a.createElement(Ya,{title:lt("$__emojis",1),icon:V?"highlight_off":"sentiment_very_satisfied",color:dt("medium"),onClick:function(){q(!V)}}),!b&&i.a.createElement("div",{className:a.actionButton},i.a.createElement("input",{className:"input-text-timeline",style:{position:"absolute",marginRight:"3em",height:"24px",fontSize:"0",left:"0px",width:"24px",cursor:"pointer",border:"none",opacity:"0"},onChange:function(e){return ne(e.target.files)},multiple:!0,type:"file",accept:".png, .jpg, .jpeg, .bpm, .svg, .gif, .pdf, .mp4, .3gp, .ts, .mkv, .avi, .mov, .mts, m2ts, .mxf, .aac, aiff, .caf, .ogg, .mp3, .wav, .doc, .docx, .xls, .xlsx, .ppt, .pptx"}),i.a.createElement(kt,{icon:"attachment",color:dt("medium"),size:"22px"})),!b&&(m||k.length>0)&&i.a.createElement(Ya,{title:lt("$__pressENTERtoSendorClickHere",1),icon:"send",color:dt("menu"),onClick:function(){return te()}}),e.closeOption&&i.a.createElement(kt,{title:lt("$__pressCRTL+ENTERtoSend",1),icon:"close",color:dt("color"),onClick:function(){return e.onClose()}}),V&&i.a.createElement("div",{style:{position:"absolute",bottom:"44px",right:"40px"}},i.a.createElement(Ma.a,{onEmojiClick:function(e,t){g("".concat(m," ").concat(t.emoji))},groupVisibility:{recently_used:!1}})))))),i.a.createElement("div",{className:E?a.onDropFile:a.dropFile,onDragLeave:function(){!e.disabledSend&&O(!1)}},lt("$__dropTheFileToAttach","*"))))}))),Wd=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(uc)((function(e){var t=e.classes,r=De.getState(),n=r.db,a=r.session,o=r.functions,c=(r.usersStatus,o.socket,i.a.useState(!1)),l=Object(Be.a)(c,2),s=l[0],u=l[1],d=i.a.useState(!1),p=Object(Be.a)(d,2),f=(p[0],p[1]),h=i.a.useState(null),m=Object(Be.a)(h,2),g=(m[0],m[1],i.a.useState(null)),v=Object(Be.a)(g,2),y=(v[0],v[1],null);x&&x._parent&&n.cards[x._parent]?x._parent:x&&x.idRel&&n.cards[x.idRel]&&x.idRel;var b=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];f(!0),e&&clearTimeout(y)},x=e.storie;if(!x)return null;"timer"===x.type&&String(x.ini)&&String(x.fin)&&(x.fin,x.ini);var _=null;x.urlPreview&&(_=JSON.parse(x.urlPreview));var w=function(e){var t,r;if(x&&x._parent&&n.cards[x._parent]?t=x._parent:x&&x.idRel&&n.cards[x.idRel]&&(t=x.idRel),r=e,e){var a=e.split("@[");a.length>0&&a.map((function(e){if(e){var a="@[".concat(e.split(")")[0],")"),o=e.split("](")[1];if(o)if((o=o.split(")")[0])&&36===o.length&&n.cards[t]&&n.cards[t]._users&&n.cards[t]._users[o]){var i=n.cards[t]._users&&n.cards[t]._users[o]&&n.cards[t]._users[o].name||n.cards[t]._users&&n.cards[t]._users[o]&&n.cards[t]._users[o].name?n.cards[t]._users[o].name:e.split("](")[0];r=r.replace(a,'<span style="color:'.concat(dt("menu"),'"><b>').concat(i,"</b></span>"))}else if(o&&36===o.length&&n.users[o]){var c=n.users[o]&&n.users[o].name||n.users[o].name?n.users[o].name:lt("$__hideUser","*");r=r.replace(a,'<span style="color:'.concat(dt("menu"),'"><b>').concat(c,"</b></span>"))}}return!0}))}return r}(x.message);x._reactions&&Object.keys(x._reactions).length>0&&Object.keys(x._reactions).map((function(e){Object.keys(x._reactions[e]).length>0&&Object.keys(x._reactions[e]).map((function(t){t===a._id&&e}))}));var E=!1;e.storie&&e.storie.user&&e.storie.user._id===a._id&&(E=!0);return""===x.message&&x.cardId&&x.cardId!==e.nodeId&&!De.getState().db.cards[x.cardId]?null:i.a.createElement("div",null,i.a.createElement("div",{className:"message",style:{position:"relative",float:"left",width:"100%",marginBottom:"20px",display:"flex",alignItems:"center"},onMouseLeave:function(){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;y=setTimeout((function(){f(!1)}),e)}(1e3)},onMouseOver:function(){e.isReply||b(!0)},onClick:function(){e.isReply||b(!0)}},i.a.createElement("div",{style:{display:"flex"}},i.a.createElement("div",{style:{position:"relative",float:"left",fontSize:"10px",fontWeight:"bold",display:"flex",alignItems:"center",whiteSpace:"nowrap",marginRight:"15px"}},i.a.createElement(sc,{overlap:"circular",anchorOrigin:{vertical:"bottom",horizontal:"right"},userId:x.user._id},i.a.createElement(nn.a,{alt:x.user.displayName?x.user.displayName:x.user.name,src:"".concat(x.user.image),style:{width:"22px",height:"22px"}})),x.user.displayName?x.user.displayName:x.user.name," ",i.a.createElement("span",{style:{fontSize:"10px"}},"(",Ve()(new Date).tz("America/Sao_Paulo").format("DD/MM/YYYY")===Ve()(1e3*x.created_at).tz("America/Sao_Paulo").format("DD/MM/YYYY")?"".concat(Ve()(1e3*x.created_at).tz("America/Sao_Paulo").format("H:mm")):Ve()(new Date).tz("America/Sao_Paulo").format("YYYY")===Ve()(1e3*x.created_at).tz("America/Sao_Paulo").format("YYYY")?"".concat(Ve()(1e3*x.created_at).tz("America/Sao_Paulo").format("DD/MM H:mm")):"".concat(Ve()(1e3*x.created_at).tz("America/Sao_Paulo").format("DD/MM/YYYY H:mm")),")"))),i.a.createElement("div",null,x.files&&Object.keys(x.files).length>0&&i.a.createElement("div",{className:"files",style:{position:"relative",display:"flex",justifyContent:E?"flex-end":"none",flexWrap:"wrap"}},x.files&&Object.keys(x.files).length>0&&Object.keys(x.files).map((function(t,r){var a=x.files[t],o=a.name.split("."),c=o[o.length-1],l="attachment";n.fileExtensions.filter((function(e){return e.ext.indexOf(c.toLowerCase())>-1})).length>0&&(l=n.fileExtensions.filter((function(e){return e.ext.indexOf(c.toLowerCase())>-1}))[0].icon||"https://machen.azureedge.net/".concat(a.file));var s="img";return n.fileExtensions.filter((function(e){return e.ext.indexOf(c.toLowerCase())>-1})).length>0&&n.fileExtensions.filter((function(e){return e.ext.indexOf(c.toLowerCase())>-1}))[0].viewer&&(s=n.fileExtensions.filter((function(e){return e.ext.indexOf(c.toLowerCase())>-1}))[0].viewer),i.a.createElement("div",{key:t,style:{position:"relative",display:"flex",alignItems:"center",marginBottom:"5px",whiteSpace:"nowrap",textOverflow:"ellipsis",cursor:"pointer",overflow:"hidden",padding:"7px",zIndex:"10 !important",borderRadius:"15px",width:"img"===s?Object.keys(x.files).length<4?"33%":"25%":"movie"===s||"audio"===s?"50%":"20%",maxWidth:"img"===s?"440px":"none",minWidth:"img"===s||"movie"!==s&&"audio"!==s&&"string"===typeof l&&-1===l.indexOf("blob:")&&-1===l.indexOf("svg")||"movie"!==s&&"audio"!==s&&!("img"===s&&l&&l.indexOf("svg")>-1)?"140px":"100%"},onClick:function(r){e.openLightBox&&e.openLightBox(x.files[t]._id),r.preventDefault()},title:x.files[t].name},("img"===s||"movie"!==s&&"audio"!==s&&"string"===typeof l&&-1===l.indexOf("blob:")&&-1===l.indexOf("svg")||"movie"!==s&&"audio"!==s&&!("img"===s&&l&&l.indexOf("svg")>-1))&&i.a.createElement(Qe.a,{title:x.files[t].name},i.a.createElement("div",{style:{position:"absolute",bottom:"7px",left:"7px",right:"7px",padding:"3px",background:"rgba(0,0,0,0.8)",color:"#FFFFFF",borderRadius:"0px 0px 15px 15px",overflow:"hidden",textOverflow:"ellipsis"}},x.files[t].name)),"img"===s&&"string"===typeof l&&l.indexOf("https")>-1&&-1===l.indexOf("svg")&&i.a.createElement("img",{src:"".concat(l),style:{borderRadius:"15px",boxShadow:"0 1px 2px 2px rgba(0,0,0,0.1)",maxWidth:"100%",height:"100%",maxHeight:"33vh"},onError:function(e){x.created_at&&"string"===typeof x.created_at&&parseInt(x.created_at)>Ve()().unix("X")-60&&(e.target.src=l)}}),"movie"!==s&&"string"===typeof l&&-1===l.indexOf("blob:")&&-1===l.indexOf("svg")?i.a.createElement(kt,{icon:l,size:"50px"}):"movie"!==s&&!("img"===s&&l&&l.indexOf("svg")>-1)&&i.a.createElement("img",{src:l,style:{width:"100%",height:"100%"}}),"img"===s&&l&&l.indexOf("svg")>-1&&i.a.createElement("img",{src:Rr.a,style:{borderRadius:"15px",boxShadow:"0 1px 2px 2px rgba(0,0,0,0.1)",maxWidth:"100%",height:"100%",maxHeight:"33vh"}}),"movie"===s&&i.a.createElement("video",{style:{width:"100%"},src:"https://machen.azureedge.net/".concat(a.file),controls:!0}),"audio"===s&&i.a.createElement(Mr.a,{src:"https://machen.azureedge.net/".concat(a.file),controls:!0}))}))),function(){if("comment"===x.type&&x.message&&!x.urlPreview)return i.a.createElement("div",{style:{wordBreak:"break-word"}},yt(w,e.searchText));if("comment"===x.type&&x.message&&x.urlPreview){var r=w.replace(_.link,'<a href="'.concat(_.link,'" target="_blank">').concat(_.link,"</a>"));return i.a.createElement("div",null,i.a.createElement("div",{style:{position:"relative",width:"100%"}},i.a.createElement("div",{className:t.urlPreview},!s&&_.img&&i.a.createElement("img",{src:"".concat(_.img),onError:function(e){u(!0)},alt:_.title||_.link}),i.a.createElement("div",{className:"data"},i.a.createElement("div",{className:"title"},_.title),_.site&&i.a.createElement("div",{className:"siteName"},_.site),_.contentSnippet&&i.a.createElement("div",{className:"contentSnippet"},_.contentSnippet))),i.a.createElement("a",{style:{position:"relative",float:"right",fontWeight:"bold",fontSize:"12px",color:"#000000",zIndex:1},href:_.link,target:"_blank"},lt("$__openLink","*"))),i.a.createElement("div",{dangerouslySetInnerHTML:{__html:st(r,!0,"\n","\n")}}))}}())))}))),Ud=function(e){return{root:{position:"absolute",top:0,left:0,right:0,bottom:0,overflowY:"auto"},content:{position:"absolute",top:0,left:0,right:0,bottom:0,overflowY:"auto",backgroundColor:"rgba(249,249,249,1)"},timeline:{listStyle:"none",padding:"0",position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",width:"100%","& .file-drop-target":{width:"100%"}},scrollEnd:{marginTop:"160px",position:"relative",width:"100%",height:0,marginBottom:"-100px"},scrollEndNoEditor:{marginTop:"30px",position:"relative",width:"100%",height:0,marginBottom:"-100px"},timelineSimple:{position:"relative",overflow:"hidden",marginTop:0,padding:"0 0 20px",width:"-webkit-fill-available","&:before":{left:"15px"},"&:after":{clear:"both"}},timelineSimpleWithHeader:{position:"relative",overflowX:"auto",marginTop:"60px",padding:"0 0 50px",width:"-webkit-fill-available","&:before":{left:"15px"}},item:{marginBottom:"5px",position:"relative",paddingLeft:"15px",width:"calc(100% - 15px)","&:before,&:after":{content:"",display:"table"},"&:after":{clear:"both"}},timelineBadge:{color:"#FFF",width:"30px",height:"30px",lineHeight:"25px",fontSize:"12px",textAlign:"center",position:"absolute",bottom:"23px",left:"50%",marginLeft:"-7px",zIndex:"1",borderTopRightRadius:"50%",borderTopLeftRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"},timelineSimpleBadge:{left:"7px"},timelineBadgeInverted:{color:"#FFF",width:"30px",height:"30px",lineHeight:"25px",fontSize:"12px",textAlign:"center",position:"absolute",bottom:"23px",right:"50%",marginRight:"-7px",zIndex:"1",borderTopRightRadius:"50%",borderTopLeftRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"},timelineSimpleBadgeInverted:{right:"7px"},custom:{backgroundColor:dt("color"),boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt("#000")+", 0.4)"},info:{backgroundColor:cr[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(cr[0])+", 0.4)"},success:{backgroundColor:ir[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(ir[0])+", 0.4)"},danger:{backgroundColor:or[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(or[0])+", 0.4)"},warning:{backgroundColor:ar[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(ar[0])+", 0.4)"},primary:{backgroundColor:nr[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(nr[0])+", 0.4)"},badgeIcon:{width:"14px",height:"14px"},timelinePanel:{maxWidth:"calc(100% - 70px)",float:"right",padding:"7px",marginBottom:"5px",marginRight:"40px",position:"relative",boxShadow:"0 1px 4px 0 rgba("+Zt("#000")+", 0.14)",borderRadius:"6px",color:"rgba("+Zt("#000")+", 0.87)",background:dt("timelineMyMessage")},timelinePanelInverted:{maxWidth:"calc(100% - 70px)",float:"left",padding:"7px",marginLeft:"40px",marginBottom:"5px",position:"relative",boxShadow:"0 1px 4px 0 rgba("+Zt("#000")+", 0.14)",borderRadius:"6px",color:"rgba("+Zt("#000")+", 0.87)",background:"#ffffff"},timelineHeading:{marginBottom:0,display:"flex",alignItems:"center"},timelineDate:{display:"flex",alignItems:"center",padding:"5px",backgroundColor:"#CCCCCC"},timelineBody:{overflowWrap:"anywhere",fontSize:"12px",lineHeight:"21px",position:"relative",width:"100%",float:"left"},timelineLog:{fontSize:"12px",lineHeight:"21px"},timelineFooter:{zIndex:"1",position:"relative",float:"left",width:"100%",display:"inline-flex",justifyContent:"space-between"},footerUser:{display:"flex",alignItems:"center",fontSize:"12px",fontWeight:"bold",color:dt("medium"),padding:"0 7px"},footerLine:{position:"relative",marginTop:"10px",marginBottom:"5px"},dropFile:{display:"none"},onDropFile:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.77)",zIndex:1},editor:{position:"absolute",bottom:0,minHeight:"50px",padding:"10px",height:"auto",width:"calc(100% - 0px)",backgroundColor:"rgba(240,240,240,1)",zIndex:10},files:{display:"inline-table",position:"relative"},textEditor:{},textEditorIcon:{cursor:"pointer",color:dt("color")},progressBar:{backgroundColor:"".concat(dt("color","0.1")," !important"),"& .MuiLinearProgress-indeterminate":{backgroundColor:"".concat(dt("color")," !important")},"& .MuiLinearProgress-bar":{backgroundColor:"".concat(dt("color")," !important")}},actionButton:{alignItems:"center",cursor:"pointer",float:"left",height:"30px",position:"relative",textAlign:"center",width:"30px"},sendingMessage:{width:"100%"},valuePositive:{positive:"relative",float:"left",color:"blue"},valueNegative:{positive:"relative",float:"left",color:"red"},lastValue:{positive:"relative",float:"right",color:"grey"},timeInfo:{display:"flex",alignItems:"center",color:"grey",width:"100%",position:"relative",float:"left",marginBottom:"7px","& .text":{marginLeft:"7px"}},urlPreview:{position:"relative",float:"left",marginBottom:"33px","& img":{maxWidth:"20%",height:"auto",marginTop:"30px",marginRight:"7px"},"& .data":{"& .title":{fontSize:"16px",fontWeight:"bold"},"& .siteName":{fontSize:"14px",fontWeight:"bold",color:"#909090"},"& .contentSnippet":{fontSize:"12px",color:"#909090"}}},users:{position:"relative",bottom:0,right:"2px",fontSize:"10px","& .MuiAvatarGroup-root":{justifyContent:"flex-end"},"& .MuiAvatar-root":{width:"25px",height:"25px",fontSize:"10px"}}}};function Vd(){Vd=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var qd=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Ud)((function(e){var t=e.classes,r=De.getState(),n=r.db,a=r.session,o=r.functions,c=(r.chat,r.timeline),l=o.socket,s=i.a.useState(e.stories||{}),u=Object(Be.a)(s,2),d=u[0],p=u[1],f=i.a.useState(!0),m=Object(Be.a)(f,2),g=m[0],v=m[1],y=i.a.useState(!1),b=Object(Be.a)(y,2),x=b[0],_=(b[1],i.a.useState(!1)),w=Object(Be.a)(_,2),E=w[0],O=(w[1],[]);i.a.useEffect((function(){return c&&c[e.data._id]&&Object.keys(c[e.data._id]).length!==Object.keys(d).length&&p(c[e.data._id]),function(){}}),[c]),i.a.useEffect((function(){e.data._id&&j()}),[e.data]);var j=function(){var t=Object(Me.a)(Vd().mark((function t(){var r;return Vd().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,uo(Object(h.a)(Object(h.a)({},e),{},{fnIdentification:"Timeline/social/init()"}),{ids:[e.data._id],db:"cards",type:"comment",limit:E,skip:x});case 2:(r=t.sent)&&r.timelines&&r.timelines[e.data._id]?(p(r.timelines[e.data._id]),setTimeout((function(){v(!1)}),300)):r&&r.result&&setTimeout((function(){v(!1)}),300);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),S=function(t){e.reduxFunction("ASYNC","LIGHTBOX",{open:!0,files:O,file:t})},k=function(){var t=Object(Me.a)(Vd().mark((function t(){return Vd().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:Object.keys(d).filter((function(e){if(d[e].user&&d[e].user._id!==a._id&&(!d[e].readedBy||d[e].readedBy&&!d[e].readedBy[a._id]))return!0})).length>0&&(co(e,{readedBy:a._id,id:e.nodeId,db:n.cards[e.nodeId]?"cards":"users"}),l.emit("data",{module:"chat",method:"put",action:"read"},{readedBy:a._id,id:e.nodeId,db:n.cards[e.nodeId]?"cards":"users",_client:n.cards[e.nodeId]&&n.cards[e.nodeId].client?n.cards[e.nodeId].client:null}));case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return g?i.a.createElement("div",{style:{width:"100%"}},i.a.createElement(Ra.a,{variant:"text",height:11,style:{marginBottom:"3px"}}),i.a.createElement(Ra.a,{variant:"text",height:11,style:{marginBottom:"3px"}}),i.a.createElement(Ra.a,{variant:"text",height:11,style:{marginBottom:"3px"}})):i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%"}},i.a.createElement("ul",{className:t.timelineSimple,id:"tms_".concat(e.nodeId),style:{zIndex:1}},d&&Object.keys(d).length>0&&Object.keys(d).sort((function(e,t){return parseInt(d[e].created_at)<parseInt(d[t].created_at)?-1:parseInt(d[e].created_at)>parseInt(d[t].created_at)?1:0})).map((function(r,n){var o=d[r];return!e.showUnReaded&&n>Object.keys(d).length-4?(o.files&&Object.keys(o.files).length>0&&Object.keys(o.files).map((function(e,t){var r=o.files[e];O.push(r)})),i.a.createElement("li",{key:r},i.a.createElement(Wd,{openLightBox:function(e){S(e)},storie:o,reply:o.reply?d[o.reply]:null,hideCards:!!e.hideCards,db:e.db,nodeId:e.nodeId}))):e.showUnReaded&&o&&o.user&&o.user._id!==a._id&&(!o.readedBy||o.readedBy&&!o.readedBy[a._id])?(o.files&&Object.keys(o.files).length>0&&Object.keys(o.files).map((function(e,t){var r=o.files[e];O.push(r)})),i.a.createElement("li",{className:t.item,key:r,style:{}},i.a.createElement(Wd,{openLightBox:function(e){S(e)},storie:o,reply:o.reply?d[o.reply]:null,hideCards:!!e.hideCards,db:e.db,nodeId:e.nodeId}))):void 0})),i.a.createElement("div",{style:{marginBottom:"15px",clear:"both"}})),e.data&&e.data._id&&i.a.createElement(Hd,{nodeId:e.data._id,onSending:function(){k()},placeholder:"Escreva um coment\xe1rio"}))})));var Xd=Object($e.b)((function(e){return{store:e}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(wd)((function(e){var t=e.classes,r=i.a.useState({}),n=Object(Be.a)(r,2),a=n[0],o=n[1];return i.a.useEffect((function(){o(e.data)}),[]),i.a.createElement("div",{className:t.feed,style:{cursor:"pointer"},onClick:e.onClick?function(){return e.onClick()}:null},a&&a.img&&i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"}},i.a.createElement("img",{src:a.img,style:{width:"100%"},onError:function(){o(Object(h.a)(Object(h.a)({},a),{},{img:null}))}})),i.a.createElement("div",{className:t.infos},i.a.createElement("div",{className:t.linkTitle,dangerouslySetInnerHTML:{__html:a.title}}),i.a.createElement("div",{dangerouslySetInnerHTML:{__html:a.contentSnippet},className:t.linkContent}),i.a.createElement("div",{className:t.feedFooter,onClick:function(e){e.stopPropagation()}},i.a.createElement("div",{className:t.feedDate},Ve()(a.isoDate?a.isoDate:a.pubDate).format("DD/MM/YYYY HH:MM")),a.title&&a.title.indexOf("Violet ganham")>-1&&console.log(a),i.a.createElement(sn,{data:a},i.a.createElement("div",{style:{marginLeft:"15px"}},i.a.createElement(rn,{icon:"settings_input_antenna",title:lt("$__sendToRadar",1),iconColor:dt("menu"),size:"18px",onClick:function(){e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{id:"new",activeModule:"cardEdit",db:"cards",data:{_id:"new",type:"link",name:a.title,description:a.contentSnippet,pubDate:a.isoDate?a.isoDate:a.pubDate,image:a.img,url:a.link}}))}})))),!e.hideTimeline&&i.a.createElement("div",{className:t.feedFooter,onClick:function(e){e.stopPropagation()}},i.a.createElement(qd,{data:a}))))})));function Jd(){Jd=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Kd=Object($e.b)((function(){return{}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(wd)((function(e){var t=e.data,r=i.a.useState(0),n=Object(Be.a)(r,2),a=n[0],o=n[1],c=i.a.useState(0),l=Object(Be.a)(c,2),s=l[0],u=l[1],d=i.a.useState(7),p=Object(Be.a)(d,2),f=p[0],m=(p[1],i.a.useState([])),g=Object(Be.a)(m,2),v=g[0],y=g[1],b=i.a.useState([]),x=Object(Be.a)(b,2),_=x[0],w=x[1],E=i.a.useState(!0),j=Object(Be.a)(E,2),S=j[0],k=j[1],L=i.a.useState(!1),C=Object(Be.a)(L,2),I=C[0],F=C[1];i.a.useEffect((function(){var e=window.location.hash.split("/");e[0]=e[0].replace("#",""),JSON.stringify(e)!==JSON.stringify(v)&&y(e),k(!0)}),[]),i.a.useEffect((function(){v.length>0&&!I&&(T(a,f),v[2]&&36!==v[2].length&&k(!0),F(!0))}),[v]),i.a.useEffect((function(){s>Object.keys(_).length&&(k(!0),T(a,f))}),[a,f]),i.a.useEffect((function(){k(!1)}),[_]);var T=function(){var e=Object(Me.a)(Jd().mark((function e(t,r){var n,a,o;return Jd().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(0===s||s>Object.keys(_).length)){e.next=16;break}return k(!0),e.prev=2,e.next=5,Sn.post("/Feed_Social_V2",{ids:null,skip:t*r,limit:r});case 5:n=e.sent,a={},o=0,n&&n.data&&n.data.length>0&&n.data.map((function(e){var t={};e.reactions&&e.reactions.filter((function(e){return e&&e.user&&e.user._id})).length>0&&e.reactions.map((function(e){t=Object(h.a)(Object(h.a)({},t),{},Object(O.a)({},e.react.type,Object(h.a)(Object(h.a)({},t&&t[e.react.type]?t&&t[e.react.type]:{}),{},Object(O.a)({},e.user._id,Object(h.a)(Object(h.a)({},e.user),{},{reactDate:e.react.created_at})))))})),a=Object(h.a)(Object(h.a)({},a),{},Object(O.a)({},e.link._id,Object(h.a)(Object(h.a)({},e.link),{},{_reactions:t}))),e.total>o&&(o=e.total)})),u(o),w(Object(h.a)(Object(h.a)({},_),a)),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(2),console.log(e.t0);case 16:case"end":return e.stop()}}),e,null,[[2,13]])})));return function(t,r){return e.apply(this,arguments)}}();return i.a.createElement("div",{style:{position:"absolute",bottom:0,left:0,right:0,top:0}},i.a.createElement("div",{style:{position:"absolute",top:t&&(t.customTitle||t.name)?50:0,left:0,right:0,bottom:0,padding:"0px 15px",overflow:"auto"},id:"linkList",onScroll:function(e){!function(e){var t=document.getElementById("linkList");!S&&t.scrollHeight-t.scrollTop<2500&&o(a+1)}()}},i.a.createElement(vo,null,s>0&&Object.keys(_).sort((function(e,t){return _[e].isoDate&&_[t].isoDate&&_[e].isoDate<_[t].isoDate?1:_[e].isoDate&&_[t].isoDate&&_[e].isoDate>_[t].isoDate?-1:0})).map((function(e){return i.a.createElement(vo,{key:e,style:{display:"flex",justifyContent:"center"}},i.a.createElement(xo,{xs:12,sm:10,md:8,lg:6,xl:6},i.a.createElement(Xd,{db:"cards",data:_[e],onClick:function(){window.open(_[e].link,"_blank")}})))}))),S&&i.a.createElement("div",{style:{position:"relative",width:"100%"}},i.a.createElement(Fo,null))))})));function Zd(){Zd=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Qd=Object($e.b)((function(e){return{store:e}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(wd)((function(e){var t=e.data,r=(e.classes,De.getState().db,i.a.useState(0)),n=Object(Be.a)(r,2),a=(n[0],n[1],i.a.useState(0)),o=Object(Be.a)(a,2),c=o[0],l=(o[1],i.a.useState(5)),s=Object(Be.a)(l,2),u=(s[0],s[1],i.a.useState([])),d=Object(Be.a)(u,2),p=d[0],f=d[1],m=i.a.useState([]),g=Object(Be.a)(m,2),v=g[0],y=g[1],b=i.a.useState(!0),x=Object(Be.a)(b,2),_=x[0],w=x[1],E=i.a.useState(!1),O=Object(Be.a)(E,2),j=O[0],S=O[1];i.a.useEffect((function(){var e=window.location.hash.split("/");e[0]=e[0].replace("#",""),JSON.stringify(e)!==JSON.stringify(p)&&f(e),w(!0)}),[]),i.a.useEffect((function(){p.length>0&&!j&&(k(),p[2]&&36!==p[2].length&&w(!0),S(!0))}),[p]);var k=function(){var e=Object(Me.a)(Zd().mark((function e(t,r){var n,a;return Zd().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(0===c||c>Object.keys(v).length)){e.next=13;break}return w(!0),e.prev=2,e.next=5,Sn.post("/Feed_Social",{id:p[2]});case 5:n=e.sent,a={},n&&n.data&&n.data.links?(a=Object(h.a)(Object(h.a)({},a),n.data.links),y(Object(h.a)(Object(h.a)({},v),a)),w(!1)):w(!1),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),console.log(e.t0);case 13:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(t,r){return e.apply(this,arguments)}}();return i.a.createElement("div",{style:{position:"absolute",bottom:0,left:0,right:0,top:0}},i.a.createElement("div",{style:{position:"absolute",top:t&&(t.customTitle||t.name)?50:0,left:0,right:0,bottom:0,padding:"0px 15px",overflow:"auto"},id:"linkList"},i.a.createElement(vo,null,Object.keys(v).length>0?Object.keys(v).sort((function(e,t){return v[e].isoDate&&v[t].isoDate&&v[e].isoDate<v[t].isoDate?1:v[e].isoDate&&v[t].isoDate&&v[e].isoDate>v[t].isoDate?-1:0})).map((function(e){return i.a.createElement(vo,{key:e,style:{display:"flex",justifyContent:"center"}},i.a.createElement(xo,{xs:12,sm:6,md:6,lg:6,xl:6},i.a.createElement(Xd,{db:"cards",data:v[e],onClick:function(){window.open(v[e].link,"_blank")}})))})):i.a.createElement(vo,{style:{display:"flex",justifyContent:"center"}},i.a.createElement(xo,{xs:12,sm:6,md:6,lg:6,xl:6},"A feed solicitado n\xe3o pode ser exibido"))),_&&i.a.createElement("div",{style:{position:"relative",width:"100%"}},i.a.createElement(Fo,null))))})));var ep=Object($e.b)((function(e){return{history:e.db.history}}),(function(e){return Object(u.b)(n,e)}))((function(e){i.a.useEffect((function(){return console.log("StrategyAndPlans"),function(){}}),[]),window.location.hash.split("/")[0].replace("#","")||s.push("bright-and-connected#tab/home");var t=window.location.hash.split("/");return t[0]=t[0].replace("#",""),i.a.createElement("div",null,t[1]&&("radar"===t[1]||"insight-boards"===t[1])&&i.a.createElement(md,null),t[1]&&"home"===t[1]&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Kd,null)),t[1]&&"read"===t[1]&&i.a.createElement(i.a.Fragment,null,i.a.createElement(yd,null),i.a.createElement(Qd,null)),t[1]&&"insight-boards"===t[1]&&i.a.createElement(i.a.Fragment,null,i.a.createElement(yd,null),i.a.createElement(_d,null)),t[1]&&"radar"===t[1]&&i.a.createElement("div",{style:{top:33}},i.a.createElement(jd,null)),t[1]&&("feeds"===t[1]||"bright-and-connected"===t[1])&&i.a.createElement(i.a.Fragment,null,i.a.createElement(yd,null),i.a.createElement(Bd,null)),t[1]&&"hideFeeds"===t[1]&&i.a.createElement(i.a.Fragment,null,i.a.createElement(yd,null),i.a.createElement(Bd,{showHidden:!0})),t[1]&&"allNews"===t[1]&&i.a.createElement(i.a.Fragment,null,i.a.createElement(yd,null),i.a.createElement("div",{style:{position:"absolute",bottom:0,left:0,right:0,top:0}},i.a.createElement($d,null))))})),tp=r(717),rp=r(996),np=r.n(rp),ap=(r(1499),Object(Ze.a)((function(e){return{tooltip:{backgroundColor:"rgba(0,0,0,0.5) !important",color:"rgba(0, 0, 0, 0.87)",padding:"5px !important",fontSize:e.typography.pxToRem(12),border:"none",borderRadius:"7px",boxShadow:"3px 3px 7px 0px rgba(0,0,0,0.7)",alignItems:"center",justifyContent:"center"}}}))(Qe.a));r(1500),r(1501);function op(){op=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var ip=np()(tp.a),cp={allDay:lt("$__allDay"),previous:"<",next:">",today:lt("$__today"),month:lt("$__month"),week:lt("$__week"),day:lt("$__aday"),agenda:lt("$__agenda"),date:lt("$__date"),time:lt("$__hour"),event:lt("$__activity"),showMore:function(e){return"+ (".concat(e,") ").concat(lt("$__activities"))}};function lp(e){De.getState().session,e.localizer.messages;var t=e.label,r=function(t){e.onNavigate(t)};return i.a.createElement("div",{className:"rbc-toolbar"},i.a.createElement("span",{className:"rbc-btn-group"},i.a.createElement("button",{type:"button",onClick:function(){r("PREV")},style:{backgroundColor:dt("menu"),borderRadius:0}},lt("$__prev"))),i.a.createElement("span",{className:"rbc-toolbar-label"},t),i.a.createElement("span",{className:"rbc-btn-group"},i.a.createElement("button",{type:"button",onClick:function(){r("NEXT")},style:{backgroundColor:dt("menu"),borderRadius:0}},lt("$__next"))),i.a.createElement("span",{className:"rbc-btn-group"},i.a.createElement("button",{type:"button",onClick:function(){r("TODAY")},style:{backgroundColor:dt("menu"),borderRadius:0}},lt("$__today"))),i.a.createElement("span",{className:"rbc-btn-group"},i.a.createElement("button",{type:"button",onClick:function(){r("day")},style:{backgroundColor:dt("menu"),borderRadius:0}},lt("$__day"))),i.a.createElement("span",{className:"rbc-btn-group"},i.a.createElement("button",{type:"button",onClick:function(){r("week")},style:{backgroundColor:dt("menu"),borderRadius:0}},lt("$__week"))),i.a.createElement("span",{className:"rbc-btn-group"},i.a.createElement("button",{type:"button",onClick:function(){r("month")},style:{backgroundColor:dt("menu"),borderRadius:0}},lt("$__month"))))}var sp=Object($e.b)((function(e){return{search:e.search,cards:e.db.cards}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=e.reduxFunction,r=e.search,n=De.getState(),a=n.db,o=n.session,c=i.a.useState([]),l=Object(Be.a)(c,2),s=l[0],u=l[1],d=i.a.useState(null),p=Object(Be.a)(d,2),m=p[0],g=(p[1],i.a.useState("week")),v=Object(Be.a)(g,2),y=v[0],b=v[1],x=i.a.useState(Ac()().toLocaleString()),_=Object(Be.a)(x,2),w=_[0],E=_[1],O=i.a.useState(null),j=Object(Be.a)(O,2),S=(j[0],j[1]),k=i.a.useState(!1),L=Object(Be.a)(k,2),C=L[0],I=L[1],F=i.a.useState(!1),T=Object(Be.a)(F,2),N=T[0],P=T[1],D=i.a.useState([]),A=Object(Be.a)(D,2),$=A[0],z=A[1];Ac.a.locale(o.language?o.language.toLowerCase():"pt-br",{week:{dow:1}});var M=Object(tp.b)(Ac.a);i.a.useEffect((function(){var e=o&&o.calendarPreffers?JSON.parse(o.calendarPreffers):{};e.view&&b(e.view),e.view&&I(e.showAllEvents),e.severalDaysActivities&&P(e.severalDaysActivities),e.disabledTypes&&z(Array.from(e.disabledTypes))}),[]),i.a.useEffect((function(){Y()}),[e.cards,r]),i.a.useEffect((function(){Y(),B()}),[N,$]);var B=function(){var e=Object(Me.a)(op().mark((function e(){var t;return op().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=o.calendarPreffers?JSON.parse(o.calendarPreffers):{},t=Object(h.a)(Object(h.a)({},t),{},{disabledTypes:Array.from($),showAllEvents:C,severalDaysActivities:N,view:y}),De.getState().functions.socket.emit("data",{module:"user",method:"post",action:"preffers"},{calendarPreffers:JSON.stringify(t)},(function(e){e.error&&console.log("hideSupportAndAppBanner",e.error)}));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Y=function(){var e=Object(Me.a)(op().mark((function e(){var t;return op().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=[],Object.keys(De.getState().db.cards).filter((function(e){return De.getState().db.cards[e]&&De.getState().db.cards[e]._users&&De.getState().db.cards[e]._users[o._id]&&(!De.getState().db.cards[e].checklist||De.getState().db.cards[e].checklist&&De.getState().db.cards[e].showCard)&&Ac()(1e3*De.getState().db.cards[e].startDate).isValid()&&Ac()(1e3*De.getState().db.cards[e].endDate).isValid()&&(0===$.length||$.length>0&&-1===$.indexOf(De.getState().db.cards[e].type))&&"plan"!==De.getState().db.cards[e].type&&"chatGroup"!==De.getState().db.cards[e].type&&"completed"!==De.getState().db.cards[e].status&&!De.getState().db.cards[e].deleted&&(N||!N&&Ac()(1e3*De.getState().db.cards[e].startDate).format("YYYY-MM-DD")===Ac()(1e3*De.getState().db.cards[e].endDate).format("YYYY-MM-DD"))&&(0===r.tags.length||r.tags.length>0&&De.getState().db.cards[e]._tags&&De.getState().db.cards[e]._tags.length>0&&De.getState().db.cards[e]._tags.filter((function(e){var t=!1;return r.tags.map((function(r){r.value===e.value&&(t=!0)})),t})).length>0)&&(""===r.text||""!==r.text&&(De.getState().db.cards[e].name.toLowerCase().indexOf(r.text.toLowerCase())>-1||De.getState().db.cards[e].description&&De.getState().db.cards[e].description.toLowerCase().indexOf(r.text.toLowerCase())>-1))&&r.cards.status[De.getState().db.cards[e].status]&&(r.cards.priority.all||De.getState().db.cards[e].priority&&r.cards.priority[De.getState().db.cards[e].priority])&&(r.cards.risk.all||De.getState().db.cards[e].risk&&r.cards.risk[De.getState().db.cards[e].risk])&&(r.cards.complexity.all||De.getState().db.cards[e].complexity&&r.cards.complexity[De.getState().db.cards[e].complexity])&&(r.cards.impact.all||De.getState().db.cards[e].impact&&r.cards.impact[De.getState().db.cards[e].impact])&&(0===Object.keys(r.users.selected).length||Object.keys(r.users.selected).length>0&&Object.keys(De.getState().db.cards[e]._users).filter((function(e){return r.users.selected[e]})).length>0)})).map((function(e){var r=!1,n=Ac()(1e3*De.getState().db.cards[e].startDate).toDate(),a=Ac()(1e3*De.getState().db.cards[e].endDate).toDate(),o=Ac()(1e3*De.getState().db.cards[e].endDate).unix("x")-Ac()(1e3*De.getState().db.cards[e].startDate).unix("x");("00:00:00"===Ac()(1e3*De.getState().db.cards[e].startDate).format("HH:mm:ss")&&"23:59:59"===Ac()(1e3*De.getState().db.cards[e].endDate).format("HH:mm:ss")||Math.ceil(o/60/60)>23)&&(r=!0),t.push({title:De.getState().db.cards[e].name,allDay:r,startDate:n,endDate:a,_id:e})})),u(t);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return i.a.createElement("div",null,m,i.a.createElement(md,null),i.a.createElement(vo,null,i.a.createElement("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",width:"100%"}},i.a.createElement(En,{text:lt("$__legend"),icon:"style",horizontalButton:!0,transparent:!0,size:"21px",color:"lightgray",btColor:"lightgray",buttonStyle:{backgroundColor:dt("menu"),borderRadius:0},options:[{name:lt("$__scheduleColor",1),icon:"label",iconColor:"gray",color:"gray",disabled:!0},{name:lt("$__late",1),icon:"label",iconColor:"red",disabled:!0}].concat(Object(f.a)(a.status.map((function(e){return{name:lt("".concat(e.label),1),icon:"label",iconColor:e.color,disabled:!0}}))),[{name:lt("$__scheduleLeftBorderColor",1),icon:"border_left",color:"gray",iconColor:"gray",disabled:!0}],Object(f.a)(a.priority.map((function(e){return{name:lt("".concat(e.label),1),icon:"border_left",color:e.color,iconColor:e.color,disabled:!0}}))))}),i.a.createElement(En,{text:lt("$__type"),icon:"collections_bookmark",horizontalButton:!0,transparent:!0,size:"21px",color:dt("lightgray"),btColor:dt("lightgray"),buttonStyle:{backgroundColor:dt("menu"),borderRadius:0},forceStopPropagation:!0,options:[].concat(Object(f.a)(a.type.filter((function(e){return e.calendar})).map((function(e){return{name:lt("".concat(e.label),1),icon:e.icon,iconColor:$.indexOf(e.value)>-1?"lightgray":dt("menu"),color:$.indexOf(e.value)>-1?"lightgray":dt("menu"),onClick:function(){var t=Array.from($);-1===t.indexOf(e.value)?t.push(e.value):t.splice(t.indexOf(e.value),1),z(t)}}}))),[{name:$.length===a.type.filter((function(e){return e.calendar})).length?lt("$__showAll",1):lt("$__hideAll",1),icon:"clear_all",iconColor:$.length!==a.type.filter((function(e){return e.calendar})).length?"lightgray":dt("menu"),color:$.length!==a.type.filter((function(e){return e.calendar})).length?"lightgray":dt("menu"),onClick:function(){if($.length===a.type.filter((function(e){return e.calendar})).length)z([]);else{var e=[];a.type.filter((function(e){return e.calendar})).map((function(t){e.push(t.value)})),z(e)}}}])}),i.a.createElement(En,{text:lt("$__options"),icon:"settings",horizontalButton:!0,transparent:!0,size:"21px",color:"lightgray",btColor:"lightgray",buttonStyle:{backgroundColor:dt("menu"),borderRadius:0},style:{marginRight:"15px"},options:[{name:lt("$__showAllEvents","*"),icon:C?"check_circle_outline":"radio_button_unchecked",onClick:function(){I((function(e){return!e}))}},{name:lt("$__activitiesTInSeveralDays","*"),icon:N?"check_circle_outline":"radio_button_unchecked",onClick:function(){P((function(e){return!e}))}}]})),i.a.createElement(xo,{xs:12,sm:12,md:12},i.a.createElement($s,null,i.a.createElement(Ys,null,i.a.createElement(ip,{selectable:!0,localizer:M,events:s,messages:cp,defaultDate:new Date,onSelectSlot:function(e){t("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{db:"cards",id:"new",module:"cardEdit",activeModule:"cardEdit",data:{type:"task",startDate:Ac()(e.start).unix("x"),endDate:Ac()(e.end).unix("x")}}))},startAccessor:"startDate",endAccessor:"endDate",onView:function(e){b(e)},onSelectEvent:function(e){S(e._id),t("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{db:"cards",id:e._id,module:"cardEdit",activeModule:"cardEdit",data:De.getState().db.cards[e._id]}))},eventPropGetter:function(e,t,r,n){var o=De.getState().db.cards[e._id],i=De.getState().db.status.filter((function(t){return t.value===De.getState().db.cards[e._id].status}))[0].color,c=Ac()(new Date(t)).unix("x"),l=Ac()(new Date(r)).unix("x");Ac()(new Date(r)).unix("x")<Ac()().unix("x")&&(i="#ff0000");var s=(l-c)/60/1440*100;return s>100&&(s=100),{className:"",style:Object(h.a)(Object(h.a)({height:"".concat(s,"%")},"week"===y||"day"===y?{minHeight:"".concat(s,"%")}:{minHeight:22}),{},{width:"100%",border:"solid 1px rgba(0,0,0,0.1)",borderRadius:3,boxShadow:"0px 1x 2px 0px rgba(0,0,0,0.3)",backgroundColor:"".concat(ut(i,n?.3:.5))},o.priority&&a.priority.filter((function(e){return String(e.value)===String(o.priority)})).length>0?{borderLeft:"solid 5px ".concat(a.priority.filter((function(e){return String(e.value)===String(o.priority)}))[0].color)}:{})}},components:{event:function(e){var t=e.event,r=(Ac()(t.startDate).unix("x"),Ac()(t.endDate).unix("x"),De.getState().db.cards[t._id]);De.getState().db.status.filter((function(e){return e.value===r.status}))[0].color;Ac()(t.endDate).format("YYYY-MM")===Ac()().format("YYYY-MM")&&(Ac()(t.endDate).format("DD"),Ac()().format("DD"));var n=r.type&&a&&a.dataType&&a.dataType.filter((function(e){return e.name===r.type}))[0]?a.dataType.filter((function(e){return e.name===r.type}))[0].icon:"$__topic";return i.a.createElement(ap,{leaveDelay:800,title:i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{display:"flex",alignItems:"center",zIndex:5e3}},i.a.createElement(oc,{data:r,onlyOption:!0,notGlobalExpanded:!0})))},i.a.createElement("div",{style:{display:"flex",alignItems:"center",fontSize:10,height:"100%",maxWidth:"100%",textOverflow:"ellipsis",overflow:"hidden"}},i.a.createElement("div",{style:{marginRight:5}},i.a.createElement(Qr,{overlap:"rectangular",size:"12px",icon:n,color:"bkack",title:lt("$__".concat(r.type))})),t.title))},toolbar:lp,month:{dateHeader:function(e){e.date;var t=e.label;return i.a.createElement("div",{style:{color:dt("menu"),cursor:"pointer"}},t)}},week:{dateHeader:function(e){e.date;var t=e.label;return i.a.createElement("div",{style:{color:dt("menu"),cursor:"pointer"}},t)}}},onNavigate:function(e,t,r){w&&Ac()(e).format("YYYY-MM")===Ac()(w).format("YYYY-MM")||E(e),"NEXT"!==r&&"PREV"!==r&&"TODAY"!==r&&"DATE"!==r&&b(r)},view:y,onEventResize:function(t){pa(Object(h.a)(Object(h.a)({},e),{},{data:{_id:t.event._id}}),{startDate:Ac()(t.start).unix("x"),endDate:Ac()(t.end).unix("x")})},onEventDrop:function(t){pa(Object(h.a)(Object(h.a)({},e),{},{data:{_id:t.event._id}}),{startDate:Ac()(t.start).unix("x"),endDate:Ac()(t.end).unix("x")})},showMultiDayTimes:!0,showAllEvents:C,popup:!0,resizable:!0,defaultView:"week"}))),i.a.createElement("div",{style:{height:300,width:"100%"}}))))})),up=r(997),dp=r(1815),pp={widgetsContent:{backgroundColor:"#FFFFFF",height:"calc(100vh - 200px)",maxHeight:"calc(100vh - 350px)",position:"relative",overflowX:"auto"}},fp=r(998),hp=r.n(fp),mp=r(999),gp=r.n(mp);function vp(){vp=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var yp=Object($e.b)((function(e){return{store:{cards:e.db.cards},hidePrivate:e.controls.hidePrivate}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(pp)((function(e){var t,r=De.getState(),n=r.db,a=r.session,o=n.dataType,c=n.users,l=i.a.useState(!1),u=Object(Be.a)(l,2),d=u[0],p=u[1],f=i.a.useState("EndDate"),h=Object(Be.a)(f,2),m=h[0],g=h[1],v=Object(dp.a)(["banner"]),y=Object(Be.a)(v,2),b=y[0],x=y[1],_=[],w=function(){var e=Object(Me.a)(vp().mark((function e(){var t;return vp().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=De.getState().functions.socket,x("banner",!0,{path:"/"});try{t.emit("data",{module:"user",method:"post",action:"preffers"},{hideSupportAndAppBanner:!0},(function(e){e.error&&console.log("hideSupportAndAppBanner",e.error)}))}catch(r){console.log(r)}case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();_=Object.keys(De.getState().db.cards).filter((function(t){return De.getState().db.cards[t]&&!De.getState().db.cards[t].checklist&&o.filter((function(e){return e.name===De.getState().db.cards[t].type})).length>0&&(!e.hidePrivate||e.hidePrivate&&!De.getState().db.cards[t].private)})).map((function(e){return De.getState().db.cards[e]}));var E=Ve()().format("YYYY-MM-DD"),j=window.location.hash.split("/");j[0]=j[0].replace("#","");var S=String(a.dashboard.period).replace("$__last","");S=S.replace("Days","");var k=_.filter((function(t){if(t._users&&!t.deleted&&!t.checklist&&t._users[a._id]&&"completed"!==t.status&&(t._users[a._id].myDay&&Ve()(new Date(1e3*t._users[a._id].myDay)).tz("America/Sao_Paulo").unix("x")>Ve()().subtract(15,"days").unix("x")&&Ve()(new Date(1e3*t._users[a._id].myDay)).tz("America/Sao_Paulo").unix("x")<Ve()(new Date(E)).unix("x")||t._users[a._id].isResponsible&&(t.endDate&&Ve()(new Date(1e3*t.endDate)).tz("America/Sao_Paulo").unix("x")<Ve()().unix("x")||t.startDate&&Ve()(new Date(1e3*t.startDate)).tz("America/Sao_Paulo").unix("x")>Ve()(new Date(E)).subtract(15,"days").unix("x"))&&(t._users[a._id]&&!t._users[a._id].myDay||t._users[a._id].myDay&&Ve()(new Date(1e3*t._users[a._id].myDay)).tz("America/Sao_Paulo").format("YYYY-MM-DD")!==E&&Ve()(new Date(1e3*t._users[a._id].myDay)).tz("America/Sao_Paulo").format("YYYY-MM-DD")>Ve()(new Date).tz("America/Sao_Paulo").subtract(30,"d").format("YYYY-MM-DD")))&&(!e.hidePrivate||e.hidePrivate&&!t.private))return!0})).sort((function(e,t){var r,n,a,o;return De.getState().db.orderByTitle&&"ASC"===De.getState().db.orderByTitlePosition&&e&&e.name&&t&&t.name&&e.name.toLowerCase().trim()<t.name.toLowerCase().trim()||De.getState().db.orderByTitle&&"DESC"===De.getState().db.orderByTitlePosition&&e&&e.name&&t&&t.name&&e.name.toLowerCase().trim()>t.name.toLowerCase().trim()?-1:De.getState().db.orderByTitle?0:!De.getState().db.orderByTitle&&String(e.order)&&String(t.order)&&String((null===(r=e.order)||void 0===r?void 0:r.low)||0)&&String((null===(n=t.order)||void 0===n?void 0:n.low)||0)&&parseInt((null===(a=e.order)||void 0===a?void 0:a.low)||0)<parseInt((null===(o=t.order)||void 0===o?void 0:o.low)||0)?-1:1})).map((function(t,r){return i.a.createElement("div",{style:{width:"calc(100%)",display:"flex",alignItems:"center",justifyContent:"center"},key:t._id},i.a.createElement(oc,{db:"cards",data:t,noShadow:!0}),i.a.createElement(Nt.a,{onClick:function(){Zn(e,{_id:t._id,userId:a._id,option:!0})}},i.a.createElement(kt,{icon:"add",color:dt("menu"),title:lt("$__addOnMyDay")})))})),L=_.filter((function(e){return"completed"!==e.status&&e.name&&!e.deleted&&!e.archived&&e._users&&e._users[a._id]&&(!e._users[a._id].myDay||e._users[a._id].myDay&&Ve()(new Date(1e3*e._users[a._id].myDay)).tz("America/Sao_Paulo").format("YYYY-MM-DD")!==E)&&(e.endDate&&Ve()(new Date(1e3*e.endDate)).tz("America/Sao_Paulo").format("YYYY-MM-DD")>=Ve()().format("YYYY-MM-DD")&&Ve()(new Date(1e3*e.endDate)).tz("America/Sao_Paulo").format("YYYY-MM-DD")<=Ve()(new Date(E)).add(10,"days").format("YYYY-MM-DD")||e.startDate&&Ve()(new Date(1e3*e.startDate)).tz("America/Sao_Paulo").format("YYYY-MM-DD")>=Ve()().format("YYYY-MM-DD")&&Ve()(new Date(1e3*e.startDate)).tz("America/Sao_Paulo").format("YYYY-MM-DD")<=Ve()(new Date(E)).add(10,"days").format("YYYY-MM-DD"))})).sort((function(e,t){var r=e.name.toLowerCase().trim(),n=t.name.toLowerCase().trim();return"IniDate"===m&&(r=parseInt(e.startDate),n=parseInt(t.startDate)),"EndDate"===m&&(r=parseInt(e.endDate),n=parseInt(t.endDate)),r<n?-1:r>n?1:0})).map((function(e,t){return i.a.createElement(oc,{db:"cards",key:e._id,data:e,noShadow:!0})})),C=c&&Object.keys(c).length>0?c[Object.keys(c).find((function(e){return a&&a._id&&c[e]&&c[e]._id&&c[e]._id.indexOf(a._id)>-1}))]:{},I=new Date,F=I.getHours()>=0&&I.getHours()<5?"$__goodNight":I.getHours()>=5&&I.getHours()<12?"$__goodMorning":I.getHours()>=12&&I.getHours()<18?"$__goodAfternoon":"$__goodNight",T=Object.keys(n.cards).filter((function(t){return n.cards[t]&&!n.cards[t].deleted&&!n.cards[t].archived&&"plan"===n.cards[t].type&&n.cards[t]._users&&n.cards[t]._users[a._id]&&"completed"!==n.cards[t].status&&n.cards[t]._isFavorite&&(!e.hidePrivate||e.hidePrivate&&!n.cards[t].private)}));return i.a.createElement("div",{style:{width:"100%"}},i.a.createElement(vo,null,b.banner||a.hideSupportAndAppBanner?i.a.createElement(i.a.Fragment,null):i.a.createElement(i.a.Fragment,null,i.a.createElement(xo,{xs:12,sm:12,md:6,lg:6,xl:6},i.a.createElement("div",{style:{display:"flex",justifyContent:"center",flexDirection:"column",alignItems:"center",marginBottom:"33px"},id:"view_dashboard_welcomeMessage"},i.a.createElement("div",{style:{fontSize:"16px",padding:"15px 0",fontWeight:"bold",width:"100%",textAlign:"left",color:dt("menu"),paddingLeft:"15px"}},lt(F,1),", ",C&&C.displayName?C.displayName:C.name?C.name:"","!"),i.a.createElement(vo,{style:{width:"100%"}},i.a.createElement(xo,{xs:12,sm:12,md:6,lg:6,xl:6},i.a.createElement("img",{src:gp.a,width:800,height:610,style:{width:"100%",height:"auto",borderRadius:17,boxShadow:"0 0 7px 1px rgba(0,0,0,0.1)"}})),i.a.createElement(xo,{xs:12,sm:12,md:6,lg:6,xl:6},i.a.createElement("div",{style:{position:"relative",paddingBottom:33,height:"100%"}},i.a.createElement("div",{style:{fontSize:"16px",color:dt("medium"),paddingRight:15},dangerouslySetInnerHTML:{__html:st(lt("$__supportWelcomeMessage",1))}}),i.a.createElement("div",{style:{position:"absolute",bottom:0,left:0}},i.a.createElement(At,{title:lt("$__clickToaccessSupportPage","*"),text:lt("$__clickToaccessSupportPage"),color:dt("menu"),icon:"help_outline",onClick:function(){window.open("https://support.machen.ai/","_blank")},size:"17px"}))))))),i.a.createElement(xo,{xs:12,sm:12,md:6,lg:6,xl:6},i.a.createElement("div",{style:{position:"relative"}},i.a.createElement("img",{src:hp.a,width:800,height:640,style:{width:"100%",height:"auto"}}),i.a.createElement("div",{style:{position:"absolute",bottom:-33,right:15}},i.a.createElement(At,{title:lt("$__hideSupportAndAppBanner","*"),text:lt("$__hideSupportAndAppBanner"),color:dt("menu"),icon:"close",onClick:function(){w()},size:"12px"})))))),T.length>0?i.a.createElement(vo,{style:{marginTop:"33px",marginBottom:"33px"}},i.a.createElement(xo,{xs:12,sm:12,md:12,lg:12,xl:12,id:"view_dashboard_favorites",style:{boxShadow:"0 5px 7px 1px rgba(0,0,0,0.03)",backgroundColor:"rgba(250,250,250,0.07)",paddingBottom:33}},i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",marginBottom:33}},i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",color:dt("menu"),fontWeight:"bold",fontSize:"16px",marginTop:"16px",display:"flex",alignItems:"center",justifyContent:"space-between"}},lt("$__favoritePlans"),T.length>3?i.a.createElement(At,{title:"".concat(lt("$__viewAllFavorites","*")," (").concat(T.length,")"),text:"".concat(lt("$__viewAllFavorites","*")," (").concat(T.length,")"),color:dt("menu"),icon:"favorite",transparent:!0,onClick:function(){s.push("sp#tab/home")},size:"25px"}):i.a.createElement(i.a.Fragment,null)),i.a.createElement(vo,{style:{flexDirection:"row",overflowY:"auto",flexWrap:"nowrap",display:"-webkit-inline-box"}},T.sort((function(e,t){var r=n.cards[e].updated_at&&n.cards[e].updated_at.low?n.cards[e].updated_at.low:0,a=n.cards[t].updated_at&&n.cards[t].updated_at.low?n.cards[t].updated_at.low:0;return r>a?-1:r<a?1:0})).map((function(e,t){if(t<6)return i.a.createElement(xo,{xs:12,sm:6,md:4,lg:3,xl:2,key:n.cards[e]._id,style:{marginTop:"33px",cursor:"pointer"},onClick:function(){s.push("sp#".concat(n.cards[e]._id,"/dashboard"))}},i.a.createElement(oc,{data:n.cards[e],expanded:!0,Avatar:!0,ignoreList:!0}))})))),i.a.createElement("div",{style:{clear:"both"}}))):i.a.createElement(i.a.Fragment,null),i.a.createElement(vo,{style:{paddingBottom:33,marginTop:33}},i.a.createElement(xo,{xs:12,sm:12,md:6,lg:6,xl:6,style:{borderRight:"2px solid ".concat(dt("menu"))},id:"view_dashboard_myDay"},i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",padding:"0 16px"}},d?i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",color:dt("menu"),fontWeight:"bold",fontSize:"16px",marginBottom:"16px",display:"flex",alignItems:"center"}},i.a.createElement(Nt.a,{onClick:function(){p(!1)}},i.a.createElement(kt,{icon:"undo",color:dt("menu"),title:lt("$__backToMyDay")})),lt("$__taskSuggestions")),i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",color:dt("medium"),fontWeight:"bold",fontSize:"12px",marginBottom:"16px",display:"flex",alignItems:"center"},id:"view_dashboardSuggestionsAddButton"},"Clique no + para adicionar as tarefas ao seu dia."),i.a.createElement("div",null,k)):i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",color:dt("menu"),fontWeight:"bold",fontSize:"16px",marginBottom:"16px"}},lt("$__myDay"),k.length>0&&i.a.createElement("div",{style:(t={color:dt("menu"),fontSize:"16px",marginTop:"7px",cursor:"pointer",textAlign:"left",padding:"7px"},Object(O.a)(t,"color","#f50057"),Object(O.a)(t,"display","flex"),Object(O.a)(t,"alignItems","center"),t),onClick:function(){p(!0)},id:"view_dashboard_myDaySuggestionsOptions"},i.a.createElement(kt,{icon:"info",color:dt("medium"),style:{marginRight:"15px"}}),lt("$__clickHereToCheckTaskSuggestions"))),i.a.createElement(Si,{noChecklist:!0,noDelete:!0,showCard:!0,myDay:!0,db:"cards"})))),i.a.createElement(xo,{xs:12,sm:12,md:6,lg:6,xl:6,style:{borderRight:"2px solid ".concat(dt("menu"))},id:"view_dashboard_nextTasks"},i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",padding:"0 16px"}},i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",display:"flex",justifyContent:"space-between"}},i.a.createElement("div",{style:{color:dt("menu"),fontWeight:"bold",fontSize:"16px",marginBottom:"16px"}},lt("$__nextTasks")),i.a.createElement("div",null,i.a.createElement(At,{title:lt("$__orderBy".concat(m)),color:"lightgray",icon:"IniDate"===m?"today":"EndDate"===m?"event":"text_rotate_vertical",onClick:function(){"IniDate"===m&&g("EndDate"),"EndDate"===m&&g("name"),"name"===m&&g("IniDate")},size:"21px",style:{padding:"0px !important"}}))),i.a.createElement("div",null,L)))))}))),bp=(r(1508),r(278)),xp=r.n(bp);var _p=Object($e.b)((function(){return{}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(pp)((function(e){var t=De.getState().session;i.a.useEffect((function(){return function(){}}),[]);var r=0;return t&&t.GlobalData&&(t.GlobalData.message&&(r+=1),t.GlobalData.history&&(r+=1),t.GlobalData.vocation&&(r+=1),t.GlobalData.legacy&&(r+=1)),i.a.createElement("div",{style:{width:"100%"}},r?i.a.createElement(up.Carousel,{utoPlay:!0,showArrows:!0,stopOnHover:!0,transitionTime:1,showStatus:!1},t.GlobalData.strategicStatement?i.a.createElement("div",{style:{height:"calc(100% - 33px)"}},i.a.createElement($s,{style:{height:"calc(100% - 33px)"}},i.a.createElement(Fa,{title:lt("$__strategicStatement",1),icon:"history_edu",color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"}}),i.a.createElement(Ys,{style:{display:"flex",alignItems:"center"}},i.a.createElement("div",{dangerouslySetInnerHTML:{__html:t.GlobalData.strategicStatement}})))):i.a.createElement(i.a.Fragment,null),t.GlobalData.message?i.a.createElement("div",{style:{height:"calc(100% - 33px)"}},i.a.createElement($s,{style:{height:"calc(100% - 33px)"}},i.a.createElement(Fa,{title:lt("$__presidentMessage",1),icon:"account_box",color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"}}),i.a.createElement(Ys,{style:{display:"flex",alignItems:"center"}},i.a.createElement("div",{dangerouslySetInnerHTML:{__html:t.GlobalData.message}})))):i.a.createElement(i.a.Fragment,null),t.GlobalData.vocation?i.a.createElement("div",{style:{height:"calc(100% - 33px)"}},i.a.createElement($s,{style:{height:"calc(100% - 33px)"}},i.a.createElement(Fa,{title:lt("$__vocation",1),icon:"spoke",color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"}}),i.a.createElement(Ys,{style:{display:"flex",alignItems:"center"}},i.a.createElement("div",{dangerouslySetInnerHTML:{__html:t.GlobalData.vocation}})))):i.a.createElement(i.a.Fragment,null),t.GlobalData.history?i.a.createElement("div",{style:{height:"calc(100% - 33px)"}},i.a.createElement($s,{style:{height:"calc(100% - 33px)"}},i.a.createElement(Fa,{title:lt("$__history",1),icon:"menu_book",color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"}}),i.a.createElement(Ys,{style:{display:"flex",alignItems:"center"}},i.a.createElement("div",{dangerouslySetInnerHTML:{__html:t.GlobalData.history}})))):i.a.createElement(i.a.Fragment,null),t.GlobalData.values?i.a.createElement("div",{style:{height:"calc(100% - 33px)"}},i.a.createElement($s,{style:{height:"calc(100% - 33px)"}},i.a.createElement(Fa,{title:lt("$__values",1),icon:"join_inner",color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"}}),i.a.createElement(Ys,{style:{display:"flex",alignItems:"center"}},i.a.createElement("div",{dangerouslySetInnerHTML:{__html:t.GlobalData.values}})))):i.a.createElement(i.a.Fragment,null),t.GlobalData.legacy?i.a.createElement("div",{style:{height:"calc(100% - 33px)"}},i.a.createElement($s,{style:{height:"calc(100% - 33px)"}},i.a.createElement(Fa,{title:lt("$__legacy",1),icon:"subtitles",color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"}}),i.a.createElement(Ys,{style:{display:"flex",alignItems:"center"}},i.a.createElement("div",{dangerouslySetInnerHTML:{__html:t.GlobalData.legacy}})))):i.a.createElement(i.a.Fragment,null)):i.a.createElement(i.a.Fragment,null),i.a.createElement(Ut,null,i.a.createElement(yp,null)),i.a.createElement(vo,{style:{paddingBottom:33}},i.a.createElement(xo,{xs:12,sm:12,md:12,lg:12,xl:12},i.a.createElement("div",{style:{position:"relative",backgroundColor:"rgba(250,250,250,0.7)",boxShadow:"0px 0px 3px 7px rgba(0,0,0,0.03)",marginBottom:33,overflow:"hidden"}},i.a.createElement("div",{style:{position:"relative",height:40,marginBottom:15}},i.a.createElement("div",{style:{position:"absolute",top:0,left:0,right:0,height:40,background:dt("ColumnTitleColor"),display:"flex",alignItems:"center",justifyContent:"space-between",color:dt("color"),padding:"0 15px"}},i.a.createElement("div",{style:{display:"flex"}},lt("$__lastNews","*")),i.a.createElement(At,{title:lt("$__save","*"),text:lt("$__viewAllNews"),color:"white",icon:"feed",transparent:!0,onClick:function(){s.push("bright-and-connected#tab/allNews")},size:"25px"}))),i.a.createElement(Ut,null,i.a.createElement($d,{max:6,horizontal:!0})))),i.a.createElement(xo,{xs:12,sm:12,md:12,lg:12,xl:12},i.a.createElement("div",{style:{position:"relative",backgroundColor:"rgba(250,250,250,0.7)",boxShadow:"0px 0px 3px 7px rgba(0,0,0,0.03)",marginBottom:33,overflow:"hidden"}},i.a.createElement("div",{style:{position:"relative",height:40,marginBottom:15}},i.a.createElement("div",{style:{position:"absolute",top:0,left:0,right:0,height:40,background:dt("ColumnTitleColor"),display:"flex",alignItems:"center",justifyContent:"space-between",color:dt("color"),padding:"0 15px"}},i.a.createElement("div",{style:{display:"flex"}},lt("$__lastAddRadar","*")),i.a.createElement(At,{title:lt("$__save","*"),text:lt("$__viewAllRadar"),color:"white",icon:"settings_input_antenna",transparent:!0,onClick:function(){s.push("bright-and-connected#tab/radar")},size:"25px"}))),i.a.createElement(Ut,null,i.a.createElement(jd,{max:6,horizontal:!0,noPagination:!0})))),i.a.createElement(xo,{xs:12,sm:12,md:12,lg:12,xl:12},i.a.createElement("div",{style:{position:"relative",backgroundColor:"rgba(250,250,250,0.7)",boxShadow:"0px 0px 3px 7px rgba(0,0,0,0.03)",marginBottom:33,overflow:"hidden"}},i.a.createElement("div",{style:{position:"relative",height:40,marginBottom:15}},i.a.createElement("div",{style:{position:"absolute",top:0,left:0,right:0,height:40,background:dt("ColumnTitleColor"),display:"flex",alignItems:"center",justifyContent:"space-between",color:dt("color"),padding:"0 15px"}},i.a.createElement("div",{style:{display:"flex"}},lt("$__lastAddInsights","*")),i.a.createElement(At,{title:lt("$__save","*"),text:lt("$__viewAllInsights"),color:"white",icon:xp.a,transparent:!0,onClick:function(){s.push("bright-and-connected#tab/insight-boards")},size:"25px"}))),i.a.createElement(Ut,null,i.a.createElement(_d,{max:6,horizontal:!0,noPagination:!0}))))))}))),wp=r(574),Ep=r.n(wp);var Op=function(e){var t=De.getState(),r=t.db,n=t.session,a=(r.dataType,e.data),o=Ve()().tz("America/Sao_Paulo").format("YYYY/MM/DD"),c=i.a.useState(null),l=Object(Be.a)(c,2),s=l[0],u=l[1],d=Object.keys(De.getState().db.cards).filter((function(e){return De.getState().db.cards[e]})).map((function(e){return De.getState().db.cards[e]})).filter((function(e){return e._users&&!e.checklist&&!e.deleted&&e._users[a._id]&&e._users[a._id].myDay&&(!e.private||e.private&&e._users[n._id])&&Ve()(new Date(1e3*parseInt(e._users[a._id].myDay))).tz("America/Sao_Paulo").format("YYYY/MM/DD")===o})).sort((function(e,t){return De.getState().db.orderByTitle&&"ASC"===De.getState().db.orderByTitlePosition&&e.name.toLowerCase().trim()<t.name.toLowerCase().trim()||De.getState().db.orderByTitle&&"DESC"===De.getState().db.orderByTitlePosition&&e.name.toLowerCase().trim()>t.name.toLowerCase().trim()?-1:De.getState().db.orderByTitle?0:!De.getState().db.orderByTitle&&String(e.order)&&String(t.order)&&String(e.order.low)&&String(t.order.low)&&parseInt(e.order.low)<parseInt(t.order.low)?-1:1})).map((function(e,t){return i.a.createElement(oc,{db:"cards",key:t,data:e,showStatus:!0,onlyOption:!0})}));return i.a.createElement("div",{style:{width:"100%",minHeight:"120px",backgroundColor:"#FFFFFF",boxShadow:"0 0 9px 3px rgba(0,0,0,0.2)",position:"relative"}},i.a.createElement("div",{style:{backgroundColor:dt("menu"),height:"43px",paddingLeft:"45px",fontSize:"12px",color:"#FFFFFF",fontWeight:"bold",display:"flex",alignItems:"center",justifyContent:"space-between"}},i.a.createElement("div",{style:{maxWidth:"calc(100% - 10px)",textOverflow:"ellipsis ",whiteSpace:"nowrap",overflow:"hidden"}},(a.name,a.name)," (",d.length,")")),!s||a.image&&a.image!==s?i.a.createElement("img",{style:{width:"37px",height:"37px",top:"3x",left:"3px",borderRadius:"50%",border:"solid 2px ".concat(dt("color")),zIndex:"5 !important",position:"absolute",backgroundColor:"".concat(dt("color"))},src:"".concat(a.image?a.image:Ep.a),onError:function(e){e.target.src="".concat(Ep.a)},onLoad:function(e){u("".concat(a.image?a.image:Ep.a))},width:"100%"}):i.a.createElement("div",{style:{width:"37px",height:"37px",top:"3px",left:"3px",borderRadius:"50%",border:"solid 2px ".concat(dt("color")),zIndex:"5 !important",position:"absolute",backgroundColor:"".concat(dt("color")),backgroundImage:'url("'.concat(s,'")'),backgroundSize:"cover",backgroundPosition:"center center"}}),i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{width:"100%",maxHeight:"calc(50vh - 90px)",overflowX:"auto"}},d)))};function jp(){jp=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Sp=Object($e.b)((function(e){return{store:e}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(pp)((function(e){var t=De.getState().db,r=t.dataType,n=t.users,a=Ve()().tz("America/Sao_Paulo").format("YYYY/MM/DD"),o=i.a.useState(!1),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=xt();if(i.a.useEffect((function(){return l||(De.getState().session.cards.adminViewLoader||d(),s(!0)),function(){e.reduxFunction("ASYNC","SET_SESSION",Object(h.a)(Object(h.a)({},De.getState().session),{},{cards:Object(h.a)(Object(h.a)({},De.getState().session.cards),{},{adminView:!1})}))}}),[]),u&&u.plan&&!u.planAdmin&&!u.planModerate)return i.a.createElement(i.a.Fragment,null);var d=function(){var t=Object(Me.a)(jp().mark((function t(r){return jp().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.reduxFunction("ASYNC","SET_SESSION",Object(h.a)(Object(h.a)({},De.getState().session),{},{cards:Object(h.a)(Object(h.a)({},De.getState().session.cards),{},{adminView:!De.getState().session.cards.adminView})}));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),p=Object.keys(De.getState().db.cards).filter((function(e){return De.getState().db.cards[e]&&r.filter((function(t){return t.name===De.getState().db.cards[e].type})).length>0})).map((function(e){return De.getState().db.cards[e]})),f=Object.keys(n).filter((function(e){return!n[e].deleted&&"user"===n[e].type&&(!n[e]._parent||""===n[e]._parent)&&p.filter((function(t){return t._users&&t._users[e]&&t._users[e].myDay&&Ve()(new Date(1e3*parseInt(t._users[e].myDay))).tz("America/Sao_Paulo").format("YYYY/MM/DD")===a})).length>0})).sort((function(e,t){return n[e].name<n[t].name?-1:n[e].name>n[t].name?1:0})).map((function(e){return n[e]}));return i.a.createElement("div",{style:{width:"100%"}},i.a.createElement(vo,null,i.a.createElement(xo,{xs:12,sm:12,md:12,lg:12,xl:12,style:{display:"flex",justifyContent:"space-between"}},i.a.createElement("div",{style:{fontSize:"33px",padding:"15px 0",fontWeight:"bold",color:dt("menu")}},lt("$__dayTasks",1))),f.map((function(e){return i.a.createElement(xo,{xs:12,sm:12,md:3,lg:3,xl:3,key:e._id,style:{marginBottom:"7px"}},i.a.createElement(Op,{data:e}))}))))})));var kp=Object($e.b)((function(e){return{history:e.db.history}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(pp)((function(){i.a.useEffect((function(){return function(){}}),[]);var e=window.location.hash.split("/");return e[0]=e[0].replace("#",""),i.a.createElement("div",null,i.a.createElement(md,null),"tab"===e[0]&&"resume"===e[1]&&i.a.createElement(Ut,null,i.a.createElement(_p,null)),"tab"===e[0]&&"dayTasks"===e[1]&&i.a.createElement(Ut,null,i.a.createElement(Sp,null)))}))),Lp=function(){return{contentCenter:{position:"absolute",top:"50%",left:"50%",zIndex:"3",transform:"translate(-50%,-50%)",textAlign:"center",color:"#FFF",padding:"0 15px",width:"100%",maxWidth:"880px"},title:Object(h.a)(Object(h.a)({},Or),{},{fontSize:"13.7em",color:"#FFF",letterSpacing:"14px",fontWeight:"700"}),subTitle:{fontSize:"2.25rem",marginTop:"0",marginBottom:"8px"},description:{fontSize:"1.125rem",marginTop:"0",marginBottom:"8px"}}},Cp=Object(Lt.a)(Lp);function Ip(){Ip=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Fp=Object($e.b)((function(e){return{showPrivate:e.controls.lockPrivate,history:e.db.history}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.db,n=t.session,a=i.a.useState(!1),o=Object(Be.a)(a,2),c=o[0],l=o[1],s=i.a.useState(null),u=Object(Be.a)(s,2),d=u[0],p=u[1],f=i.a.useState([]),m=Object(Be.a)(f,2),g=(m[0],m[1]),v=i.a.useState(0),y=Object(Be.a)(v,2),b=y[0],x=y[1],_=i.a.useState(10),w=Object(Be.a)(_,2),E=w[0],j=w[1],S=i.a.useState(!1),k=Object(Be.a)(S,2),L=k[0],C=(k[1],i.a.useState(F)),I=Object(Be.a)(C,2),F=I[0],T=(I[1],i.a.useState([])),N=Object(Be.a)(T,2),P=N[0],D=N[1],A=i.a.useState(0),$=Object(Be.a)(A,2),z=$[0],M=$[1],B=i.a.useState("created_at"),Y=Object(Be.a)(B,2),G=Y[0],R=Y[1],H=i.a.useState(!0),W=Object(Be.a)(H,2),U=W[0],V=W[1],q=i.a.useState(""),X=Object(Be.a)(q,2),J=X[0],K=X[1],Z=i.a.useState(!0),Q=Object(Be.a)(Z,2),ee=Q[0],te=Q[1],re=i.a.useState({}),ne=Object(Be.a)(re,2),ae=ne[0],oe=ne[1],ie=i.a.useState(""),ce=Object(Be.a)(ie,2),le=ce[0],se=ce[1],ue=i.a.useState({all:{name:lt("$__all",1),icon:"inventory",open:!1,size:0,type:"all"},users:{name:lt("$__users",1),open:!1,size:0,type:"user"},plans:{name:lt("$__plans",1),open:!1,size:0,type:"plan"},myCards:{name:lt("$__unlinkedCards",1),open:!1,size:0,type:"myTask"}}),de=Object(Be.a)(ue,2),pe=(de[0],de[1],window.location.hash.split("/"));pe[0]=pe[0].replace("#","");var fe=null;pe[0]&&36===pe[0].length&&De.getState().db.cards[pe[0]]&&De.getState().db.cards[pe[0]]._users&&De.getState().db.cards[pe[0]]._users[n._id]&&(fe=pe[0]),i.a.useEffect((function(){return he({id:fe}),Do(),function(){D([]),oe({}),te(!0)}}),[]),i.a.useEffect((function(){d&&me({id:d})}),[d]),i.a.useEffect((function(){x(0),te(!0),g([]),c||l(!0);var e=setTimeout((function(){J&&me({id:fe})}),1e3);return function(){return clearTimeout(e)}}),[J]),i.a.useEffect((function(){me({id:fe})}),[L,b,E,G,U]);var he=function(){var e=Object(Me.a)(Ip().mark((function e(t,r){var n,a;return Ip().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Do({ids:t&&t.id?[t.id]:[],childrens:!1,type:t.type?t.type:null});case 2:(n=e.sent)&&(a=r||ae,fe&&(a=Object(h.a)(Object(h.a)({},a),{},Object(O.a)({},fe,{name:De.getState().db.cards[fe].name,parent:De.getState().db.cards[fe]._parent,private:null,type:"plan",_id:fe,open:!0}))),n.map((function(e){a=Object(h.a)(Object(h.a)({},a),{},Object(O.a)({},e._id,Object(h.a)(Object(h.a)({},a[e._id]?a[e._id]:{}),e)))})),oe(a));case 4:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),me=function(){var e=Object(Me.a)(Ip().mark((function e(t){var r;return Ip().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ao({ids:t&&t.id?[t.id]:[],type:t&&t.type||"cards",limit:E,skip:b*E,asc:!U,orderBy:G||"created_at",search:J});case 2:(r=e.sent)&&(M(r&&r[0]&&r[0].total?parseInt(r[0].total):0),D(r),te(!1));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ge=[],ve=function(e){var t=G,r=U;G===e?r=!U:t=e,R(t),V(r)},ye=function(){var e=Object(Me.a)(Ip().mark((function e(t){var r,n,a,o,i,c,l=arguments;return Ip().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=l.length>1&&void 0!==l[1]&&l[1],n=t.id,a=void 0===n?null:n,o=t.type,i=void 0===o?null:o,c=ae,c=Object(h.a)(Object(h.a)({},c),{},Object(O.a)({},a,Object(h.a)(Object(h.a)({},c[a]),{},{open:r,loading:!0}))),0===Object.keys(ae).filter((function(e){return ae[e].parent===a})).length?he({id:a,type:i},c):oe(c);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),be=function(e,t){return i.a.createElement("div",{key:t,style:{cursor:"pointer",borderLeft:"solid 0.5px lightgray",paddingLeft:7},onClick:function(r){(!e.private||e.private&&De.getState().controls.lockPrivate)&&(ye({id:t},!ae[t]||!ae[t].open),p(t)),r.preventDefault(),r.stopPropagation()}},i.a.createElement(Io,{title:"".concat(e.private&&!De.getState().controls.lockPrivate?lt("$__private"):e.name),tooltipText:"".concat(e.private&&!De.getState().controls.lockPrivate?lt("$__private"):e.name),icon:(e.private&&!De.getState().controls.lockPrivate?"private_connectivity":e.type&&r&&r.dataType&&r.dataType.filter((function(t){return t.name===e.type}))[0].icon)||"$__topic",fontSize:"12px",color:e.private&&!De.getState().controls.lockPrivate?"lightgray":dt(d&&d===t?"color":"gray")}),ae[t]&&ae[t].open?xe(t):i.a.createElement(i.a.Fragment,null))},xe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return i.a.createElement("div",{style:{marginLeft:7}},Object.keys(ae).filter((function(t){return!e||e&&ae[t].parent===e})).length>0?Object.keys(ae).filter((function(t){return!e||e&&ae[t].parent===e})).sort((function(e,t){return ae[e].name.toLowerCase().trim()<ae[t].name.toLowerCase().trim()?-1:ae[e].name.toLowerCase().trim()>ae[t].name.toLowerCase().trim()?1:0})).map((function(e){return be(ae[e],e)})):i.a.createElement(i.a.Fragment,null))};return i.a.createElement("div",{style:e.expanded?{width:"calc(100% - 220px)",marginLeft:"220px"}:{width:"calc(100% - 0px)",marginLeft:"0px"}},i.a.createElement("div",{style:{backgroundColor:"#FFFFFF",position:"relative",padding:"7px 15px",float:"right",boxShadow:"0px 0px 7px 3px rgba(0,0,0,0.1)",display:"flex",alignItems:"center"}},i.a.createElement(La,{label:lt("$__search","*"),variant:"standard",autoFocus:!0,value:J,InputProps:{endAdornment:i.a.createElement(To.a,{position:"start"},i.a.createElement(kt,{color:dt("color")},"search")),onChange:function(e){K(e.target.value)},onKeyDown:function(e){}}}),i.a.createElement("div",{style:{position:"relative",display:"flex",alignItems:"center"}},i.a.createElement(At,{id:"sideModule_saveButton",title:lt("created_at"===G&&U?"$__mostRecent":"$__olderFirst",1),color:"created_at"===G?dt("color"):"gray",icon:"calendar_month",onClick:function(){ve("created_at")},size:"25px"}),"created_at"===G&&i.a.createElement("div",{style:Object(h.a)(Object(h.a)({position:"absolute"},U?{bottom:0}:{top:0}),{},{right:-5})},i.a.createElement(kt,{size:"15px",color:dt("menu"),style:{marginLeft:"-3px"}},U?"south":"north"))),i.a.createElement("div",{style:{position:"relative",display:"flex",alignItems:"center"}},i.a.createElement(At,{id:"sideModule_saveButton",title:lt("name"===G&&U?"$__nameDesc":"$__nameAsc",1),color:"name"===G?dt("color"):"gray",icon:"sort_by_alpha",onClick:function(){ve("name")},size:"25px"}),"name"===G&&i.a.createElement("div",{style:Object(h.a)(Object(h.a)({position:"absolute"},U?{bottom:0}:{top:0}),{},{right:-5})},i.a.createElement(kt,{size:"15px",color:dt("menu"),style:{marginLeft:"-3px"}},U?"south":"north")))),i.a.createElement("div",{style:{position:"relative",backgroundColor:"#FFFFFF",boxShadow:"0px 0px 7px 3px rgba(0,0,0,0.1)",clear:"both",marginTop:-10,minHeight:"calc(100vh - 150px)"}},i.a.createElement("div",{style:{position:"absolute",width:333,height:"100%",minHeight:1,padding:15,backgroundColor:"#f4f4f4",borderRight:"solid 0.77px lightGray",display:"flow-root"}},i.a.createElement("div",{style:{display:"flex",marginTop:-10}},i.a.createElement(Io,{title:lt("$__folders",1),icon:"folder",fontSize:"20px",color:dt("menu")}),i.a.createElement(La,{label:lt("$__search","*"),variant:"standard",autoFocus:!0,value:le,InputProps:{endAdornment:i.a.createElement(To.a,{position:"start"},i.a.createElement(kt,{color:dt("lightgray")},"search")),onChange:function(e){se(e.target.value)},onKeyDown:function(e){}}})),i.a.createElement("div",{style:{position:"relative",height:"calc(100% - 33px)",overflowX:"auto",backgroundColor:"rgba(250,250,250,0.9)",borderRadius:"solid 0.5px rgba(0,0,0,0.1)",padding:15}},Object.keys(ae).filter((function(e){return((!pe[0]||pe[0]&&36!==pe[0].length)&&!ae[e].parent||pe&&pe[0]&&36===pe[0].length&&ae[e]._id===pe[0])&&(""===le||le&&ae[e].name.toLowerCase().indexOf(le.toLowerCase().trim())>-1)})).sort((function(e,t){return ae[e].name.toLowerCase().trim()<ae[t].name.toLowerCase().trim()?-1:ae[e].name.toLowerCase().trim()>ae[t].name.toLowerCase().trim()?1:0})).map((function(e){return be(ae[e],e)})))),i.a.createElement("div",{style:{position:"relative",float:"left",marginLeft:333,width:"calc(100% - 333px)",overflowY:"auto"}},i.a.createElement("div",{style:{position:"relative",width:"100%",padding:"15px"}},i.a.createElement("div",{style:{position:"relative",float:"left",minWidth:177}},i.a.createElement(Io,{title:lt("$__files",1),icon:"cloud",fontSize:"20px",color:dt("menu")})),i.a.createElement("div",{style:{position:"relative",float:"right",display:"flex",alignItems:"center",marginTop:-10}},lt("$__page")," ",b+1," ",lt("$__of")," ",Math.ceil(z/E),i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},i.a.createElement(ad.a,{component:"div",count:z,page:b,onPageChange:function(e,t){x(t)},rowsPerPage:E,onRowsPerPageChange:function(e){j(parseInt(e.target.value,10))},labelRowsPerPage:lt("$__filesPerPage")})))),ee?i.a.createElement(Fo,null):P&&P.length>0?P.map((function(t,r){ge.push(t.data);var a=Object(h.a)(Object(h.a)({},t.data),{},{createdBy:t.createdBy,in:t.in});return i.a.createElement("div",{key:"file_".concat(a._id).concat(r),style:{position:"relative",width:"100%",paddingTop:"7px",paddingLeft:"15px",clear:"both"}},i.a.createElement(Da,{data:a,openLightBox:function(){return function(t){e.reduxFunction("ASYNC","LIGHTBOX",{open:!0,files:ge,file:t})}(a._id)},admin:!!(a.createdBy._id===n._id||a.in._id===n._id||a.access&&parseInt(a.access)>2)}),i.a.createElement("div",{style:{clear:"both"}}))})):i.a.createElement(i.a.Fragment,null),z>10?i.a.createElement("div",{style:{position:"relative",width:"100%",padding:"15px",display:"flex",alignItems:"center",justifyContent:"center"}},lt("$__page")," ",b+1," ",lt("$__of")," ",Math.ceil(z/E),i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},i.a.createElement(ad.a,{component:"div",count:z,page:b,onPageChange:function(e,t){x(t)},rowsPerPage:E,onRowsPerPageChange:function(e){j(parseInt(e.target.value,10))},labelRowsPerPage:lt("$__filesPerPage")}))):i.a.createElement(i.a.Fragment,null)),i.a.createElement("div",{style:{clear:"both"}})))})),Tp=r(715),Np=r.n(Tp),Pp=(r(1509),r(695)),Dp=r.n(Pp);function Ap(){Ap=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}r(168).config();var $p="true"===String("true")?"".concat(String("CHEexohmzAHNEotLM0O.WzoOsvjRwlKh/sKKI2AFWaeL7zo4hC")):"".concat(String("qfUeuPdCjDALnPLSJvOVP3tffkxXKETIr9fzoj/kU6acJvFyc")),zp=Object(Lt.a)(Uu);var Mp=Object($e.b)((function(){return{}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=i.a.useState({email:null,password:null}),r=Object(Be.a)(t,2),n=r[0],a=r[1],o=i.a.useState(null),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.useState(!1),d=Object(Be.a)(u,2),p=d[0],f=d[1],m=i.a.useState(null),g=Object(Be.a)(m,2),v=g[0],y=g[1],b=i.a.useState(!1),x=Object(Be.a)(b,2),_=x[0],w=x[1],E=zp(),O=function(){var t=Object(Me.a)(Ap().mark((function t(){var r,a,o,i;return Ap().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(-1!==window.location.origin.indexOf("localhost")||-1!==window.location.origin.indexOf("hom2022")||-1!==window.location.origin.indexOf("a1b2c3d4")||-1!==window.location.origin.indexOf("192.168")||!(window.location.origin.indexOf("sonne.machen")>-1&&-1===n.email.indexOf("@sonne.global")||-1===window.location.origin.indexOf("sonne.machen")&&n.email.indexOf("@sonne.global")>-1)){t.next=4;break}e.callback({fn:"alert",variant:"warning",horizontal:"center",message:"".concat(lt("$__emailDomainNotPermitedForThisAddress",1))}),t.next=33;break;case 4:if(n.email){t.next=8;break}e.callback({fn:"alert",variant:"warning",horizontal:"center",message:"".concat(lt("$__alertLoginEmptyEmail",1))}),t.next=33;break;case 8:if(n.password){t.next=12;break}e.callback({fn:"alert",variant:"warning",horizontal:"center",message:"".concat(lt("$__alertLoginEmptyPassword",1))}),t.next=33;break;case 12:return w(!0),t.next=15,Np.a.hash(String(n.password),10);case 15:return r=t.sent,t.next=18,Np.a.hash(String(n.password),10);case 18:if(a=t.sent,!(o=Object(Br.encode)("".concat(a,"//").concat($p)))){t.next=32;break}return t.prev=21,t.next=24,Sn.post("/Login",Object(Br.encode)(Object(Br.encode)(JSON.stringify({lp:o,login:n.email,password:Object(Br.encode)("".concat(r,"///").concat(Object(Br.encode)(n.password),"///").concat(a))}))));case 24:(i=t.sent)&&(i.data&&400===i.data.code?e.callback({fn:"alert",variant:"warning",horizontal:"center",message:"".concat(lt("$__".concat(i.data.error),1))}):i&&i.data&&i.data.twoFactor?(y(i.data.token),f(!0)):i.data.token&&(localStorage.setItem("TOKEN",i.data.token),e.callback&&e.callback({fn:"login",token:i.data.token}))),t.next=32;break;case 28:t.prev=28,t.t0=t.catch(21),console.log(t.t0),e.callback({fn:"alert",variant:"warning",horizontal:"center",message:"".concat(lt("$__alertServerConectionLogin",1))});case 32:setTimeout((function(){w(!1)}),1500);case 33:case"end":return t.stop()}}),t,null,[[21,28]])})));return function(){return t.apply(this,arguments)}}(),j=function(){var t=Object(Me.a)(Ap().mark((function t(){var r;return Ap().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(w(!0),l&&(!l||6===l.length)){t.next=5;break}ft({message:lt("$__invalidToken",1),variant:"warning",persist:!1,horizontal:"right"}),t.next=10;break;case 5:return t.next=7,Sn.post("/M_User_TwoFactor",{action:"verify",code:l,token:v});case 7:(r=t.sent)&&r.data&&r.data.result?(localStorage.setItem("TOKEN",v),e.callback&&e.callback({fn:"login",token:v})):ft({message:lt("$__invalidToken",1),variant:"warning",persist:!1,horizontal:"right"}),s(null);case 10:setTimeout((function(){w(!1)}),1500);case 11:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),S=function(){var t=Object(Me.a)(Ap().mark((function t(r){var n;return Ap().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r){t.next=4;break}e.callback({fn:"alert",message:lt("$__loginAlertRecoveryEmailEmpty")}),t.next=14;break;case 4:return t.prev=4,t.next=7,Sn.get("/M_User_RecoveryPass/?email=".concat(r));case 7:(n=t.sent)&&n.data?e.callback({fn:"alert",message:lt("$__loginAlertRecoveryEmailSended")}):e.callback({fn:"alert",message:lt("$__loginAlertRecoveryInvalidEmail")}),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(4),e.callback({fn:"alert",message:lt("$__loginAlertRecoveryError")});case 14:case"end":return t.stop()}}),t,null,[[4,11]])})));return function(e){return t.apply(this,arguments)}}();return i.a.createElement("div",{className:E.container},i.a.createElement(vo,{style:{display:"flex",justifyContent:"center"}},i.a.createElement(xo,{xl:4,lg:4,md:4,sm:12,xs:12},i.a.createElement($s,{db:"cards",login:!0},i.a.createElement(Ws,{className:"".concat(E.cardHeader," ").concat(E.textCenter),color:"primary",style:{background:dt("ColumnTitleColor"),boxShadow:"0 4px 20px 0 rgba(15,18,35,0.14), 0 7px 10px -5px rgba(15,18,35,0.4)"}},i.a.createElement("h4",{className:E.cardTitle},lt("$__login"))),i.a.createElement(Ys,null,p?i.a.createElement(i.a.Fragment,null,i.a.createElement("fieldset",null,i.a.createElement("legend",null,lt("$__token",1)),i.a.createElement(La,{labelText:"token",id:"token_to_access",name:"token_to_access",formControlProps:{fullWidth:!0},value:l,inputProps:{onKeyDown:function(e){},onChange:function(e){s(e.target.value)},endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(Ke.a,{className:E.inputAdornmentIcon},"pin")),type:"number",autoComplete:!1},autoComplete:"new-password"}))):i.a.createElement(i.a.Fragment,null,i.a.createElement(Yu,{labelText:lt("$__email"),id:"email",formControlProps:{fullWidth:!0},inputProps:{onChange:function(e){a(Object(h.a)(Object(h.a)({},n),{},{email:e.target.value}))},onLoad:function(e){a(Object(h.a)(Object(h.a)({},n),{},{email:e.target.value}))},endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(Dp.a,{className:E.inputAdornmentIcon}))}}),i.a.createElement(Yu,{labelText:lt("$__password"),id:"password",formControlProps:{fullWidth:!0},inputProps:{onChange:function(e){a(Object(h.a)(Object(h.a)({},n),{},{password:e.target.value}))},onLoad:function(e){a(Object(h.a)(Object(h.a)({},n),{},{password:e.target.value}))},onKeyDown:function(e){13===e.keyCode&&O()},endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(Ke.a,{className:E.inputAdornmentIcon},"lock_outline")),type:"password",autoComplete:"off"}}),i.a.createElement(rn,{icon:"lock",text:lt("$__recoveryPass","*"),reverse:!0,style:{float:"right"},onClick:function(){S(n.email)}}))),i.a.createElement(Wu,{className:E.justifyContentCenter},p?i.a.createElement(Cr,{style:{backgroundColor:_?"gray":"#c0b283",color:"#FFFFFF"},simple:!0,size:"lg",block:!0,onClick:function(){return j()}},lt("$__validateTokenAndSigin"),_?i.a.createElement("div",{style:{position:"absolute",bottom:0,left:0,right:0}},i.a.createElement(Fo,null)):i.a.createElement(i.a.Fragment,null)):i.a.createElement(Cr,{style:{backgroundColor:_?"gray":dt("menu"),color:"#FFFFFF"},simple:!0,size:"lg",block:!0,onClick:function(){return O()}},lt("$__sigin"),_?i.a.createElement("div",{style:{position:"absolute",bottom:0,left:0,right:0}},i.a.createElement(Fo,null)):i.a.createElement(i.a.Fragment,null)))))))})),Bp=Object(Lt.a)(Lp);var Yp=Object(Lt.a)(Lp);var Gp,Rp,Hp={container:{borderRadius:"2px",marginRight:"7px",marginLeft:"7px",marginBottom:"15px",height:"min-content",width:"100%"},title:Object(h.a)(Object(h.a)({},rr),{},{padding:"3px 0px",width:"100%",margin:"0px",background:dt("ColumnTitleColor"),"&$reverse":{}}),reverse:{flexDirection:"row-reverse"},cardList:{width:"calc(100% - 6px)",padding:"0px",minHeight:"30px","&::-webkit-scrollbar-track":{borderRadius:"0px"},"&::-webkit-scrollbar":{width:"7px"},"&::-webkit-scrollbar-thumb":{background:dt("medium"),opacity:"0.5 !important",borderRadius:"0px"}},button:{padding:"3px auto",cursor:"pointer",alignItems:"center",display:"flex",opacity:1,transition:"visibility 0.1s, opacity 0.5s linear"},cardAdd:{position:"relative",border:"0.5px solid ".concat(dt("light")),borderRadius:"2px",display:"block",backgroundColor:"#FFFFFF",boxShadow:"0px 0px 10px rgba(0,0,0,0.1)",overflow:"hidden",padding:"3px"}};function Wp(){Wp=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Up,Vp=Xe.default.div(Gp||(Gp=Object(ze.a)(["\n margin:0 7px;\n min-width:180px;\n ","\n @media(min-width: 960px) {\n position:relative;\n max-height:",";\n \n ","\n }\n @media(max-width: 959px) {\n float:left;\n position: relative;\n }\n @media(max-width: 599px) {\n float:left;\n position: relative;\n }\n "])),(function(e){return e.columnStyle&&e.columnStyle.width?"width:calc(".concat(e.columnStyle.width," - 14px);"):"width:calc(100% - 14px);"}),(function(e){return e.columnStyle&&e.columnStyle.maxHeight?e.columnStyle.maxHeight:"calc(100% - 0px)"}),(function(e){return e.inLine?"display:block;\n ":"margin-bottom:0px !important;\n ".concat((function(e){return e.columnStyle&&e.columnStyle.width?"width:".concat(e.columnStyle.width,";"):"width:100%;"}),"\n ")})),qp=(Xe.default.div(Rp||(Rp=Object(ze.a)(["\nposition:relative;\nheight:100%;\nwidth:100%;\nmax-height:",";\n",";\n ",";\n","\n"])),(function(e){return e.columnStyle&&e.columnStyle.maxHeight?e.columnStyle.maxHeight:"calc(100% - 30px)"}),(function(e){return e.columnStyle&&e.columnStyle.maxWidth?e.columnStyle.maxWidth:"250px"}),(function(e){return e.isDraggingOver?"background-color:".concat(dt("color"),"; opacity:0.5;"):""}),(function(e){return e.inLine?"\n display:table;\n margin-bottom:33px":"display:block;\n min-height: 150px !important;\n padding-bottom:15px;\n overflow-y: auto;\n "})),Object($e.b)((function(e){return{search:e.search,dbCards:e.db.cards,groupByColor:e.db.groupByColor,orderByTitle:e.db.orderByTitle,orderByTitlePosition:e.db.orderByTitlePosition,cardsExpanded:e.db.cardsExpanded}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Hp)(Object(o.memo)((function(e){Ve()().tz("America/Sao_Paulo").format("YYYY/MM/DD");var t=De.getState(),r=t.search,n=t.session,a=t.db,c=e.classes,l=i.a.useState(""),s=Object(Be.a)(l,2),u=s[0],d=s[1],p=i.a.useState(!1),f=Object(Be.a)(p,2),m=f[0],g=f[1],v=Object(o.useRef)({}),y=Object(o.useRef)({}),b=Object(o.useRef)({}),x=Object(o.useRef)({});i.a.useEffect((function(){e.groupByColor||(x.current={})}),[e.groupByColor]);var _=window.location.hash.split("/");_[0]=_[0].replace("#",""),36!==_[0].length&&(_[0]=null);var w=e.cards;r&&r.cards&&(r.cards.startDate||r.cards.endDate)&&(w=w.filter((function(e){return!!(e&&r.cards.startDate&&e.startDate&&e.startDate>=r.cards.startDate&&r.cards.endDate&&e.endDate&&e.endDate<=r.cards.endDate)})).map((function(e){return e}))),r.text&&(w=w.filter((function(e){return!!(e&&e.name&&e.name.toLowerCase().indexOf(r.text.toLowerCase())>-1)})).map((function(e){return e}))),w=(w=w.filter((function(e){return!(e.status&&!(e&&e.status&&r.cards.status[e.status]))})).map((function(e){return e}))).filter((function(e){return!!(e&&e.priority&&r.cards.priority[e.priority]||r.cards.priority.null&&!e.priority)})).map((function(e){return e})),r.users.selected&&Object.keys(r.users.selected).length>0&&(w=w.filter((function(e){if(e&&e._users&&Object.keys(e._users).filter((function(e){return r.users.selected[e]})).length>0)return!0})).map((function(e){return e}))),Object.keys(r.units.selected).length>0&&(w=r.units.selected.unassigned?w.filter((function(e){if(!e._planId||e._planId&&a.cards[e._planId]&&!a.cards[e._planId].client)return!0})).map((function(e){return e})):w.filter((function(e){var t=!1;return Object.keys(a.cards).filter((function(e){if(a.cards[e].client&&r.units.selected[a.cards[e].client])return!0})).map((function(r){e._planId&&e._planId===a.cards[r]._id&&(t=!0)})),t})).map((function(e){return e}))),Object.keys(r.groups.selected).length>0&&(w=r.groups.selected.unassigned?w.filter((function(e){if(!e._planId||e._planId&&a.cards[e._planId]&&!a.cards[e._planId].client)return!0})).map((function(e){return e})):w.filter((function(e){var t=!1;return Object.keys(a.cards).filter((function(e){if(a.cards[e].client&&r.groups.selected[a.cards[e].client])return!0})).map((function(r){e._planId&&e._planId===a.cards[r]._id&&(t=!0)})),t})).map((function(e){return e}))),Object.keys(r.plans.selected).filter((function(e){return e})).length>0&&(w=w.filter((function(e){if(r.plans.selected[e._planId])return!0})).map((function(e){return e}))),r.tags.length>0&&(w=w.filter((function(e){return e._tags&&e._tags.length>0&&e._tags.filter((function(e){var t=!1;return r.tags.map((function(r){r.value===e.value&&(t=!0)})),t})).length>0})).map((function(e){return e})));var E=String(n.dashboard.period).replace("$__last","");E=E.replace("Days","");var j=Ve()(new Date).tz("America/Sao_Paulo").subtract(parseInt(E),"d").format("YYYY-MM-DDT00:00"),S=Ve()(new Date).tz("America/Sao_Paulo").format("YYYY-MM-DDT23:59");e&&e.periodFilter&&(w=w.filter((function(e){if("completed"===e.status&&e.completed_at&&(e.completed_at.low&&Ve()(new Date(1e3*e.completed_at.low)).tz("America/Sao_Paulo").format("YYYY-MM-DDT23:59")<=S&&Ve()(new Date(1e3*e.completed_at.low)).tz("America/Sao_Paulo").format("YYYY-MM-DDT00:00")>=j||e.completed_at&&!e.completed_at.low&&Ve()(new Date(1e3*e.completed_at)).tz("America/Sao_Paulo").format("YYYY-MM-DDT23:59")<=S&&Ve()(new Date(1e3*e.completed_at)).tz("America/Sao_Paulo").format("YYYY-MM-DDT00:00")>=j)||"completed"!==e.status&&e.updated_at&&(e.updated_at.low&&Ve()(new Date(1e3*e.updated_at.low)).tz("America/Sao_Paulo").format("YYYY-MM-DDT23:59")<=S&&Ve()(new Date(1e3*e.updated_at.low)).tz("America/Sao_Paulo").format("YYYY-MM-DDT00:00")>=j||e.updated_at&&!e.updated_at.low&&Ve()(new Date(1e3*e.updated_at)).tz("America/Sao_Paulo").format("YYYY-MM-DDT23:59")<=S&&Ve()(new Date(1e3*e.updated_at)).tz("America/Sao_Paulo").format("YYYY-MM-DDT00:00")>=j))return!0})).map((function(e){return e}))),e.showDeleted||De.getState().controls.deleted||(w=w.filter((function(e){return!e.deleted})).map((function(e){return e}))),e.orderByTitle&&(w=w.sort((function(t,r){var n,a,o,i,c,l,s,u,d="ASC"===e.orderByTitlePosition?null===t||void 0===t||null===(n=t.name)||void 0===n||null===(a=n.toLowerCase())||void 0===a?void 0:a.trim():null===r||void 0===r||null===(o=r.name)||void 0===o||null===(i=o.toLowerCase())||void 0===i?void 0:i.trim(),p="ASC"===e.orderByTitlePosition?null===r||void 0===r||null===(c=r.name)||void 0===c||null===(l=c.toLowerCase())||void 0===l?void 0:l.trim():null===t||void 0===t||null===(s=t.name)||void 0===s||null===(u=s.toLowerCase())||void 0===u?void 0:u.trim();if(e.groupByColor){if(t&&t._parent&&t._parent!==_[0]){var f=aa(t)||{color:"rgba(255, 255, 255, 1)"};!f.parentId&&t._parent&&(f.parentId=t._parent),f.parentId&&De.getState().db.cards[f.parentId]&&(d="".concat(De.getState().db.cards[f.parentId].name.toLowerCase().trim()," - ").concat(t.name.toLowerCase().trim()))}if(r&&r._parent&&r._parent!==_[0]){var h=aa(r)||{color:"rgba(255, 255, 255, 1)"};!h.parentId&&r._parent&&(h.parentId=r._parent),h.parentId&&De.getState().db.cards[h.parentId]&&(p="".concat(De.getState().db.cards[h.parentId].name.toLowerCase().trim()," - ").concat(r.name.toLowerCase().trim()))}}return d<p?-1:d>p?1:0})).map((function(e){return e}))),e.orderByTitle||(w=w.sort((function(t,r){var n,a,o=(null===t||void 0===t||null===(n=t.order)||void 0===n?void 0:n.low)||!isNaN(null===t||void 0===t?void 0:t.order)||String(t.order)?parseInt(t.order):0,i=(null===r||void 0===r||null===(a=r.order)||void 0===a?void 0:a.low)||!isNaN(null===r||void 0===r?void 0:r.order)||String(r.order)?parseInt(r.order):0;if(e.groupByColor){if(t&&t._parent&&t._parent!==_[0]){var c=aa(t)||{color:"rgba(255, 255, 255, 1)"};if(!c.parentId&&t._parent&&(c.parentId=t._parent),c.parentId&&De.getState().db.cards[c.parentId]){var l=0;De.getState().db.cards[c.parentId].order&&"string"===typeof De.getState().db.cards[c.parentId].order&&(l=De.getState().db.cards[c.parentId].order),De.getState().db.cards[c.parentId].order&&"object"===typeof De.getState().db.cards[c.parentId].order&&(l=De.getState().db.cards[c.parentId].order.low);for(var s=String(l).length;s<10;s++)l="0".concat(l);var u="object"===typeof t.order?String(t.order.low):String(t.order||0);for(s=String(u).length;s<10;s++)u="0".concat(u);o="".concat(l,"-").concat(t.name.toLowerCase().trim())}}if(r&&r._parent&&r._parent!==_[0]){var d=aa(r)||{color:"rgba(255, 255, 255, 1)"};if(!d.parentId&&r._parent&&(d.parentId=r._parent),d.parentId&&De.getState().db.cards[d.parentId]){var p=0;De.getState().db.cards[d.parentId].order&&"string"===typeof De.getState().db.cards[d.parentId].order&&(p=De.getState().db.cards[d.parentId].order),De.getState().db.cards[d.parentId].order&&"object"===typeof De.getState().db.cards[d.parentId].order&&(p=De.getState().db.cards[d.parentId].order.low);for(s=String(p).length;s<10;s++)p="0".concat(p);var f="object"===typeof r.order?String(r.order.low):String(r.order||0);for(s=String(f).length;s<10;s++)f="0".concat(f);i="".concat(p,"-").concat(r.name.toLowerCase().trim())}}}return o<i?-1:o>i?1:0})).map((function(e){return e})));var k=function(){var t=Object(Me.a)(Wp().mark((function t(){return Wp().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:De.getState().functions.socket.emit("data",{module:"cards",method:"post",action:"add"},{_parent:e.selectedParent?e.selectedParent:_[0]?_[0]:null,_planId:_[0]&&36===_[0].length?_[0]:null,name:u,type:e.typeAdd?e.typeAdd:e.columnId.length<36?e.columnId:null,status:"notStarted"}),d("");case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),L=lt(e.column.name,1),C=null,I={};De.getState().db.cards[_[0]]&&De.getState().db.cards[_[0]].customColumns&&(I=JSON.parse(De.getState().db.cards[_[0]].customColumns)),I&&I[e.column.name.replace("$__","")]&&I[e.column.name.replace("$__","")].name&&(L=lt(I[e.column.name.replace("$__","")].name,1)),I&&I[e.column.name.replace("$__","")]&&I[e.column.name.replace("$__","")].icon&&(C=lt(I[e.column.name.replace("$__","")].icon,1));var F=[];function T(t){var r=t.index,n=t.style,a=w[r],o="",c="";if(e.groupByColor&&!a.color){var l=aa(a);!l.parentId&&a._parent&&a._parent!==_[0]&&(l.parentId=a._parent),l&&l.parentId&&-1===F.indexOf(l.parentId)&&De.getState().db.cards[l.parentId]&&(o=De.getState().db.cards[l.parentId].name,c=l.color,F.push(l.parentId),x.current=Object(h.a)(Object(h.a)({},x.current),{},Object(O.a)({},"".concat(a._id,"_").concat(r),{title:De.getState().db.cards[l.parentId].name,color:l.color||"#FFFFFF"})))}return i.a.createElement(i.a.Fragment,null,i.a.createElement(di.b,{draggableId:a._id,index:r,key:a._id,isDragDisable:e.isDragDisable||!1},(function(t,l){var s;return i.a.createElement("div",{style:n},e.groupByColor&&x.current["".concat(a._id,"_").concat(r)]?i.a.createElement("div",{style:{width:"100%",padding:3,color:"gray",marginTop:17,borderBottom:"solid 3px ".concat((null===(s=x.current["".concat(a._id,"_").concat(r)])||void 0===s?void 0:s.color)||"")}},x.current["".concat(a._id,"_").concat(r)].title):i.a.createElement(i.a.Fragment,null),i.a.createElement(N,{separator:e.groupByColor&&o?{title:o,color:c}:null,provided:t,isDragging:null===l||void 0===l?void 0:l.isDragging,index:r,snapshot:l}))})))}function N(t){var r,n=t.provided,a=t.index,o=t.snapshot,c=w[a];return i.a.createElement("div",Object.assign({},n.draggableProps,n.dragHandleProps,{ref:n.innerRef}),i.a.createElement(oc,{separator:e.groupByColor&&(null===x||void 0===x||null===(r=x.current["".concat(c._id,"_").concat(a)])||void 0===r?void 0:r.title)?null===x||void 0===x?void 0:x.current["".concat(c._id,"_").concat(a)]:null,data:c,db:e.db,showOrder:e.showOrder||!1,showSelected:e.showSelected||!1,locked:e.locked||!1,viewButton:e.viewButton||!1,showConnectedIn:!!e.showConnectedIn,isDragging:o.isDragging&&!o.isDropAnimating,snapshot:o,cardColorPicker:!!e.cardColorPicker,manualExpanded:(null===b||void 0===b?void 0:b.current["".concat(c._id,"_").concat(a)])||!1,onResize:function(e){!function(e,t){var r;(null===v||void 0===v||null===(r=v.current)||void 0===r?void 0:r.resetAfterIndex)&&v.current.resetAfterIndex(0);y.current=Object(h.a)(Object(h.a)({},y.current),{},Object(O.a)({},e,t))}("".concat(c._id,"_").concat(a),e)},onExpand:function(e){(!b.current["".concat(c._id,"_").concat(a)]&&e||"false"===String(e)&&b.current["".concat(c._id,"_").concat(a)])&&function(e,t){var r;(null===v||void 0===v||null===(r=v.current)||void 0===r?void 0:r.resetAfterIndex)&&v.current.resetAfterIndex(0);b.current=Object(h.a)(Object(h.a)({},b.current),{},Object(O.a)({},e,t))}("".concat(c._id,"_").concat(a),e)}}))}function P(e){var t=w[e];return y.current["".concat(t._id,"_").concat(e)]+7||67}return i.a.createElement(di.b,{draggableId:e.columnId?String(e.columnId):"NOT_ID_SENDED",index:e.index},(function(t){return i.a.createElement(Vp,Object.assign({},!e.isDropDisabled&&t.draggableProps,e,{ref:t.innerRef}),i.a.createElement("div",Object.assign({},t.draggableProps,t.dragHandleProps,{style:{display:"none"}})),i.a.createElement("div",!e.isDropDisabled&&t.dragHandleProps,i.a.createElement(Io,Object.assign({title:L,icon:C||e.column.icon||"topic",color:dt("menu"),style:{padding:"7px"}},_.length>0&&_[1]&&"overview"===_[1]&&De.getState().db.cards[_[0]]&&De.getState().db.cards[_[0]].planType&&"operational"===De.getState().db.cards[_[0]].planType&&De.getState().db.cards[_[0]]._users&&De.getState().db.cards[_[0]]._users[n._id]&&De.getState().db.cards[_[0]]._users[n._id].access&&parseInt(De.getState().db.cards[_[0]]._users[n._id].access)>3?{permitIcon:!0,editable:!0,onEdit:function(t){pa(Object(h.a)(Object(h.a)({},e),{},{data:{_id:_[0]}}),{customColumns:JSON.stringify(Object(h.a)(Object(h.a)({},De.getState().db.cards[_[0]]&&De.getState().db.cards[_[0]].customColumns?JSON.parse(De.getState().db.cards[_[0]].customColumns):{}),{},Object(O.a)({},e.column.name.replace("$__",""),t)))})},placeholder:lt("$__columnName")}:{},{customButtons:[e.columnsSettings&&{name:"settings",icon:"more_horiz",color:dt("color"),onClick:function(){return console.log("s")},show:"hover"}],periodFilter:!(!e||!e.periodFilter)}))),i.a.createElement(di.c,{droppableId:e.columnId?String(e.columnId):"NOT_ID_SENDED",type:"card",isDropDisabled:e.column.isDropDisabled,direction:"".concat(e.inLine?"horizontal":"vertical"),isCombineEnabled:e.isCombineEnabled,mode:"virtual",renderClone:function(e,t,r){return i.a.createElement(N,{provided:e,isDragging:null===t||void 0===t?void 0:t.isDragging,index:r.source.index,snapshot:t,style:{margin:0}})}},(function(t){return i.a.createElement("div",{ref:t.innerRef,style:{width:"100%",height:e.inLineAdd?m?"calc(100% - 80px)":"calc(100% - 60px)":"calc(100% - 10px)"}},i.a.createElement(zc.a,{style:{width:"100%",height:"100%"}},(function(e){var r=e.height,n=e.width;return i.a.createElement($c.b,{className:"List",height:r,width:n,ref:v,itemCount:w.length,itemSize:P,outerRef:t.innerRef,itemData:w,style:{height:"100%"}},T)})))})),e.inLineAdd&&!m&&i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",padding:"7px"}},i.a.createElement(rn,{text:lt("$__add","*"),icon:"add_box",iconColor:dt("medium"),onClick:function(){g(!m)}})),e.inLineAdd&&m&&i.a.createElement("div",{className:c.cardAdd,style:{position:"relative",float:"left",width:"100%",padding:"7px",display:"flex",alignItems:"center"}},i.a.createElement("div",{style:{width:"calc(100% - 50px)",display:"flex"}},i.a.createElement(La,{label:lt("$__nameOfCard"),variant:dt("fieldVariant"),name:"name",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",onChange:function(e){d(e.target.value)},onBlur:function(e){""===e.target.value&&g(!m)},onKeyDown:function(e){13===e.keyCode&&u&&k(),27===e.keyCode&&(g(!m),d(""))}},autoFocus:!0,value:u,placeholder:lt("$__titleOfCard_placeholder")})),i.a.createElement("div",{style:{display:"flex"}},i.a.createElement("div",{className:c.button,onClick:function(){return k()}},i.a.createElement(kt,{color:"green",icon:"save",title:lt("$__save","*"),size:e.actionsSize||"25px"})),i.a.createElement("div",{className:c.button,onClick:function(){g(!m),d("")}},i.a.createElement(kt,{color:dt("medium"),icon:"cancel",title:lt("$__cancel","*"),size:e.actionsSize||"25px"})))))}))})))));function Xp(){Xp=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Jp=Xe.default.div(Up||(Up=Object(ze.a)(["\nheight:100%;\n","\n @media(max-width: 959px) {\n display: contents !important;\n width: -webkit-fill-available;\n height:auto;\n }\n "])),(function(e){return e.inLine?"display: block;\n width: -webkit-fill-available;\n position:relative;\n ".concat(e.style):" display: flex;\n width: 100%;\n ".concat(e.style,"\n @media(min-width: 960px) {\n display: flex;\n }\n ")})),Kp=Object($e.b)((function(e,t){return{}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState().db;i.a.useEffect((function(){}),[]);var r=function(){var r=Object(Me.a)(Xp().mark((function r(n){var a,o,i,c,l,s,u,d,p,f,m,g;return Xp().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(a=De.getState().functions.socket,o=n.destination,i=n.source,c=n.draggableId,l=t.cards,!n.combine){r.next=5;break}return r.abrupt("return");case 5:if(o){r.next=7;break}return r.abrupt("return",!1);case 7:if(o.droppableId!==i.droppableId||o.id!==i.index){r.next=9;break}return r.abrupt("return",!1);case 9:if(s=i.droppableId,u=o.droppableId,d=Array.from(e.cards.filter((function(e){return e.status===s})).sort((function(e,t){return e.order&&t.order&&String(e.order.low)&&String(t.order.low)&&parseInt(e.order.low)<parseInt(t.order.low)?-1:1})).map((function(e){return e._id}))),s!==u||De.getState().db.orderByTitle){r.next=21;break}return(p=Array.from(e.cards.filter((function(e){return e.status===s})).sort((function(e,t){return e.order&&t.order&&String(e.order.low)&&String(t.order.low)&&parseInt(e.order.low)<parseInt(t.order.low)?-1:1})).map((function(e){return e._id})))).splice(i.index,1),p.splice(o.index,0,c),p.map((function(e,t){l[e]=Object(h.a)(Object(h.a)({},l[e]),{},{order:{low:t}})})),f=Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},t.cards),l)}),e.reduxFunction("ASYNC","SET_DB",Object(h.a)({},f)),a.emit("data",{module:"cards",method:"put",action:"inColumn"},{node:c,source:i.droppableId,destination:o.droppableId,destinationCards:p,sourceCards:[],columnName:"status"}),r.abrupt("return");case 21:d.splice(i.index,1),(m=Array.from(e.cards.filter((function(e){return e.status===u})).sort((function(e,t){return e.order&&t.order&&String(e.order.low)&&String(t.order.low)&&parseInt(e.order.low)<parseInt(t.order.low)?-1:1})).map((function(e){return e._id})))).splice(o.index,0,c),d.map((function(e,r){t.cards[e].order&&t.cards[e].order.low?t.cards[e].order.low=parseInt(r):t.cards[e]=Object(h.a)(Object(h.a)({},t.cards[e]),{},Object(O.a)({},"order",Object(O.a)({},"low",parseInt(r))))})),m.map((function(e,r){t.cards[e].order&&t.cards[e].order.low?t.cards[e].order.low=parseInt(r):t.cards[e]=Object(h.a)(Object(h.a)({},t.cards[e]),{},Object(O.a)({},"order",Object(O.a)({},"low",parseInt(r))))})),g=Object(h.a)(Object(h.a)({},t),{},{cards:Object(h.a)(Object(h.a)({},t.cards),{},Object(O.a)({},c,Object(h.a)(Object(h.a)({},t.cards[c]),{},{status:u,completed_at:"completed"===u?{low:Ve()().tz("America/Sao_Paulo").unix("x")}:null,updated_at:{low:Ve()().tz("America/Sao_Paulo").unix("x")},order:{low:o.index}})))}),e.reduxFunction("ASYNC","SET_DB",Object(h.a)({},g)),a.emit("data",{module:"cards",method:"put",action:"inColumn"},{node:c,source:i.droppableId,destination:o.droppableId,destinationCards:m,columnName:"status",sourceCards:d});case 29:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}(),n=function(){var e=Object(Me.a)(Xp().mark((function e(t){return Xp().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),a=function(){var e=Object(Me.a)(Xp().mark((function e(t){return Xp().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return i.a.createElement(di.a,{onDragEnd:r,onDragStart:n,onDragUpdate:a},i.a.createElement(di.c,{droppableId:"ALL-COLUMNS-STATUS",type:"column",direction:"".concat(e.inLine?"vertical":"horizontal"),isDropDisabled:!0},(function(t){return i.a.createElement(Jp,Object.assign({},e,{ref:t.innerRef}),De.getState().db.status.map((function(t,r){var n={name:t.label,icon:t.icon,cards:[],emptyHide:!1};return i.a.createElement(qp,Object.assign({},e,{key:"".concat(t.value),columnId:"".concat(t.value),isDropDisabled:!0,column:n,cards:e.cards.filter((function(e){return e.status===t.value||"notStarted"===t.value&&!e.status})).map((function(e){return Object(h.a)(Object(h.a)({},e),{},{id:e._id})})),index:r,columnsSettings:!1,locked:!1,columnStyle:Object(h.a)({flex:r,width:"25%"},e.columnStyle?e.columnStyle:{}),viewButton:e.viewButton||!1,periodFilter:!(!t.props||!t.props.periodFilter)}))})),t.placeholder,i.a.createElement("div",{style:{clear:"both"}}))})))}));var Zp=Object($e.b)((function(e){return{history:e.db.history,cards:e.db.cards,viewList:e.db.viewList}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.db,n=t.session,a=t.search,o=r.dataType,c=i.a.useState(!1),l=Object(Be.a)(c,2),u=l[0],d=l[1],p=Ve()().tz("America/Sao_Paulo").format("YYYY/MM/DD"),f=(Ve()().tz("America/Sao_Paulo").format("YYYY/MM/DD"),xt(),window.location.hash.split("/"));if(f[0]=f[0].replace("#",""),i.a.useEffect((function(){u||d(!0)}),[r.cards,a,r.users]),window.location.hash.split("/")[0].replace("#","")||s.push("t#tab/myTasks"),!r.cards)return null;var m=Object.keys(e.cards).filter((function(t){return e.cards[t]&&"chatGroup"!==e.cards[t].type&&"plan"!==e.cards[t].type&&"link"!==e.cards[t].type&&"insight"!==e.cards[t].type&&o.filter((function(r){return r.name===e.cards[t].type})).length>0&&(!e.cards[t].checklist||e.cards[t].checklist&&e.cards[t].showCard)&&!e.cards[t].deleted})).map((function(t){return e.cards[t]}));return m=De.getState().session.cards.adminView?m.filter((function(e){if(!e.private||e.private&&e._users&&Object.keys(e._users).filter((function(e){return e===n._id})).length>0)return!0})):m.filter((function(e){if(e._users&&Object.keys(e._users).filter((function(e){return e===n._id})).length>0)return!0})),f[1]&&"allTasks"===f[1]&&(m=m.filter((function(e){return o.filter((function(t){return t.name===e.type}))[0].myTasks&&"objective"!==e.type&&"goal"!==e.type&&"plan"!==e.type&&-1===e.type.indexOf("guideline")})),"allTasks"),f[1]&&"myTasks"===f[1]&&(m=m.filter((function(e){return o.filter((function(t){return t.name===e.type}))[0].myTasks&&"objective"!==e.type&&"goal"!==e.type&&"plan"!==e.type&&-1===e.type.indexOf("guideline")&&e._users&&Object.keys(e._users).filter((function(t){return t===n._id&&e._users[t].isResponsible})).length>0})),"myTasks"),"tab"===f[0]&&"planningCards"===f[1]&&(m=m.filter((function(e){return o.filter((function(t){return t.name===e.type}))[0].myTasks&&"objective"!==e.type&&"goal"!==e.type&&"plan"!==e.type&&-1===e.type.indexOf("guideline")&&e._planId})),"planningCards"),"tab"===f[0]&&"guidelines"===f[1]&&(m=m.filter((function(e){if(e.type.indexOf("guideline")>-1)return!0})),"guidelines"),"tab"===f[0]&&"unreaded"===f[1]&&(m=m.filter((function(e){if(ma(e._id).total>0)return!0})),"unreaded"),"tab"===f[0]&&"objectives"===f[1]&&(m=m.filter((function(e){return"objective"===e.type})),"objectives"),"tab"===f[0]&&"goals"===f[1]&&(m=m.filter((function(e){return"goal"===e.type})),"goals"),"tab"===f[0]&&"myDay"===f[1]&&(m=m.filter((function(e){return e._users&&e._users[n._id]&&e._users[n._id].myDay&&Ve()(new Date(1e3*e._users[n._id].myDay)).tz("America/Sao_Paulo").format("YYYY/MM/DD")===p})).map((function(e){return e})),"myDay"),"tab"===f[0]&&"ourDay"===f[1]&&(m=m.filter((function(e){return!(!e||!e._users)&&Object.keys(e._users).filter((function(t){return t&&e._users[t]&&e._users[t].myDay&&Ve()(new Date(1e3*e._users[t].myDay)).tz("America/Sao_Paulo").format("YYYY/MM/DD")===p})).length>0})).map((function(e){return e})),"ourDay"),"tab"===f[0]&&"private"===f[1]&&(m=m.filter((function(e){return e.private})).map((function(e){return e})),"nextTasks"),"tab"===f[0]&&"nextTasks"===f[1]&&(m=m.filter((function(e){return e.endDate&&Ve()(new Date(1e3*e.endDate)).tz("America/Sao_Paulo").format("YYYY-MM-DD")>=Ve()().format("YYYY-MM-DD")&&Ve()(new Date(1e3*e.endDate)).tz("America/Sao_Paulo").format("YYYY-MM-DD")<=Ve()(new Date(p)).add(10,"days").format("YYYY-MM-DD")||e.startDate&&Ve()(new Date(1e3*e.startDate)).tz("America/Sao_Paulo").format("YYYY-MM-DD")>=Ve()().format("YYYY-MM-DD")&&Ve()(new Date(1e3*e.startDate)).tz("America/Sao_Paulo").format("YYYY-MM-DD")<=Ve()(new Date(p)).add(10,"days").format("YYYY-MM-DD")})).map((function(e){return e})),"nextTasks"),"tab"===f[0]&&"lateTasks"===f[1]&&(m=m.filter((function(e){return e.endDate&&Ve()(new Date(1e3*e.endDate)).tz("America/Sao_Paulo").format()<=Ve()(new Date(p)).tz("America/Sao_Paulo").format()&&"completed"!==e.status})).map((function(e){return e})),"lateTasks"),"tab"===f[0]&&"unlinkedCards"===f[1]&&(m=m.filter((function(e){return!e.parent&&!e._parent})).map((function(e){return e})),"lateTasks"),i.a.createElement("div",{style:e.expanded?{width:"calc(100% - 220px)",marginLeft:"220px"}:{width:"calc(100% - 0px)",marginLeft:"0px"}},i.a.createElement(md,null),i.a.createElement("div",{style:{position:"relative",width:"100%",marginTop:"7px"}},i.a.createElement(yd,null)),i.a.createElement("div",{style:{position:"relative",width:"100%"}},i.a.createElement(Io,{title:null,icon:null,color:dt("menu"),style:{background:"transparent",padding:"7px"},customButtons:[{title:r.orderByTitle?"$__orderByName":"$__orderByManualOrder",icon:r.orderByTitle?"sort":"format_list_numbered",color:dt("menu"),onClick:function(){e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{orderByTitle:!r.orderByTitle}))}},r.orderByTitle&&{title:"ASC"===r.orderByTitlePosition?"$__asc":"$__desc",icon:"ASC"===r.orderByTitlePosition?"text_rotation_down":"text_rotate_up",onClick:function(){e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{orderByTitlePosition:"ASC"===r.orderByTitlePosition?"DESC":"ASC"}))}}]})),i.a.createElement("div",{style:{position:"relative",minHeight:"calc(100vh - 150px)",marginTop:"7px",width:"100%",overflowX:"auto",overflowY:"hidden"}},i.a.createElement(Kp,{cards:m,inLine:r.viewList,showConnectedIn:!0,columnStyle:Object(h.a)({},r.viewList?{width:"100%"}:{maxHeight:"calc(100vh - 190px)",width:"25%"})}),i.a.createElement("div",{style:{clear:"both"}})))}));var Qp=Object($e.b)((function(e){return{store:{languages:e.languages}}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(od)((function(e){var t=i.a.useState([]),r=Object(Be.a)(t,2);return r[0],r[1],i.a.createElement("div",{style:{width:"100%"}},"Resume")})));var ef=function(e){var t=Ts.a.ExcelFile,r=Ts.a.ExcelFile.ExcelSheet,n=Ts.a.ExcelFile.ExcelColumn,a=e.data,o=[],c=[];return a.map((function(e){e.users.filter((function(e){return!e.deleted})).sort((function(e,t){return e.name.toLowerCase()<t.name.toLowerCase()})).map((function(e){0===o.filter((function(t){return t.id===e.id})).length&&o.push(e)})),e.users.filter((function(e){return e.deleted})).sort((function(e,t){return e.name.toLowerCase()<t.name.toLowerCase()})).map((function(e){0===c.filter((function(t){return t.id===e.id})).length&&c.push(e)}))})),i.a.createElement(t,{filename:"".concat(Ve()().tz("America/Sao_Paulo").format("YYYY-MM-DDTHHMM"),"_").concat(lt("$__companies"),"_").concat(lt("$__users")),element:i.a.createElement(At,{title:lt("$__export"),text:lt("$__export"),icon:"file_download",size:"25px"})},i.a.createElement(r,{data:a.sort((function(e,t){return e.name<t.name})),name:lt("$__accounts")},i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__id",1)),value:"id"}),i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__company",1)),value:"name"}),i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__createdAt",1)),value:"created_at"}),i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__signaturePlan",1)),value:"plan"}),i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__activeUsersCount",1)),value:"usersCount"}),i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__usedDisk",1)),value:"diskUsed"})),i.a.createElement(r,{data:o.sort((function(e,t){return e.name<t.name})),name:"USUARIOS ATIVOS"},i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__id",1)),value:"id"}),i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__name",1)),value:"name"}),i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__unity",1)),value:"unity"}),i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__email",1)),value:"email"}),i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__createdAt",1)),value:"created_at"}),i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__lastSessionDate",1)),value:"lastSession"})),i.a.createElement(r,{data:c.sort((function(e,t){return e.name<t.name})),name:"USU\xc1RIOS REMOVIDOS"},i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__id",1)),value:"id"}),i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__name",1)),value:"name"}),i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__unity",1)),value:"unity"}),i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__email",1)),value:"email"}),i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__createdAt",1)),value:"created_at"}),i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__lastSessionDate",1)),value:"lastSession"}),i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__removed",1)),value:"deleted"})),a.map((function(e,t){return i.a.createElement(r,{data:e.users,name:e.name,key:t},i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__id",1)),value:"id"}),i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__name",1)),value:"name"}),i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__unity",1)),value:"unity"}),i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__email",1)),value:"email"}),i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__createdAt",1)),value:"created_at"}),i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__lastSessionDate",1)),value:"lastSession"}),i.a.createElement(n,{width:350,style:{alignment:{wrapText:!0}},label:"".concat(lt("$__removed",1)),value:"deleted"}))})))};function tf(){tf=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var rf=Object($e.b)((function(e){return{store:{languages:e.languages}}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(od)((function(e){var t=i.a.useState([]),r=Object(Be.a)(t,2),n=r[0],a=r[1],o=i.a.useState([]),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.useState(null),d=Object(Be.a)(u,2),p=d[0],f=d[1],m=i.a.useState("name"),g=Object(Be.a)(m,2),v=g[0],y=g[1],b=i.a.useState(!0),x=Object(Be.a)(b,2),_=x[0],w=x[1],E=De.getState().db.plans;i.a.useEffect((function(){O()}),[]);var O=function(){var e=Object(Me.a)(tf().mark((function e(){var t,r;return tf().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Sn.post("Adm_ReqAccounts");case 2:t=e.sent,r=[],t&&(t.data.map((function(e){var t=0;if(0===r.filter((function(t){return t.id===e.id})).length){e.users.filter((function(e){return e.filesSize})).map((function(e){t+=parseInt(e.filesSize)})),t>0&&(t=jt(t));var n=e.account.created_at&&e.account.created_at.low?String(e.account.created_at.low):e.account.created_at,a=e&&e.account&&e.account.plan&&E.filter((function(t){return t.value.indexOf(e.account.plan)})).length>0?e.account.plan:"p0",o=Array.from(e.users);o.flatMap((function(e){(e.deleted||e.unityDeleted)&&(e.deleted="SIM"),e.created_at=Ac()(1e3*e.created_at).format("DD/MM/YYYY HH:mm:ss"),e.lastSession=e.lastSession?Ac()(1e3*e.lastSession).format("DD/MM/YYYY HH:mm:ss"):""})),r.push(Object(h.a)(Object(h.a)({id:e.id},e.account),{},{created_at:Ac()(1e3*n).format("DD/MM/YYYY HH:mm:ss"),plan:lt(E.filter((function(e){return e.value.indexOf(a)>-1}))[0].label,"*"),diskUsed:t,usersCount:e.users.length,users:o})),"ENEVA"===e.account.name&&console.log(e,Object(h.a)(Object(h.a)({id:e.id},e.account),{},{created_at:Ac()(1e3*n).format("DD/MM/YYYY HH:mm:ss"),plan:lt(E.filter((function(e){return e.value.indexOf(a)>-1}))[0].label,"*"),diskUsed:t,usersCount:e.users.length,users:o}))}})),a(t.data),s(r));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),j=function(e){v===e?w((function(e){return!e})):y(e)},S=function(e){var t=e.data,r=e.index,n=t.filesSize?parseInt(t.filesSize):0;return n>0&&(n=jt(n)),i.a.createElement("div",null,i.a.createElement("div",{style:Object(h.a)(Object(h.a)({border:"solid 1px #f6f6f6",width:"100%",padding:7,overflowY:"auto",display:"flex"},t.deleted?{color:"red"}:{}),{},{marginBottom:7},r%2?{background:"linear-gradient(33deg, rgba(255, 255, 255, 1), rgba(247,247,247, 1))"}:{background:"linear-gradient(77deg, rgba(247,247,247, 1), rgba(255, 255, 255, 1))"})},i.a.createElement("div",{style:{position:"relative",float:"left",width:"100px"}},"#",t.id),i.a.createElement("div",{style:{position:"relative",float:"left",width:"150px",overflow:"hidden",textOverflow:"ellipsis"}},i.a.createElement("div",{style:{width:"100%",position:"relative",float:"left"}},t.name)," ",t.unity?i.a.createElement("div",{style:{fontSize:10,width:"100%",position:"relative",float:"left"}},"(",t.unity,")"):""),i.a.createElement("div",{style:{position:"relative",float:"left",width:"300px"}},t.email),i.a.createElement("div",{style:{position:"relative",float:"left",width:"150px"}},t.created_at),i.a.createElement("div",{style:{position:"relative",float:"left",width:"150px"}},t.lastSession)))},k=function(e){var t=e.data,r=e.index,n=t&&t.account&&t.account.plan&&E.filter((function(e){return e.value.indexOf(t.account.plan)>-1})).length>0?t.account.plan:"p0",a=t.users.filter((function(e){return!e.deleted})).length,o=0;return t.users.filter((function(e){return e.filesSize})).map((function(e){o+=parseInt(e.filesSize)})),o>0&&(o=jt(o)),i.a.createElement("div",{style:Object(h.a)({position:"relative",width:"100%",padding:7,marginBottom:3},t.account.deleted?Object(h.a)({},r%2?{background:"linear-gradient(33deg, rgba(237,20,61,0.1), rgba(237,20,61,0.2))"}:{background:"linear-gradient(33deg, rgba(237,20,61,0.2), rgba(237,20,61,0.1))"}):Object(h.a)({},r%2?{background:"linear-gradient(33deg, rgba(255, 255, 255, 1), rgba(247,247,247, 1))"}:{background:"linear-gradient(77deg, rgba(247,247,247, 1), rgba(255, 255, 255, 1))"}))},i.a.createElement("div",{style:{width:"100%",padding:7,overflowY:"auto",display:"flex",marginBottom:3}},i.a.createElement("div",{style:{position:"relative",float:"left",width:"100px"}},"#",t.id),i.a.createElement("div",{style:{position:"relative",float:"left",width:"300px"}},t.account.name),i.a.createElement("div",{style:{position:"relative",float:"left",width:"200px"}},Ot(t.account.created_at)),i.a.createElement("div",{style:{position:"relative",float:"left",width:"200px"}},E.filter((function(e){return e.value.indexOf(n)>-1}))[0]&&E.filter((function(e){return e.value.indexOf(n)>-1}))[0].label?lt("".concat(E.filter((function(e){return e.value.indexOf(n)>-1}))[0].label)):""),i.a.createElement("div",{style:{position:"relative",float:"left",width:"100px",cursor:"pointer",display:"flex"},onClick:function(){p===t.id?f(null):f(t.id)}},i.a.createElement(At,{transparent:!0,title:lt("$__showUsers","*"),color:dt("lightgrey"),icon:p===t.id?"expand_less":"expand_more",onClick:function(){f(p===t.id?null:t.id)},size:"25px"}),a),i.a.createElement("div",{style:{position:"relative",float:"left",width:"100px"}},o)),p===t.id?i.a.createElement("fieldset",{style:{borderRadius:5,width:"100%",overflow:"auto",position:"relative"}},i.a.createElement("legend",{style:{display:"flex"}},lt("$__users"),i.a.createElement(At,{transparent:!0,title:lt("$__hide","*"),color:dt("lightgrey"),icon:"expand_less",onClick:function(){f(null)},size:"25px"})),i.a.createElement("div",{style:{border:"solid 1px #f6f6f6",width:"100%",padding:3,overflowY:"auto",display:"flex",fontWeight:"bold",color:dt("menu"),fontSize:"11px"}},i.a.createElement("div",{style:{position:"relative",float:"left",width:"100px"},onClick:function(){j("id")}},"#",lt("$__id")),i.a.createElement("div",{style:{position:"relative",float:"left",width:"150px"},onClick:function(){j("name")}},lt("$__name")),i.a.createElement("div",{style:{position:"relative",float:"left",width:"300px"},onClick:function(){j("email")}},lt("$__email")),i.a.createElement("div",{style:{position:"relative",float:"left",width:"150px"},onClick:function(){j("createdAt")}},lt("$__createdDate")),i.a.createElement("div",{style:{position:"relative",float:"left",width:"150px"},onClick:function(){j("lastSession")}},lt("$__lastSession"))),t.users.sort((function(e,t){var r="",n="";return"id"===v&&(r=e.id,n=t.id),"name"===v&&(r=e.name.toLowerCase(),n=t.name.toLowerCase()),"email"===v&&(r=e.email.toLowerCase(),n=t.email.toLowerCase()),"createdAt"===v&&(r=e.created_at,n=t.created_at),"lastSession"===v&&(r=e.lastSession,n=t.lastSession),r<n?_?-1:1:r>n?_?1:-1:0})).map((function(e,t){return i.a.createElement(S,{data:e,index:t,key:t})}))):i.a.createElement(i.a.Fragment,null))};return i.a.createElement("div",{style:{width:"100%"}},i.a.createElement(ef,{data:l}),i.a.createElement("div",{style:{border:"solid 1px #f6f6f6",width:"100%",padding:3,overflowY:"auto",display:"flex",fontWeight:"bold",color:dt("menu")}},i.a.createElement("div",{style:{position:"relative",float:"left",width:"100px"}},"#",lt("$__id")),i.a.createElement("div",{style:{position:"relative",float:"left",width:"300px"}},lt("$__company")),i.a.createElement("div",{style:{position:"relative",float:"left",width:"200px"}},lt("$__createdDate")),i.a.createElement("div",{style:{position:"relative",float:"left",width:"200px"}},lt("$__plan")),i.a.createElement("div",{style:{position:"relative",float:"left",width:"100px"}},lt("$__users")),i.a.createElement("div",{style:{position:"relative",float:"left",width:"100px"}},lt("$__diskUsed"))),i.a.createElement("div",null,n.filter((function(e){return!p||p===e.id})).sort((function(e,t){var r=e.account.name.toLowerCase(),n=t.account.name.toLowerCase();return r<n?-1:r>n?1:0})).map((function(e,t){return i.a.createElement(k,{index:t,data:e,key:e.account._id})}))))})));function nf(){nf=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var af=Object($e.b)((function(e){return{store:{languages:e.languages}}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(od)((function(e){var t=e.classes,r=i.a.useState({}),n=Object(Be.a)(r,2),a=n[0],o=n[1],c=De.getState().functions.socket,l=i.a.useState(!1),s=Object(Be.a)(l,2),u=s[0],d=s[1],p=i.a.useState(0),f=Object(Be.a)(p,2),h=f[0],m=f[1],g=i.a.useState(25),v=Object(Be.a)(g,2),y=v[0],b=v[1],x=i.a.useState(""),_=Object(Be.a)(x,2),w=_[0],E=_[1];i.a.useEffect((function(){o(De.getState().languages)}),[JSON.stringify(De.getState().languages)]);var O=function(){var e=Object(Me.a)(nf().mark((function e(t,r,n,a){return nf().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t?c.emit("language.UPD",{alias:r,locale:n,text:a}):c.emit("data",{module:"language",method:"post",action:"addLocale"},{alias:r,locale:n,text:a});case 1:case"end":return e.stop()}}),e)})));return function(t,r,n,a){return e.apply(this,arguments)}}();return i.a.createElement("div",{style:{width:"100%"}},i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",left:"0px",right:"0px",padding:"15px",display:"flex",alignItems:"center",justifyContent:"center"}},lt("$__page")," ",h+1," ",lt("$__of")," ",Math.ceil(Object.keys(a).length/y),i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},i.a.createElement(ad.a,{component:"div",count:Object.keys(a).length,page:h,onChangePage:function(e,t){m(t)},rowsPerPage:y,onChangeRowsPerPage:function(e){b(parseInt(e.target.value,10))},labelRowsPerPage:lt("$__aliasPerPage")}))),i.a.createElement("div",{style:{width:"100%",display:"flex",alignItems:"center"}},i.a.createElement(La,{label:lt("$__search",1),variant:dt("fieldVariant"),value:w,onChange:function(e){E(e.target.value)}}),i.a.createElement(rn,{text:lt(u?"$__all":"$__onlyEmpty","*"),icon:u?"subtitles_off":"subtitles",iconColor:dt("medium"),onClick:function(){d(!u)}})),i.a.createElement(hn.a,{className:t.root},i.a.createElement("div",{className:t.header},i.a.createElement("div",{className:t.column},lt("$__alias",1)),i.a.createElement("div",{className:t.column},lt("$__translation",1))),i.a.createElement("div",{className:t.body},i.a.createElement("ul",null,a&&Object.keys(a)&&Object.keys(a).length>0&&Object.keys(a).filter((function(e){if((!w||w&&(e.indexOf(w)>-1||a[e]&&a[e].locales&&a[e].locales.filter((function(e){return e.name.toLowerCase().indexOf(w.toLowerCase())>-1})).length>0))&&(u&&a[e]&&(!a[e].locales||a[e].locales&&(0===!a[e].locales.filter((function(e){return"pt-BR"===e.locale})).length||a[e].locales.filter((function(e){return"pt-BR"===e.locale})).length>0&&!a[e].locales.filter((function(e){return"pt-BR"===e.locale}))[0].name||0===a[e].locales.filter((function(e){return"en-US"===e.locale})).length||a[e].locales.filter((function(e){return"en-US"===e.locale})).length>0&&!a[e].locales.filter((function(e){return"en-US"===e.locale}))[0].name||0===a[e].locales.filter((function(e){return"es-ES"===e.locale})).length||a[e].locales.filter((function(e){return"es-ES"===e.locale})).length>0&&!a[e].locales.filter((function(e){return"es-ES"===e.locale}))[0].name))||!u))return!0})).sort((function(e,t){return e<t?-1:e>t?1:0})).map((function(e,r){if(r<=(h+1)*y&&r>=h*y)return i.a.createElement("li",{key:e.trim()},i.a.createElement("div",{className:t.column},e),i.a.createElement("div",{className:t.column2},i.a.createElement("fieldset",{style:{marginBottom:15}},i.a.createElement("legend",null,"Portugu\xeas - Brasil"),i.a.createElement("div",{style:{position:"relative"}},i.a.createElement(Io,{key:"".concat(e,"_pt-BR"),title:a[e].locales&&a[e].locales.length>0&&a[e].locales.filter((function(e){return"pt-BR"===e.locale})).length>0&&a[e].locales.filter((function(e){return"pt-BR"===e.locale}))[0].name,_id:a[e].locales&&a[e].locales.length>0&&a[e].locales.filter((function(e){return"pt-BR"===e.locale})).length>0&&a[e].locales.filter((function(e){return"pt-BR"===e.locale}))[0]._id,editable:!0,onEdit:function(t,r){O(r,e,"pt-BR",t.name)},color:dt("menu"),noAutoFocus:!0,multiline:!0,noCancel:!0}))),i.a.createElement("fieldset",{style:{marginBottom:15}},i.a.createElement("legend",null,"Ingl\xeas - Internacional"),i.a.createElement(Io,{key:"".concat(e,"_en-US"),editable:!0,title:a[e].locales&&a[e].locales.length>0&&a[e].locales.filter((function(e){return"en-US"===e.locale})).length>0&&a[e].locales.filter((function(e){return"en-US"===e.locale}))[0].name,_id:a[e].locales&&a[e].locales.length>0&&a[e].locales.filter((function(e){return"en-US"===e.locale})).length>0&&a[e].locales.filter((function(e){return"en-US"===e.locale}))[0]._id,onEdit:function(t,r){O(r,e,"en-US",t.name)},color:dt("menu"),noAutoFocus:!0,multiline:!0,noCancel:!0})),i.a.createElement("fieldset",{style:{marginBottom:15}},i.a.createElement("legend",null,"Espanhol"),i.a.createElement(Io,{key:"".concat(e,"_es-ES"),editable:!0,title:a[e].locales&&a[e].locales.length>0&&a[e].locales.filter((function(e){return"es-ES"===e.locale})).length>0&&a[e].locales.filter((function(e){return"es-ES"===e.locale}))[0].name,_id:a[e].locales&&a[e].locales.length>0&&a[e].locales.filter((function(e){return"es-ES"===e.locale})).length>0&&a[e].locales.filter((function(e){return"es-ES"===e.locale}))[0]._id,onEdit:function(t,r){O(r,e,"es-ES",t.name)},color:dt("menu"),noAutoFocus:!0,multiline:!0,noCancel:!0}))))}))))))})));var of=Object($e.b)((function(e){return{history:e.db.history}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(pp)((function(e){var t=De.getState().session,r=window.location.hash.split("/");r[0]=r[0].replace("#","");var n=i.a.useState(null),a=Object(Be.a)(n,2),o=a[0],c=a[1],l=i.a.useState(null),s=Object(Be.a)(l,2),u=s[0],d=s[1];return t._access.master?(window.location.hash.split("/")[0].replace("#",""),i.a.createElement("div",null,!r[0]&&i.a.createElement(Qp,null),"tab"===r[0]&&"accounts"===r[1]&&i.a.createElement(rf,null),"tab"===r[0]&&"languages"===r[1]&&i.a.createElement(af,null),"tab"===r[0]&&"tests"===r[1]&&i.a.createElement("div",{style:{width:"300px"}},i.a.createElement(El,{type:"datetime",onChangeStartDate:function(e){console.log(Ve()(e).format("YYYY-MM-DD 23:59:59").unix("X")),c(Ve()(e).unix("X"))},onChangeEndDate:function(e){d(Ve()(e).unix("X"))},range:!0,startDate:o?new Date(1e3*o):null,endDate:u?new Date(1e3*u):null,onClear:function(){c(null),d(null)}})))):i.a.createElement("div",null,"ACCESS DENIED")}))),cf={badge:{borderRadius:"12px",padding:"5px 12px",textTransform:"uppercase",fontSize:"10px",fontWeight:"700",lineHeight:"1",color:"#FFF",textAlign:"center",verticalAlign:"baseline",display:"inline-block"},primary:{backgroundColor:nr[0]},warning:{backgroundColor:ar[0]},danger:{backgroundColor:or[0]},success:{backgroundColor:ir[0]},info:{backgroundColor:cr[0]},rose:{backgroundColor:lr[0]},gray:{backgroundColor:sr[0]}};Object(Lt.a)(cf);var lf=function(e){return{root:{position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px",overflowY:"auto"},content:{position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px",overflowY:"auto",backgroundColor:"rgba(249,249,249,1)"},timeline:{listStyle:"none",padding:"0",position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px",display:"flex",width:"100%","& .file-drop-target":{width:"100%"}},scrollEnd:{marginTop:"160px",position:"relative",width:"100%",height:"0px",marginBottom:"-100px"},scrollEndNoEditor:{marginTop:"30px",position:"relative",width:"100%",height:"0px",marginBottom:"-100px"},timelineSimple:{position:"relative",overflow:"hidden",marginTop:"0px",padding:"0 0 50px",width:"-webkit-fill-available","&:before":{left:"15px"}},timelineSimpleWithHeader:{position:"relative",overflowX:"auto",marginTop:"60px",padding:"0 0 50px",width:"-webkit-fill-available","&:before":{left:"15px"}},item:{marginBottom:"5px",position:"relative",paddingLeft:"15px",width:"calc(100% - 15px)","&:before,&:after":{content:'" "',display:"table"},"&:after":{clear:"both"}},timelineBadge:{color:"#FFF",width:"30px",height:"30px",lineHeight:"25px",fontSize:"12px",textAlign:"center",position:"absolute",bottom:"23px",left:"50%",marginLeft:"-7px",zIndex:"1",borderTopRightRadius:"50%",borderTopLeftRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"},timelineSimpleBadge:{left:"7px"},timelineBadgeInverted:{color:"#FFF",width:"30px",height:"30px",lineHeight:"25px",fontSize:"12px",textAlign:"center",position:"absolute",bottom:"23px",right:"50%",marginRight:"-7px",zIndex:"1",borderTopRightRadius:"50%",borderTopLeftRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"},timelineSimpleBadgeInverted:{right:"7px"},custom:{backgroundColor:dt("color"),boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt("#000")+", 0.4)"},info:{backgroundColor:cr[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(cr[0])+", 0.4)"},success:{backgroundColor:ir[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(ir[0])+", 0.4)"},danger:{backgroundColor:or[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(or[0])+", 0.4)"},warning:{backgroundColor:ar[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(ar[0])+", 0.4)"},primary:{backgroundColor:nr[0],boxShadow:"0 4px 20px 0px rgba("+Zt("#000")+", 0.14), 0 7px 10px -5px rgba("+Zt(nr[0])+", 0.4)"},badgeIcon:{width:"14px",height:"14px"},timelinePanel:{maxWidth:"calc(100% - 70px)",float:"right",padding:"7px",marginBottom:"5px",marginRight:"40px",position:"relative",boxShadow:"0 1px 4px 0 rgba("+Zt("#000")+", 0.14)",borderRadius:"6px",color:"rgba("+Zt("#000")+", 0.87)",background:dt("timelineMyMessage")},timelinePanelInverted:{maxWidth:"calc(100% - 70px)",float:"left",padding:"7px",marginLeft:"40px",marginBottom:"5px",position:"relative",boxShadow:"0 1px 4px 0 rgba("+Zt("#000")+", 0.14)",borderRadius:"6px",color:"rgba("+Zt("#000")+", 0.87)",background:"#ffffff"},timelineHeading:{marginBottom:"0px",display:"flex",alignItems:"center"},timelineDate:{display:"flex",alignItems:"center",padding:"5px",backgroundColor:"#CCCCCC"},timelineBody:{overflowWrap:"anywhere",fontSize:"12px",lineHeight:"21px",position:"relative",width:"100%",float:"left"},timelineLog:{fontSize:"12px",lineHeight:"21px"},timelineFooter:{zIndex:"1",position:"relative",float:"left",width:"100%",display:"inline-flex",justifyContent:"space-between"},footerUser:{display:"flex",alignItems:"center",fontSize:"12px",fontWeight:"bold",color:dt("medium"),padding:"0 7px"},footerLine:{position:"relative",marginTop:"10px",marginBottom:"5px"},dropFile:{display:"none"},onDropFile:{position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px",display:"flex",alignItems:"center",justifyContent:"center",color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.77)",zIndex:1},editor:{position:"absolute",bottom:"0px",minHeight:"50px",padding:"10px",height:"auto",width:"calc(100% - 0px)",backgroundColor:"rgba(240,240,240,1)",zIndex:10},files:{display:"inline-table",position:"relative"},textEditor:{},textEditorIcon:{cursor:"pointer",color:dt("color")},progressBar:{backgroundColor:"".concat(dt("color","0.1")," !important"),"& .MuiLinearProgress-indeterminate":{backgroundColor:"".concat(dt("color")," !important")},"& .MuiLinearProgress-bar":{backgroundColor:"".concat(dt("color")," !important")}},actionButton:{alignItems:"center",cursor:"pointer",float:"left",height:"30px",position:"relative",textAlign:"center",width:"30px"},sendingMessage:{width:"100%"},valuePositive:{positive:"relative",float:"left",color:"blue"},valueNegative:{positive:"relative",float:"left",color:"red"},lastValue:{positive:"relative",float:"right",color:"grey"},timeInfo:{display:"flex",alignItems:"center",color:"grey",width:"100%",position:"relative",float:"left",marginBottom:"7px","& .text":{marginLeft:"7px"}},urlPreview:{position:"relative",float:"left",marginBottom:"33px","& img":{maxWidth:"20%",height:"auto",marginTop:"30px",marginRight:"7px"},"& .data":{"& .title":{fontSize:"16px",fontWeight:"bold"},"& .siteName":{fontSize:"14px",fontWeight:"bold",color:"#909090"},"& .contentSnippet":{fontSize:"12px",color:"#909090"}}},users:{position:"relative",bottom:"0px",right:"2px",fontSize:"10px","& .MuiAvatarGroup-root":{justifyContent:"flex-end"},"& .MuiAvatar-root":{width:"25px",height:"25px",fontSize:"10px"}}}};function sf(){sf=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var uf=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(lf)((function(e){var t=e.classes,r=De.getState(),n=r.db,a=r.session,o=r.functions,c=(r.chat,r.timeline),l=o.socket,s=i.a.useState(e.stories||{}),u=Object(Be.a)(s,2),d=u[0],p=u[1],f=[];i.a.useEffect((function(){m()}),[e.stories,e.nodeId,JSON.stringify(c)]);var m=function(){var t={};c[a._id]&&Object.keys(c[a._id]).filter((function(t){return c[a._id][t]&&c[a._id][t].user&&c[a._id][t].user._id&&c[a._id][t].user._id===e.nodeId})).map((function(e){t=Object(h.a)(Object(h.a)({},t),{},Object(O.a)({},e,c[a._id][e]))})),c[e.nodeId]&&Object.keys(c[e.nodeId]).map((function(r){t=Object(h.a)(Object(h.a)({},t),{},Object(O.a)({},r,c[e.nodeId][r]))})),p(t)},g=function(t){e.reduxFunction("ASYNC","LIGHTBOX",{open:!0,files:f,file:t})},v=function(){var t=Object(Me.a)(sf().mark((function t(){return sf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:l.emit("data",{module:"chat",method:"put",action:"read"},{readedBy:a._id,id:e.nodeId,db:n.cards[e.nodeId]?"cards":"users",type:e.type?e.type:"comment"});case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",marginBottom:"15px"}},i.a.createElement("ul",{className:t.timelineSimple,id:"tms_".concat(e.nodeId),style:{zIndex:1}},d&&Object.keys(d).length>0&&Object.keys(d).sort((function(e,t){return parseInt(d[e].created_at)<parseInt(d[t].created_at)?-1:parseInt(d[e].created_at)>parseInt(d[t].created_at)?1:0})).map((function(r,n){var o=d[r];return!e.showUnReaded&&n>Object.keys(d).length-4?(o.files&&Object.keys(o.files).length>0&&Object.keys(o.files).map((function(e,t){var r=o.files[e];f.push(r)})),i.a.createElement("li",{className:t.item,key:r,style:{}},i.a.createElement(Fc,{openLightBox:function(e){g(e)},storie:o,reply:o.reply?d[o.reply]:null,hideCards:!!e.hideCards,db:e.db,nodeId:e.nodeId}))):e.showUnReaded&&o&&o.user&&o.user._id!==a._id&&(!o.readedBy||o.readedBy&&!o.readedBy[a._id])?(o.files&&Object.keys(o.files).length>0&&Object.keys(o.files).map((function(e,t){var r=o.files[e];f.push(r)})),i.a.createElement("li",{className:t.item,key:r,style:{}},i.a.createElement(Fc,{openLightBox:function(e){g(e)},storie:o,reply:o.reply?d[o.reply]:null,hideCards:!!e.hideCards,db:e.db,nodeId:e.nodeId}))):void 0})),i.a.createElement("div",{style:{marginBottom:"15px",clear:"both"}})),i.a.createElement(Eo,{nodeId:e.nodeId,onSending:function(){v()}}))})));function df(){df=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var pf=Object(Lt.a)((function(){return{unReaded:{background:"linear-gradient(33deg, rgba(250, 250, 250, 1), rgba(250, 250, 250, 0))",padding:"7px",borderBottom:"solid 1px rgba(0,0,0,0.1)",width:"100%",maxWidth:"100%",opacity:1},Readed:{padding:"7px",borderBottom:"solid 1px rgba(0,0,0,0.1)",width:"100%",opacity:.6,maxWidth:"100%","&:hover":{opacity:1}}}}));var ff=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=i.a.useState(!1),r=Object(Be.a)(t,2),n=r[0],a=r[1],o=De.getState(),c=o.db,l=o.chat,s=o.timeline,u=e.data,d=pf();i.a.useEffect((function(){n||a(!0)}));var p="cards";u.nodeId&&De.getState().db.users[u.nodeId]&&(p="users");var f=function(){var t=Object(Me.a)(df().mark((function t(r,n){return df().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:De.getState().db[n][r]._loadTimeline?e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},l),{},{open:!0,db:n,nodeId:r,loading:!1})):(uo(Object(h.a)(Object(h.a)({},e),{},{fnIdentification:"Notifications/Index/openChat()"}),{id:[r],db:n}),e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},l),{},{open:!0,db:n,nodeId:r,loading:!0}))),e.openChat(r,n);case 2:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}();if("timeline"===u.module&&(!u.inNode||!u.inNode.type||!De.getState().db||!De.getState().db[p]))return i.a.createElement(i.a.Fragment,null);if(!u.byUser||u.byUser&&!c.users[u.byUser]||u.inNode&&u.inNode.type&&u.inNode._id&&!De.getState().db[p][u.inNode._id])return i.a.createElement(i.a.Fragment,null);var m=function(){var e="";return e=Ve()().tz("America/Sao_Paulo").format("DD/MM/YYYY")===Ve()(1e3*u.created_at).tz("America/Sao_Paulo").format("DD/MM/YYYY")?"".concat(lt("$__today",1)," ").concat(Ve()(1e3*u.created_at).tz("America/Sao_Paulo").format("HH:MM")):Ve()().tz("America/Sao_Paulo").format("YYYY")===Ve()(1e3*u.created_at).tz("America/Sao_Paulo").format("YYYY")?"".concat(Ve()(1e3*u.created_at).tz("America/Sao_Paulo").format("DD/MM HH:MM")):"".concat(Ve()(1e3*u.created_at).tz("America/Sao_Paulo").format("YYYY/DD/MM HH:MM")),i.a.createElement("div",{style:{position:"relative"}},i.a.createElement("div",{style:{position:"relative",alignItems:"center",display:"flex",textSize:"10px",width:"100%",color:dt("medium"),justifyContent:"space-between"}},i.a.createElement(Na,{alt:c.users[u.byUser].name,src:c.users[u.byUser].image||null,size:"sm"},c.users[u.byUser].name.substr(0,1)),i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},lt(u.description)," - ",e,u.readed&&i.a.createElement(kt,{icon:"done_all",color:dt("medium"),title:"$__readed"}))))};return i.a.createElement("div",{className:u.readed?d.Readed:d.unReaded},i.a.createElement("div",{style:{textAlign:"center",width:"100%",padding:"7px",maxWidth:"100%"}}),"timeline"===u.module&&!e.showTimeline&&u.inNode&&u.inNode.type&&u.inNode._id&&De.getState().db[p]&&De.getState().db[p][u.inNode._id]&&s[u.inNode._id]&&s[u.inNode._id][u.nodeId]&&i.a.createElement("div",{style:{display:"flex",cursor:"pointer"},onClick:function(){var t;"User"===u.inNode.type&&(u&&u.inNode&&u.inNode._id&&De.getState().db&&De.getState().db.users&&De.getState().db.users[u.inNode._id]&&s[u.inNode._id]&&Object.keys(s[u.inNode._id]).length>0&&s[u.inNode._id][u.nodeId]&&(t=s[u.inNode._id][u.nodeId].user._id),f(t,"users"));"Card"===u.inNode.type&&("chatGroup"!==De.getState().db.cards[u.inNode._id].type?e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideMudule),{},{db:"cards",id:u.inNode._id,module:"cardEdit",activeModule:"timeline",data:De.getState().db.cards[u.inNode._id]})):f(u.inNode._id,"cards"))}},i.a.createElement(Fc,{storie:u&&u.inNode&&u.inNode._id&&De.getState().db&&De.getState().db[p]&&De.getState().db[p][u.inNode._id]&&s[u.inNode._id]&&Object.keys(s[u.inNode._id]).length>0&&s[u.inNode._id][u.nodeId]?s[u.inNode._id][u.nodeId]:{},boxStyle:{width:"calc(100% - 10px) !important"},db:p})),"card"===u.module&&c[p]&&c[p][u.nodeId]&&i.a.createElement("div",{style:"chatGroup"===De.getState().db.cards[u.nodeId].type?{cursor:"pointer"}:{},onClick:function(e){"chatGroup"===De.getState().db.cards[u.nodeId].type&&f(u.nodeId,"cards")}},i.a.createElement(m,null),i.a.createElement(oc,{db:"cards",data:De.getState().db.cards[u.nodeId],expanded:!0,onlyOption:"chatGroup"===De.getState().db.cards[u.nodeId].type,onClick:function(e){"chatGroup"===De.getState().db.cards[u.nodeId].type&&f(u.nodeId,"cards")}})),e.showTimeline&&c[p]&&c[p][u.inNode._id]&&i.a.createElement(vo,null,i.a.createElement(xo,{xs:12,sm:12,md:4,lg:4,xl:4},i.a.createElement("div",{style:"chatGroup"===De.getState().db.cards[u.inNode._id].type?{cursor:"pointer"}:{},onClick:function(e){"chatGroup"===De.getState().db.cards[u.inNode._id].type&&f(u.inNode._id,"cards")}},i.a.createElement(m,null),i.a.createElement(oc,{db:"cards",data:De.getState().db.cards[u.inNode._id],expanded:!0,onlyOption:"chatGroup"===De.getState().db.cards[u.inNode._id].type,onClick:function(e){"chatGroup"===De.getState().db.cards[u.inNode._id].type&&f(u.inNode._id,"cards")}}))),i.a.createElement(xo,{xs:12,sm:12,md:8,lg:8,xl:8},i.a.createElement("div",{style:{position:"relative",width:"100%",minHeight:"250px"}},i.a.createElement(uf,{nodeId:u.inNode._id,stories:u&&u.inNode&&u.inNode._id&&De.getState().db.cards[u.inNode._id]&&s[u.inNode._id]?s[u.inNode._id]:{},db:"cards"})))))})),hf=function(e){var t,r;return{bar:{position:"fixed",top:"0px",left:"0px",width:"147px",height:"calc(100vh - 0px)"},item:{height:"47px",alignItems:"center",width:"100%",display:"flex"},itemButtom:(t={width:"100%",padding:"7px",color:dt("menuButtonColor",.8),"&:hover":{color:dt("menuButtonColor",1),backgroundColor:"rgba(255,255,255,0.1)",borderRadius:"0px"},display:"flex",fontSize:"12px",fontWeight:"bold",alignItems:"center"},Object(O.a)(t,"alignItems","center"),Object(O.a)(t,"cursor","pointer"),t),itemButtomActive:{width:"100%",padding:"7px",color:dt("menuButtonColor",1),backgroundColor:"rgba(255,255,255,0.2)",borderRadius:"0px",display:"flex",alignItems:"center",fontSize:"12px",fontWeight:"bold",cursor:"pointer"},themeExample:(r={},Object(O.a)(r,e.breakpoints.up("md"),{left:"auto !important",right:"0 !important"}),Object(O.a)(r,e.breakpoints.down("sm"),{left:"0 !important",right:"auto !important"}),r),module:{position:"fixed",top:"0px",left:"147px",width:"50px",height:"100vh",backgroundColor:"rgba(246,246,246,1)",boxShadow:"inset 4px 0px 3px 0px rgb(0 0 0 / 17%)",borderRight:"solid 4px ".concat(dt("color"))},moduleExpanded:{position:"fixed",top:"0",left:"147px",width:"311px",height:"100vh",backgroundColor:"rgba(246,246,246,1)",zIndex:"100 !important",boxShadow:"inset 4px 0px 3px 0px rgb(0 0 0 / 17%)",borderRight:"solid 4px ".concat(dt("color")),padding:"7px",overflowX:"auto"},moduleTitle:{width:"100%",height:"30px",fontSize:"18px",color:dt("menuButtonColor"),fontWeight:"bold",paddingLeft:"7px",marginTop:"15px"},sidebarWrapperWithPerfectScrollbar:{},separator:{position:"relative",float:"left",width:"100%",padding:"7px",borderTop:"1px solid ".concat(dt("medium",.5)),marginTop:"15px",marginBottom:"0px",height:"1px"},logoImg:{width:"66%",marginTop:"15px",justifyContent:"center"},user:{zIndex:"150 !important"}}};function mf(){mf=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}r(168).config();var gf=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(hf)((function(e){var t=De.getState(),r=t.db,n=(t.session,t.chat),a=t.notifications,o=t.timeline,c=e.classes,l=i.a.useState(!1),u=Object(Be.a)(l,2),d=u[0],p=u[1],f=i.a.useState(null),m=Object(Be.a)(f,2),g=m[0],v=m[1],y=window.location.hash.split("/");y[0]=y[0].replace("#",""),i.a.useEffect((function(){d||p(!0)}),[a]);var b=function(){var t=Object(Me.a)(mf().mark((function t(r,a,o){var i,c=arguments;return mf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=c.length>3&&void 0!==c[3]?c[3]:"users",!r||window.location.pathname===r&&a!==g||s.push(r),v(a),"chat"!==a||o?"chat"===a&&o?e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},n),{},{open:!0,db:i,nodeId:o})):e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},n),{},{open:!1})):e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},n),{},{open:!0}));case 4:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}(),x=[],_=[];Object.keys(a).sort((function(e,t){return parseInt(a[e].created_at)>parseInt(a[t].created_at)?-1:1})).filter((function(e){return"card"===a[e].module})).sort((function(e,t){return a[e].created_at.low-a[t].created_at.low})).map((function(e,t){-1===_.indexOf(a[e].nodeId)&&(x.push(e),_.push(a[e].nodeId))}));var w=[],E=[];return Object.keys(a).sort((function(e,t){return parseInt(a[e].created_at)>parseInt(a[t].created_at)?-1:1})).filter((function(e){return"timeline"===a[e].module})).sort((function(e,t){return a[e].created_at.low-a[t].created_at.low})).map((function(e,t){a[e].inNode&&a[e].inNode._id&&-1===E.indexOf(a[e].inNode._id)&&(w.push(e),E.push(a[e].inNode._id))})),r.myTasksMenuExpanded,i.a.createElement("div",null,i.a.createElement(vo,null,i.a.createElement(xo,{xs:12,sm:12,md:12,lg:12,xl:12},i.a.createElement("div",{className:c.moduleTitle},lt("$__notifications"))),i.a.createElement(xo,{xs:12,sm:6,md:4,lg:4,xl:4},i.a.createElement("div",{className:c.moduleTitle},lt("$__cardsUpdated")),x.map((function(e){if(!y[1]||y[1]&&("important"===y[1]||"favorite"===y[1]||"archive"===y[1]||"latest"===y[1]))return i.a.createElement(ff,{data:a[e],key:e})}))),i.a.createElement(xo,{xs:12,sm:6,md:8,lg:8,xl:8},i.a.createElement("div",{className:c.moduleTitle},lt("$__timelineUpdated")),w.map((function(e){if(!y[1]||y[1]&&("important"===y[1]||"favorite"===y[1]||"archive"===y[1]||"latest"===y[1]))return i.a.createElement(ff,{data:a[e],key:e,openChat:function(e,t){return b(null,"chat",e,t)},showTimeline:!0,timeline:a[e]&&a[e].inNode&&a[e].inNode._id&&r.cards[a[e].inNode._id]&&o[a[e].inNode._id]?o[a[e].inNode._id]:{}})})))))}))),vf={root:{position:"relative",width:"100%",backgroundColor:"".concat(dt("color","0.1")," !important"),"& .MuiLinearProgress-indeterminate":{backgroundColor:"#FFFFFF !important"},"& .MuiLinearProgress-bar":{backgroundColor:"".concat(dt("color")," !important")},"& .text":{position:"absolute",width:"40px",right:"-40px",top:"-9px",textAlign:"right",textSize:"11px",fontWeight:"bold",color:dt("color")}},bar:{borderRadius:7}};var yf=Object(Ze.a)(vf)((function(e){var t=e.classes;return i.a.createElement("div",{className:t.root},i.a.createElement(Ga.a,null))})),bf={checkRoot:{padding:"14px","&:hover":{backgroundColor:"unset"}},radioRoot:{padding:"16px","&:hover":{backgroundColor:"unset"}},labelRoot:{marginLeft:"-14px"},checkboxAndRadio:{position:"relative",display:"block",marginTop:"10px",marginBottom:"10px"},checkboxAndRadioHorizontal:{position:"relative",display:"block","&:first-child":{marginTop:"10px"},"&:not(:first-child)":{marginTop:"-14px"},marginTop:"0",marginBottom:"0"},checked:{color:nr[0]+"!important"},checkedIcon:{width:"20px",height:"20px",border:"1px solid rgba("+Zt("#000")+", .54)",borderRadius:"3px",display:"flex",justifyContent:"center",alignItems:"center"},uncheckedIcon:{width:"0px",height:"0px",padding:"9px",border:"1px solid rgba("+Zt("#000")+", .54)",borderRadius:"3px",display:"flex",justifyContent:"center",alignItems:"center"},disabledCheckboxAndRadio:{"& $checkedIcon,& $uncheckedIcon,& $radioChecked,& $radioUnchecked":{borderColor:"#000",opacity:"0.26",color:"#000"}},label:{cursor:"pointer",paddingLeft:"0",color:sr[3],fontSize:"12px",lineHeight:"1.428571429",fontWeight:"400",display:"inline-flex",transition:"0.3s ease all",letterSpacing:"unset"},labelHorizontal:{color:"rgba("+Zt("#000")+", 0.26)",cursor:"pointer",display:"inline-flex",fontSize:"12px",lineHeight:"1.428571429",fontWeight:"400",paddingTop:"39px",marginRight:"0","@media (min-width: 992px)":{float:"right"}},labelHorizontalRadioCheckbox:{paddingTop:"22px"},labelLeftHorizontal:{color:"rgba("+Zt("#000")+", 0.26)",cursor:"pointer",display:"inline-flex",fontSize:"12px",lineHeight:"1.428571429",fontWeight:"400",paddingTop:"22px",marginRight:"0"},labelError:{color:or[0]},radio:{color:nr[0]+"!important"},radioChecked:{width:"16px",height:"16px",border:"1px solid "+nr[0],borderRadius:"50%"},radioUnchecked:{width:"0px",height:"0px",padding:"7px",border:"1px solid rgba("+Zt("#000")+", .54)",borderRadius:"50%"},inlineChecks:{marginTop:"8px"},iconCheckbox:{height:"116px",width:"116px",color:sr[0],padding:"0",margin:"0 auto 20px","& > span:first-child":{borderWidth:"4px",borderStyle:"solid",borderColor:sr[9],textAlign:"center",verticalAlign:"middle",borderRadius:"50%",color:"inherit",transition:"all 0.2s"},"&:hover":{color:lr[0],"& > span:first-child":{borderColor:lr[0]}}},iconCheckboxChecked:{color:lr[0],"& > span:first-child":{borderColor:lr[0]}},iconCheckboxIcon:{fontSize:"40px",lineHeight:"111px"},switchBase:{color:nr[0]+"!important"},switchIcon:{boxShadow:"0 1px 3px 1px rgba("+Zt("#000")+", 0.4)",color:"#FFF !important",border:"1px solid rgba("+Zt("#000")+", .54)"},switchIconChecked:{borderColor:nr[0],transform:"translateX(0px)!important"},switchBar:{width:"30px",height:"15px",backgroundColor:"rgb("+Zt(sr[18])+")",borderRadius:"15px",opacity:"0.7!important"},switchChecked:{"& + $switchBar":{backgroundColor:"rgba("+Zt(nr[0])+", 1) !important"},"& $switchIcon":{borderColor:nr[0]}}},xf=Object(h.a)(Object(h.a)({},bf),{},{cardTitle:Object(h.a)(Object(h.a)({},jr),{},{textAlign:"center"}),container:Object(h.a)(Object(h.a)({},tr),{},{position:"relative",zIndex:"3"}),cardSignup:{borderRadius:"6px",boxShadow:"0 16px 24px 2px rgba("+Zt("#000")+", 0.14), 0 6px 30px 5px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt("#000")+", 0.2)",marginBottom:"100px",padding:"40px 0px",marginTop:"15vh"},center:{textAlign:"center"},right:{textAlign:"right"},left:{textAlign:"left"},form:{padding:"0 20px",position:"relative"},socialTitle:{fontSize:"18px"},inputAdornment:{marginRight:"18px",position:"relative"},inputAdornmentIcon:{color:sr[6]},textFields:{margin:"15px 0"},checkboxLabelControl:{margin:"0"},checkboxLabel:{fontSize:"12px",marginLeft:"6px",color:"rgba("+Zt("#000")+", 0.26)"}});function _f(){_f=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var wf=Object(Lt.a)(xf);r(1510);function Ef(){Ef=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Of=function(){var e=Object(Me.a)(Ef().mark((function e(t){var r,n,a,o,i;return Ef().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Object(h.a)({},t),Object.keys(n).map((function(e){n[e]||delete n[e]})),n.name.trim().split("\n"),a={},o={},n.users&&n.users.length>0&&n.users.map((function(e,t){var r=De.getState().db.users[e];o=Object(h.a)(Object(h.a)({},o),{},Object(O.a)({},e,Object(h.a)({_id:e,name:r.name,image:r.image||null},0===t?{isResponsible:!0}:{})))})),i=Object(Pn.a)(),ot.post("card/add",Object(h.a)({_id:i},n)),a=Object(h.a)(Object(h.a)({},a),{},Object(O.a)({},i,Object(h.a)(Object(h.a)({_id:i},n),{},{_users:o}))),(null===(r=a[i])||void 0===r?void 0:r.users)&&delete a[i].users,e.abrupt("return",a);case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),jf=function(){var e=Object(Me.a)(Ef().mark((function e(t){var r,n,a=arguments;return Ef().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:"order",n=a.length>2&&void 0!==a[2]?a[2]:0,e.prev=2,e.next=5,ot.post("kanban/reorder",{cards:t,orderBy:r});case 5:return e.abrupt("return",!0);case 8:e.prev=8,e.t0=e.catch(2),n<3&&setTimeout((function(){jf(t,r,n+1)}),3e3);case 11:case"end":return e.stop()}}),e,null,[[2,8]])})));return function(t){return e.apply(this,arguments)}}(),Sf=function(){var e=Object(Me.a)(Ef().mark((function e(t){return Ef().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ot.put("card/link",t);case 3:return e.abrupt("return",!0);case 6:e.prev=6,e.t0=e.catch(0),setTimeout((function(){Sf(t)}),3e3);case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),kf=function(){var e=Object(Me.a)(Ef().mark((function e(t){var r,n;return Ef().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(h.a)({},t),e.next=3,ot.post("kanban/automation",r);case 3:return n=e.sent,e.abrupt("return",n);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Lf=function(e){var t=De.getState().db.cards,r={},n=[];return t&&Object.keys(t).length>0&&Object.keys(t).filter((function(r){return t[r]._parent===e&&"step"===t[r].type&&!t[r].deleted})).length>0&&Object.keys(t).filter((function(r){return t[r]._parent===e&&"step"===t[r].type&&!t[r].deleted})).sort((function(e,r){var n=t[e].step||1,a=t[r].step||1;return parseInt(n)<parseInt(a)?-1:parseInt(n)>parseInt(a)?1:0})).map((function(a,o){var i=[];Object.keys(t).length>0&&Object.keys(t).filter((function(r){return t[r]._parent===a||0===o&&t[r]._parent===e&&!t[r].deleted&&"objective"!==t[r].type&&"goal"!==t[r].type&&"step"!==t[r].type&&-1===t[r].type.indexOf("guideline")&&"link"!==t[r].type&&"insight"!==t[r].type&&"threat"!==t[r].type&&"strength"!==t[r].type&&"weakness"!==t[r].type&&"opportunity"!==t[r].type&&"chatGroup"!==t[r].type})).sort((function(e,r){var n,a,o,i,c,l,s,u,d,p,f,h,m=0,g=0;return(null===(n=t[e])||void 0===n?void 0:n.order)&&(m=String((null===(a=t[e])||void 0===a||null===(o=a.order)||void 0===o?void 0:o.low)?null===(i=t[e])||void 0===i||null===(c=i.order)||void 0===c?void 0:c.low:null===(l=t[e])||void 0===l?void 0:l.order)),(null===(s=t[r])||void 0===s?void 0:s.order)&&(g=String((null===(u=t[r])||void 0===u||null===(d=u.order)||void 0===d?void 0:d.low)?null===(p=t[r])||void 0===p||null===(f=p.order)||void 0===f?void 0:f.low:null===(h=t[r])||void 0===h?void 0:h.order)),parseInt(m)<parseInt(g)?-1:parseInt(m)>parseInt(g)?1:0})).map((function(e,r){i.push(Object(h.a)(Object(h.a)({},t[e]),{},{order:String(r)}))})),r=Object(h.a)(Object(h.a)({},r),{},Object(O.a)({},a,{id:a,name:t[a].name,icon:t[a].icon||null,items:i})),-1===n.indexOf(a)&&n.push(a)})),{columns:r,columnOrder:n}};function Cf(){Cf=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}function If(e,t,r){var n=Array.from(e),a=n.splice(t,1),o=Object(Be.a)(a,1)[0];return n.splice(r,0,o),n}function Ff(e){var t=e.draggableStyle,r=e.virtualStyle,n=e.isDragging,a=Object(h.a)(Object(h.a)({},r),t);return Object(h.a)(Object(h.a)({},a),{},{height:n?a.height:a.height-8,left:n?a.left:a.left+8,width:n?t.width:"calc(".concat(a.width," - ").concat(16,"px)"),marginBottom:8})}var Tf=function(e){var t=e.provided,r=e.item,n=e.style,a=e.isDragging;return i.a.createElement("div",Object.assign({},t.draggableProps,t.dragHandleProps,{style:Ff({draggableStyle:t.draggableProps.style,virtualStyle:n,isDragging:a}),className:"item ".concat(a?"is-dragging":""),ref:t.innerRef}),i.a.createElement(oc,{data:r,db:"cards",isDragging:a,manualExpanded:e.manualExpanded||!1,onResize:function(t,r){e.onResize&&e.onResize(t)},onExpand:function(t){e.onExpand&&e.onExpand(t)}}))},Nf=i.a.memo((function(e){var t=e.index,r=e.column,n=Object(o.useRef)(),a=Object(o.useRef)({}),c=Object(o.useRef)({});Object(o.useLayoutEffect)((function(){var e=n.current;e&&e.scrollTo(0)}),[t]);var l=function(t){var r=t.data,o=t.index,l=t.style,s=r[o];return s?i.a.createElement(di.b,{draggableId:s._id,index:o,key:s._id},(function(t){return i.a.createElement(Tf,{provided:t,item:s,style:l,manualExpanded:e.cardsExpanded||(null===c||void 0===c?void 0:c.current[s._id])||!1,onResize:function(e){!function(e,t){var r;(null===n||void 0===n||null===(r=n.current)||void 0===r?void 0:r.resetAfterIndex)&&n.current.resetAfterIndex(0),a.current=Object(h.a)(Object(h.a)({},a.current),{},Object(O.a)({},e,t))}(s._id,e)},onExpand:function(e){!function(e,t){var r;"undefined"!==String(t)&&"null"!==String(t)&&((null===n||void 0===n||null===(r=n.current)||void 0===r?void 0:r.resetAfterIndex)&&n.current.resetAfterIndex(0),c.current=Object(h.a)(Object(h.a)({},c.current),{},Object(O.a)({},e,t)))}(s._id,e)}})})):null},s=r.items;return i.a.createElement(di.c,{droppableId:r.id,mode:"virtual",renderClone:function(t,r,n){var a=s[n.source.index];return i.a.createElement(Tf,{provided:t,isDragging:r.isDragging,item:a,manualExpanded:e.cardsExpanded||(null===c||void 0===c?void 0:c.current[a._id])||!1,snapshot:r})}},(function(t,o){var c=o.isUsingPlaceholder?s.length+1:s.length;return i.a.createElement(zc.a,{style:{width:"100%",height:"100%"}},(function(o){var s=o.height;o.width;return i.a.createElement($c.b,{width:279,height:s,itemCount:c,itemSize:function(e){var t,n;return n=(null===(t=r.items[e])||void 0===t?void 0:t._id)||null,a.current[n]+7||67},itemData:r.items,className:"task-list",ref:n,style:Object(h.a)({},e.style?e.style:{}),outerRef:t.innerRef},l)}))}))})),Pf=i.a.memo((function(e){var t=e.column,r=e.index,n=i.a.useState(!1),a=Object(Be.a)(n,2),o=a[0],c=a[1];return i.a.createElement(di.b,{draggableId:t.id,index:r},(function(n){return i.a.createElement("div",Object.assign({className:"column"},n.draggableProps,{ref:n.innerRef}),i.a.createElement("div",n.dragHandleProps,i.a.createElement(Io,{title:t.name,icon:t.icon||null,color:dt("menu"),style:{padding:"7px",width:"100%"},placeholder:lt("$__columnName"),customButtons:[{name:lt("$__columnSettings",1),icon:"more_horiz",color:dt("menu"),onClick:function(){e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{db:"cards",id:t.id,module:"columnEdit",activeModule:"columnEdit",data:De.getState().db.cards[t.id]}))},show:"hover"}]})),i.a.createElement(Nf,Object.assign({column:t,index:r},e)),o?i.a.createElement(Ei,{nodeId:t.id,onCancel:function(){return c(!1)},rows:t.items.length}):i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",padding:"7px"}},i.a.createElement(rn,{text:lt("$__add","*"),icon:"add_box",iconColor:dt("medium"),onClick:function(){c(!o)}})))}))}));var Df=Object($e.b)((function(e){return{cards:e.db.cards,cardsExpanded:e.db.cardsExpanded}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=Object(o.useState)(Lf(e.nodeId)),r=Object(Be.a)(t,2),n=r[0],a=r[1],c=Object(o.useState)(!1),l=Object(Be.a)(c,2),s=l[0],u=l[1],d=Object(o.useState)(!1),p=Object(Be.a)(d,2),f=p[0],m=p[1];function g(){return(g=Object(Me.a)(Cf().mark((function t(r){var a,o,i,c,l,s,u,d,p,f,g,v,y;return Cf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(m(!1),r.destination){t.next=3;break}return t.abrupt("return");case 3:if("column"!==r.type){t.next=10;break}return a=If(n.columnOrder,r.source.index,r.destination.index),o={},a.map((function(e,t){o=Object(h.a)(Object(h.a)({},o),{},Object(O.a)({},e,Object(h.a)(Object(h.a)({},De.getState().db.cards[e]),{},{step:"".concat(t)})))})),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),o)})),JSON.stringify(a)!==JSON.stringify(n.columnOrder)&&jf(a,"step"),t.abrupt("return");case 10:if(r.source.droppableId!==r.destination.droppableId){t.next=19;break}return i=n.columns[r.source.droppableId],c=If(i.items,r.source.index,r.destination.index),l={},s=[],c.map((function(e,t){l=Object(h.a)(Object(h.a)({},l),{},Object(O.a)({},e._id,Object(h.a)(Object(h.a)({},De.getState().db.cards[e._id]),{},{order:"".concat(t+1)}))),-1===s.indexOf(e._id)&&s.push(e._id)})),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),l)})),jf(s,"order"),t.abrupt("return");case 19:u=n.columns[r.source.droppableId],d=u.items[r.source.index],p=De.getState().db.cards[r.destination.droppableId],f=De.getState().db.cards[u.items[r.source.index]._id],g={},p&&p.automationDueDateType&&"add"===p.automationDueDateType&&(g=Object(h.a)({endDate:Ve()("".concat(Ve()().format("YYYY-MM-DD")," 23:59:59")).add((null===p||void 0===p?void 0:p.automationDueDate)||1,"days").unix("X")},f.startDate?{}:{startDate:Ve()().unix("X")})),p&&p.automationStatusType&&"replace"===p.automationStatusType&&(g=Object(h.a)(Object(h.a)({},g),{},{status:p.automationStatus||"notStarted"},p.automationStatus&&"completed"===p.automationStatus?{completed_at:Ve()().unix("x")}:{})),v=[],p&&p.automationUsers&&"add"===p.automationUsers&&p._users&&Object.keys(p._users).filter((function(e){return e})).length>0&&Object.keys(p._users).filter((function(e){return e})).map((function(t){if(p._users[t].isResponsible&&(y=t),f&&(!f._users||f._users&&!f._users[t])){var r=!(!f._users||!f._users[t]);ao(e,t,p._users[t].access,f._id,r)}})),p&&p.automationUsers&&"remove"===p.automationUsers&&p._users&&Object.keys(p._users).filter((function(e){return e})).length>0&&Object.keys(p._users).filter((function(e){return e})).map((function(e){f&&f._users&&f._users[e]&&v&&-1===v.indexOf(e)&&v.push(e)})),p&&p.automationUsers&&"replace"===p.automationUsers&&p._users&&Object.keys(p._users).filter((function(e){return e})).length>0&&(Object.keys(p._users).filter((function(e){return e})).map((function(t){if(p._users[t].isResponsible&&(y=t),f&&(!f._users||f._users&&!f._users[t])){var r=!(!f._users||!f._users[t]);ao(e,t,p._users[t].access,f._id,r)}})),f&&f._users&&Object.keys(f._users).filter((function(e){return e})).length>0&&Object.keys(f._users).filter((function(e){return e})).map((function(e){p._users[e]||-1!==v.indexOf(e)||v.push(e)}))),v.length>0&&ot.put("cards/removeAccess/",{cardId:f._id,userIds:v}),y&&oo(e,{cardId:f._id,userId:y}),g!=={}&&kf(Object(h.a)({_id:u.items[r.source.index]._id},g)),Sf({idRel:u.items[r.source.index]._id,destination:r.destination.droppableId}),g&&g.status&&"completed"===g.status&&!g.completed_at&&(g=Object(h.a)(Object(h.a)({},g),{},{completed_at:Ve()().unix("x")})),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},d._id,Object(h.a)(Object(h.a)(Object(h.a)({},De.getState().db.cards[d._id]),g),{},{_parent:r.destination.droppableId})))}));case 36:case"end":return t.stop()}}),t)})))).apply(this,arguments)}i.a.useEffect((function(){a(Lf(e.nodeId))}),[e.cards,e.nodeId]);var v=function(){var t=Object(Me.a)(Cf().mark((function t(r){var n;return Cf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Of(r);case 2:(n=t.sent)&&e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),n)}));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return i.a.createElement(di.a,{onDragEnd:function(e){return g.apply(this,arguments)},onDragStart:function(){m(!0)}},i.a.createElement("div",{className:"app",style:{display:"flex",overflowY:"auto"}},i.a.createElement(di.c,{droppableId:"all-droppables",direction:"horizontal",type:"column"},(function(t){return i.a.createElement("div",Object.assign({},t.droppableProps,{className:"columns",ref:t.innerRef}),n.columnOrder.map((function(t,r){return i.a.createElement(Pf,Object.assign({},e,{key:t,column:n.columns[t],index:r},e.columProps?e.columProps:{}))})),i.a.createElement("div",{className:"column",style:{display:f?"none":"flex",justifyContent:"center",height:"100%"}},s?i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#FFFFFF",width:279,padding:7}},i.a.createElement(Io,{style:{width:"100%"},title:null,color:dt("menu"),editable:!0,permitIcon:!0,onEdit:function(t){u(!1),v(Object(h.a)(Object(h.a)({},t),{},{_parent:e.nodeId,type:"step",step:String(n.columnOrder.length),checklist:!0}))},placeholder:lt("$__columnName"),onCancel:function(){u(!1)}})):i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#FFFFFF",color:"black",padding:15,width:279}},i.a.createElement(At,{title:lt("$__addColumn"),text:lt("$__addColumn"),color:"lightgrey",textColor:"lightgrey",icon:"add_box",onClick:function(){u(!0)},size:"25px"}))),t.placeholder)}))))})),Af={container:Object(h.a)(Object(h.a)({},rr),{},{position:"relative",border:"0.5px solid ".concat(dt("light")),borderRadius:"2px",padding:"0px",display:"block",minWidth:"240px !important",backgroundColor:"#FFFFFF",boxShadow:"0px 0px 10px rgba(0,0,0,0.1)",overflow:"hidden",minHeight:"50px"}),parent:{width:"100%",padding:"0 5px","& .title":{color:dt("medium"),fontSize:"10px",textTransform:"uppercase"},"& .info":{marginTop:"-8px",color:dt("color"),fontWeight:"500"}},indicators:{position:"relative",float:"left",width:"100%",padding:"0 5px",height:"auto",display:"flex"},indicatorsIcon:{margin:"0px 0px"},image:{position:"relative",float:"left",width:"100%",maxWidth:"100%",backgroundColor:"rgb(0,0,0)",backgroundSize:"cover",backgroundPosition:"center"},progress:{position:"relative",float:"left",padding:"0 12px",width:"calc(100% - 15x)"},description:{position:"relative",float:"left",padding:"5px"},dates:{position:"relative",float:"left",marginTop:"7px",padding:"0 5px",marginRight:"15px",color:dt("medium"),fontSize:"10px",display:"flex"},dateInfo:{marginRight:"15px",display:"flex",alignItems:"center"},users:{position:"absolute",bottom:"2px",right:"2px",fontSize:"10px","& .MuiAvatarGroup-root":{justifyContent:"flex-end"},"& .MuiAvatar-root":{width:"25px",height:"25px",fontSize:"10px"}}};var $f,zf,Mf=Object(Ze.a)(Af)(Object(o.memo)((function(e){var t=e.data,r=De.getState().db,n=[],a=r.cards,o=function(e,t){if(!t.isDropAnimating)return Object(h.a)({},e);var r=t.dropAnimation,n=r.moveTo,a=(r.curve,r.duration,"translate(".concat(n.x,"px, ").concat(n.y,"px)"));return Object(h.a)(Object(h.a)({},e),{},{clear:"both",transition:"all 0.1s ease",transform:"".concat(a," ").concat(""),border:"solid 3px ".concat(dt("color")),backgroundColor:dt("color"),padding:"3px"})};return Object.keys(a).map((function(e){return a[e]._parent===t._id&&(n[a[e].type]=null==n[a[e].type]?1:n[a[e].type]+1),!1})),i.a.createElement(di.b,{draggableId:t.id?t.id:t._id?t._id:null,index:Math.floor(10*Math.random()),key:t.id?t.id:t._id?t._id:null,isDragDisable:t.isDragDisable||e.isDragDisable||!1},(function(t,r){return i.a.createElement("div",Object.assign({ref:t.innerRef},t.draggableProps,t.dragHandleProps,{style:o(t.draggableProps.style,r)}),i.a.createElement(oc,{data:e.data,db:e.db,showOrder:e.showOrder||!1,showSelected:e.showSelected||!1,locked:e.locked||!1,viewButton:e.viewButton||!1,showConnectedIn:!!e.showConnectedIn,isDragging:r.isDragging&&!r.isDropAnimating,snapshot:r,cardColorPicker:!!e.cardColorPicker}))}))})));function Bf(){Bf=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Yf,Gf=Xe.default.div($f||($f=Object(ze.a)(["\n margin:0 7px;\n min-width:180px;\n ","\n @media(min-width: 960px) {\n position:relative;\n max-height:",";\n \n ","\n }\n @media(max-width: 959px) {\n float:left;\n position: relative;\n }\n @media(max-width: 599px) {\n float:left;\n position: relative;\n }\n "])),(function(e){return e.columnStyle&&e.columnStyle.width?"width:calc(".concat(e.columnStyle.width," - 14px);"):"width:calc(100% - 14px);"}),(function(e){return e.columnStyle&&e.columnStyle.maxHeight?e.columnStyle.maxHeight:"calc(100% - 0px)"}),(function(e){return e.inLine?"display:block;\n ":"margin-bottom:0px !important;\n ".concat((function(e){return e.columnStyle&&e.columnStyle.width?"width:".concat(e.columnStyle.width,";"):"width:100%;"}),"\n ")})),Rf=Xe.default.div(zf||(zf=Object(ze.a)(["\nposition:relative;\nheight:100%;\nwidth:100%;\nmax-height:",";\n",";\n ",";\n","\n"])),(function(e){return e.columnStyle&&e.columnStyle.maxHeight?e.columnStyle.maxHeight:"calc(100% - 30px)"}),(function(e){return e.columnStyle&&e.columnStyle.maxWidth?e.columnStyle.maxWidth:"250px"}),(function(e){return e.isDraggingOver?"background-color:".concat(dt("color"),"; opacity:0.5;"):""}),(function(e){return e.inLine?"\n display:table;\n margin-bottom:33px":"display:block;\n min-height: 150px !important;\n padding-bottom:15px;\n overflow-y: auto;\n "})),Hf=Object($e.b)((function(e){return{search:e.search,dbCards:e.db.cards,groupByColor:e.db.groupByColor,orderByTitle:e.db.orderByTitle,orderByTitlePosition:e.db.orderByTitlePosition}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Hp)((function(e){Ve()().tz("America/Sao_Paulo").format("YYYY/MM/DD");var t=De.getState(),r=t.search,n=t.session,a=t.db,o=e.classes,c=i.a.useState(""),l=Object(Be.a)(c,2),s=l[0],u=l[1],d=i.a.useState(!1),p=Object(Be.a)(d,2),f=p[0],m=p[1],g=window.location.hash.split("/");g[0]=g[0].replace("#",""),36!==g[0].length&&(g[0]=null);var v=e.cards;r&&r.cards&&(r.cards.startDate||r.cards.endDate)&&(v=v.filter((function(e){return!!(e&&r.cards.startDate&&e.startDate&&e.startDate>=r.cards.startDate&&r.cards.endDate&&e.endDate&&e.endDate<=r.cards.endDate)})).map((function(e){return e}))),r.text&&(v=v.filter((function(e){return!!(e&&e.name&&e.name.toLowerCase().indexOf(r.text.toLowerCase())>-1)})).map((function(e){return e}))),v=(v=v.filter((function(e){return!(e.status&&!(e&&e.status&&r.cards.status[e.status]))})).map((function(e){return e}))).filter((function(e){return!!(e&&e.priority&&r.cards.priority[e.priority]||r.cards.priority.null&&!e.priority)})).map((function(e){return e})),r.users.selected&&Object.keys(r.users.selected).length>0&&(v=v.filter((function(e){if(e&&e._users&&Object.keys(e._users).filter((function(e){return r.users.selected[e]})).length>0)return!0})).map((function(e){return e}))),Object.keys(r.units.selected).length>0&&(v=r.units.selected.unassigned?v.filter((function(e){if(!e._planId||e._planId&&a.cards[e._planId]&&!a.cards[e._planId].client)return!0})).map((function(e){return e})):v.filter((function(e){var t=!1;return Object.keys(a.cards).filter((function(e){if(a.cards[e].client&&r.units.selected[a.cards[e].client])return!0})).map((function(r){e._planId&&e._planId===a.cards[r]._id&&(t=!0)})),t})).map((function(e){return e}))),Object.keys(r.groups.selected).length>0&&(v=r.groups.selected.unassigned?v.filter((function(e){if(!e._planId||e._planId&&a.cards[e._planId]&&!a.cards[e._planId].client)return!0})).map((function(e){return e})):v.filter((function(e){var t=!1;return Object.keys(a.cards).filter((function(e){if(a.cards[e].client&&r.groups.selected[a.cards[e].client])return!0})).map((function(r){e._planId&&e._planId===a.cards[r]._id&&(t=!0)})),t})).map((function(e){return e}))),Object.keys(r.plans.selected).filter((function(e){return e})).length>0&&(v=v.filter((function(e){if(r.plans.selected[e._planId])return!0})).map((function(e){return e}))),r.tags.length>0&&(v=v.filter((function(e){return e._tags&&e._tags.length>0&&e._tags.filter((function(e){var t=!1;return r.tags.map((function(r){r.value===e.value&&(t=!0)})),t})).length>0})).map((function(e){return e})));var y=String(n.dashboard.period).replace("$__last","");y=y.replace("Days","");var b=Ve()(new Date).tz("America/Sao_Paulo").subtract(parseInt(y),"d").format("YYYY-MM-DDT00:00"),x=Ve()(new Date).tz("America/Sao_Paulo").format("YYYY-MM-DDT23:59");e&&e.periodFilter&&(v=v.filter((function(e){if("completed"===e.status&&e.completed_at&&(e.completed_at.low&&Ve()(new Date(1e3*e.completed_at.low)).tz("America/Sao_Paulo").format("YYYY-MM-DDT23:59")<=x&&Ve()(new Date(1e3*e.completed_at.low)).tz("America/Sao_Paulo").format("YYYY-MM-DDT00:00")>=b||e.completed_at&&!e.completed_at.low&&Ve()(new Date(1e3*e.completed_at)).tz("America/Sao_Paulo").format("YYYY-MM-DDT23:59")<=x&&Ve()(new Date(1e3*e.completed_at)).tz("America/Sao_Paulo").format("YYYY-MM-DDT00:00")>=b)||"completed"!==e.status&&e.updated_at&&(e.updated_at.low&&Ve()(new Date(1e3*e.updated_at.low)).tz("America/Sao_Paulo").format("YYYY-MM-DDT23:59")<=x&&Ve()(new Date(1e3*e.updated_at.low)).tz("America/Sao_Paulo").format("YYYY-MM-DDT00:00")>=b||e.updated_at&&!e.updated_at.low&&Ve()(new Date(1e3*e.updated_at)).tz("America/Sao_Paulo").format("YYYY-MM-DDT23:59")<=x&&Ve()(new Date(1e3*e.updated_at)).tz("America/Sao_Paulo").format("YYYY-MM-DDT00:00")>=b))return!0})).map((function(e){return e}))),e.showDeleted||De.getState().controls.deleted||(v=v.filter((function(e){return!e.deleted})).map((function(e){return e})));var _=o.cardList+" "+We()(Object(O.a)({},o.mainPanelWithPerfectScrollbar,navigator.platform.indexOf("Win")>-1)),w=function(){var t=Object(Me.a)(Bf().mark((function t(){return Bf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:De.getState().functions.socket.emit("data",{module:"cards",method:"post",action:"add"},{_parent:e.selectedParent?e.selectedParent:g[0]?g[0]:null,_planId:g[0]&&36===g[0].length?g[0]:null,name:s,type:e.typeAdd?e.typeAdd:e.columnId.length<36?e.columnId:null,status:"notStarted"},function(){var e=Object(Me.a)(Bf().mark((function e(t){return Bf().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u("");case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),E=lt(e.column.name,1),j={};De.getState().db.cards[g[0]]&&De.getState().db.cards[g[0]].customColumns&&(j=JSON.parse(De.getState().db.cards[g[0]].customColumns)),j&&j[e.column.name.replace("$__","")]&&j[e.column.name.replace("$__","")].name&&(E=lt(j[e.column.name.replace("$__","")].name,1));var S=[];return i.a.createElement(di.b,{draggableId:e.columnId?String(e.columnId):"NOT_ID_SENDED",index:e.index},(function(t){var r,a;return i.a.createElement(Gf,Object.assign({},!e.isDropDisabled&&t.draggableProps,e,{ref:t.innerRef}),i.a.createElement("div",Object.assign({},t.draggableProps,t.dragHandleProps,{style:{display:"none"}})),i.a.createElement("div",!e.isDropDisabled&&t.dragHandleProps,i.a.createElement(Io,Object.assign({title:E,icon:(null===(r=j[e.column.name.replace("$__","")])||void 0===r?void 0:r.icon)?null===(a=j[e.column.name.replace("$__","")])||void 0===a?void 0:a.icon:e.column.icon||"topic",color:dt("menu"),style:{padding:"7px"}},g.length>0&&g[1]&&"overview"===g[1]&&De.getState().db.cards[g[0]]&&De.getState().db.cards[g[0]].planType&&"operational"===De.getState().db.cards[g[0]].planType&&De.getState().db.cards[g[0]]._users&&De.getState().db.cards[g[0]]._users[n._id]&&De.getState().db.cards[g[0]]._users[n._id].access&&parseInt(De.getState().db.cards[g[0]]._users[n._id].access)>3?{editable:!0,onEdit:function(t){pa(Object(h.a)(Object(h.a)({},e),{},{data:{_id:g[0]}}),{customColumns:JSON.stringify(Object(h.a)(Object(h.a)({},De.getState().db.cards[g[0]]&&De.getState().db.cards[g[0]].customColumns?JSON.parse(De.getState().db.cards[g[0]].customColumns):{}),{},Object(O.a)({},e.column.name.replace("$__",""),t)))})},placeholder:lt("$__columnName")}:{},{customButtons:[e.columnsSettings&&{name:"settings",icon:"more_horiz",color:dt("color"),onClick:function(){return console.log("s")},show:"hover"}],periodFilter:!(!e||!e.periodFilter)}))),i.a.createElement(di.c,{droppableId:e.columnId?String(e.columnId):"NOT_ID_SENDED",type:"card",isDropDisabled:e.column.isDropDisabled,direction:"".concat(e.inLine?"horizontal":"vertical"),isCombineEnabled:e.isCombineEnabled},(function(t,r){return i.a.createElement(Rf,Object.assign({className:_,ref:t.innerRef},t.droppableProps,{isDraggingOver:r.isDraggingOver,inLine:e.inLine},e),v.sort((function(t,r){var n="ASC"===e.orderByTitlePosition?t.name.toLowerCase():r.name.toLowerCase(),a="ASC"===e.orderByTitlePosition?r.name.toLowerCase():t.name.toLowerCase();if(e.groupByColor){if(t&&t._parent){var o=aa(t);o.parentId&&De.getState().db.cards[o.parentId]&&(n="".concat(De.getState().db.cards[o.parentId].name.toLowerCase()," - ").concat(t.name.toLowerCase()))}if(r&&r._parent){var i=aa(r);i.parentId&&De.getState().db.cards[i.parentId]&&(a="".concat(De.getState().db.cards[i.parentId].name.toLowerCase()," - ").concat(r.name.toLowerCase()))}}return n<a?-1:n>a?1:0})).map((function(t){var r="",n="";if(e.groupByColor&&!t.color){var a=aa(t);a&&a.parentId&&-1===S.indexOf(a.parentId)&&(r=De.getState().db.cards[a.parentId].name,n=a.color,S.push(a.parentId))}if(t)return i.a.createElement("div",{key:t._id||t.id?t._id:null},r?i.a.createElement("div",{style:{width:"100%",padding:3,color:"gray",marginTop:17,borderBottom:"solid 3px ".concat(n)}},r):i.a.createElement(i.a.Fragment,null),i.a.createElement(Mf,{data:t,inLine:e.inLine,isDragDisable:e.column.isDragDisable,db:e.db,showOrder:e.showOrder||!1,showSelected:e.showSelected||!1,locked:e.locked||!1,inLineAdd:e.inLineAdd||!1,viewButton:e.viewButton||!1,cardColorPicker:!!e.cardColorPicker}))})),e.inLineAdd&&!f&&i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",padding:"7px"}},i.a.createElement(rn,{text:lt("$__add","*"),icon:"add_box",iconColor:dt("medium"),onClick:function(){m(!f)}})),e.inLineAdd&&f&&i.a.createElement("div",{className:o.cardAdd,style:{position:"relative",float:"left",width:"100%",padding:"7px",display:"flex",alignItems:"center"}},i.a.createElement("div",{style:{width:"calc(100% - 50px)",display:"flex"}},i.a.createElement(La,{label:lt("$__nameOfCard"),variant:dt("fieldVariant"),name:"name",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",onChange:function(e){u(e.target.value)},onBlur:function(e){""===e.target.value&&m(!f)},onKeyDown:function(e){13===e.keyCode&&s&&w(),27===e.keyCode&&(m(!f),u(""))}},autoFocus:!0,value:s,placeholder:lt("$__titleOfCard_placeholder")})),i.a.createElement("div",{style:{display:"flex"}},i.a.createElement("div",{className:o.button,onClick:function(){return w()}},i.a.createElement(kt,{color:"green",icon:"save",title:lt("$__save","*"),size:e.actionsSize||"25px"})),i.a.createElement("div",{className:o.button,onClick:function(){m(!f),u("")}},i.a.createElement(kt,{color:dt("medium"),icon:"cancel",title:lt("$__cancel","*"),size:e.actionsSize||"25px"})))),t.placeholder,i.a.createElement("div",{style:{clear:"both"}}))})))}))})));function Wf(){Wf=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Uf=Xe.default.div(Yf||(Yf=Object(ze.a)(["\nheight:100%;\n","\n @media(max-width: 959px) {\n display: contents !important;\n width: -webkit-fill-available;\n height:auto;\n }\n "])),(function(e){return e.inLine?"display: block;\n width: -webkit-fill-available;\n position:relative;\n ".concat(e.style):" display: flex;\n width: 100%;\n ".concat(e.style,"\n @media(min-width: 960px) {\n display: flex;\n }\n ")})),Vf=Object($e.b)((function(e,t){return{}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState().db;i.a.useEffect((function(){}),[]);var r=function(){var r=Object(Me.a)(Wf().mark((function r(n){var a,o,i,c,l,s,u,d,p,f,m,g;return Wf().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(a=De.getState().functions.socket,o=n.destination,i=n.source,c=n.draggableId,l=t.cards,!n.combine){r.next=5;break}return r.abrupt("return");case 5:if(o){r.next=7;break}return r.abrupt("return",!1);case 7:if(o.droppableId!==i.droppableId||o.id!==i.index){r.next=9;break}return r.abrupt("return",!1);case 9:if(s=i.droppableId,u=o.droppableId,d=Array.from(e.cards.filter((function(e){return e.status===s})).sort((function(e,t){return e.order&&t.order&&String(e.order.low)&&String(t.order.low)&&parseInt(e.order.low)<parseInt(t.order.low)?-1:1})).map((function(e){return e._id}))),s!==u||De.getState().db.orderByTitle){r.next=21;break}return(p=Array.from(e.cards.filter((function(e){return e.status===s})).sort((function(e,t){return e.order&&t.order&&String(e.order.low)&&String(t.order.low)&&parseInt(e.order.low)<parseInt(t.order.low)?-1:1})).map((function(e){return e._id})))).splice(i.index,1),p.splice(o.index,0,c),p.map((function(e,t){l[e]=Object(h.a)(Object(h.a)({},l[e]),{},{order:{low:t}})})),f=Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},t.cards),l)}),e.reduxFunction("ASYNC","SET_DB",Object(h.a)({},f)),a.emit("data",{module:"cards",method:"put",action:"inColumn"},{node:c,source:i.droppableId,destination:o.droppableId,destinationCards:p,sourceCards:[],columnName:"status"}),r.abrupt("return");case 21:d.splice(i.index,1),(m=Array.from(e.cards.filter((function(e){return e.status===u})).sort((function(e,t){return e.order&&t.order&&String(e.order.low)&&String(t.order.low)&&parseInt(e.order.low)<parseInt(t.order.low)?-1:1})).map((function(e){return e._id})))).splice(o.index,0,c),d.map((function(e,r){t.cards[e].order&&t.cards[e].order.low?t.cards[e].order.low=parseInt(r):t.cards[e]=Object(h.a)(Object(h.a)({},t.cards[e]),{},Object(O.a)({},"order",Object(O.a)({},"low",parseInt(r))))})),m.map((function(e,r){t.cards[e].order&&t.cards[e].order.low?t.cards[e].order.low=parseInt(r):t.cards[e]=Object(h.a)(Object(h.a)({},t.cards[e]),{},Object(O.a)({},"order",Object(O.a)({},"low",parseInt(r))))})),g=Object(h.a)(Object(h.a)({},t),{},{cards:Object(h.a)(Object(h.a)({},t.cards),{},Object(O.a)({},c,Object(h.a)(Object(h.a)({},t.cards[c]),{},{status:u,completed_at:"completed"===u?{low:Ve()().tz("America/Sao_Paulo").unix("x")}:null,updated_at:{low:Ve()().tz("America/Sao_Paulo").unix("x")},order:{low:o.index}})))}),e.reduxFunction("ASYNC","SET_DB",Object(h.a)({},g)),a.emit("data",{module:"cards",method:"put",action:"inColumn"},{node:c,source:i.droppableId,destination:o.droppableId,destinationCards:m,columnName:"status",sourceCards:d});case 29:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}(),n=function(){var e=Object(Me.a)(Wf().mark((function e(t){return Wf().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),a=function(){var e=Object(Me.a)(Wf().mark((function e(t){return Wf().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return i.a.createElement(di.a,{onDragEnd:r,onDragStart:n,onDragUpdate:a},i.a.createElement(di.c,{droppableId:"ALL-COLUMNS-STATUS",type:"column",direction:"".concat(e.inLine?"vertical":"horizontal"),isDropDisabled:!0},(function(t){return i.a.createElement(Uf,Object.assign({},e,{ref:t.innerRef}),De.getState().db.status.map((function(t,r){var n={name:t.label,icon:t.icon,cards:[],emptyHide:!1};return i.a.createElement(Hf,Object.assign({},e,{key:"".concat(t.value),columnId:"".concat(t.value),isDropDisabled:!0,column:n,cards:e.cards.filter((function(e){return e.status===t.value||"notStarted"===t.value&&!e.status})).map((function(e){return Object(h.a)(Object(h.a)({},e),{},{id:e._id})})),index:r,columnsSettings:!1,locked:!1,columnStyle:Object(h.a)({flex:r,width:"25%"},e.columnStyle?e.columnStyle:{}),viewButton:e.viewButton||!1,periodFilter:!(!t.props||!t.props.periodFilter)}))})),t.placeholder,i.a.createElement("div",{style:{clear:"both"}}))})))}));var qf=Object($e.b)((function(e,t){return{db:e.db}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=e.db,r=t.dataType,n=window.location.hash.split("/");if(n[0]=n[0].replace("#",""),!t.cards)return i.a.createElement("div",null);var a=Object.keys(t.cards).filter((function(a){if(!t.cards[a].checklist&&t.cards[a]._planId===n[0]&&("actions"===e.type&&t.cards[a]&&t.cards[a].type&&"objective"!==t.cards[a].type&&"goal"!==t.cards[a].type&&"plan"!==t.cards[a].type&&"link"!==t.cards[a].type&&"insight"!==t.cards[a].type&&"chatGroup"!==t.cards[a].type&&-1===t.cards[a].type.indexOf("guideline")&&"swot"!==r.filter((function(e){return e.name===t.cards[a].type}))[0].module||"guidelines"===e.type&&t.cards[a].type.indexOf("guideline")>-1||"objectives"===e.type&&t.cards[a].type.indexOf("objective")>-1||"goals"===e.type&&t.cards[a].type.indexOf("goal")>-1))return!0})).map((function(e){return t.cards[e]}));return i.a.createElement("div",null,i.a.createElement(Io,{title:null,icon:null,color:dt("menu"),style:{background:"transparent",padding:"7px"},customButtons:[{title:t.orderByTitle?"$__orderByName":"$__orderByManualOrder",icon:t.orderByTitle?"sort":"format_list_numbered",onClick:function(){e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{orderByTitle:!t.orderByTitle}))}},t.orderByTitle&&{title:"ASC"===t.orderByTitlePosition?"$__asc":"$__desc",icon:"ASC"===t.orderByTitlePosition?"text_rotation_down":"text_rotate_up",onClick:function(){e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{orderByTitlePosition:"ASC"===t.orderByTitlePosition?"DESC":"ASC"}))}}]}),i.a.createElement(Vf,{cards:a}))})),Xf=r(1014),Jf=r(1702);function Kf(){Kf=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Zf=Object($e.b)((function(e){return{store:{cards:e.db.cards}}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t,r,n,a,o,c,l,s,u,d,p,m,g,v,y,b,x,_=De.getState(),w=_.db,E=(_.session,i.a.useState(!1)),O=Object(Be.a)(E,2),j=O[0],S=O[1],k=i.a.useState(1),L=Object(Be.a)(k,2),C=L[0],I=L[1],F=i.a.useState(1),T=Object(Be.a)(F,2),N=T[0],P=T[1],D=i.a.useState(1),A=Object(Be.a)(D,2),$=A[0],z=A[1],M=i.a.useState({editor:!1,text:"",height:"auto"}),B=Object(Be.a)(M,2),Y=B[0],R=B[1],H=i.a.useState(!1),W=Object(Be.a)(H,2),U=W[0],V=W[1],q=i.a.useState({type:"comment",disabledSend:!1}),X=Object(Be.a)(q,2),J=X[0],K=X[1],Z=Ve()().tz("America/Sao_Paulo").format("YYYY/MM/DD"),Q=window.location.hash.split("/");Q[0]=Q[0].replace("#",""),36!==Q[0].length&&(Q[0]=null);var ee=xt(),te=ia(Q[0]);i.a.useEffect((function(){j||(R(w.cards[Q[0]]&&w.cards[Q[0]].note?Object(h.a)(Object(h.a)({},Y),{},{text:w.cards[Q[0]].note?w.cards[Q[0]].note:""}):Object(h.a)({},Y)),S(!0))}));var re=function(){var t=Object(Me.a)(Kf().mark((function t(r){return Kf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!Y.text&&!r){t.next=6;break}return t.next=3,An(e,!1,Object(h.a)(Object(h.a)({},w.cards[Q[0]]),{},{note:r?null:Y.text}));case 3:t.sent&&ft({message:lt("$__noteSaved",1),variant:null,persist:!1,horizontal:"right",confirm:null}),R({editor:!1,text:r?"":Y.text,height:"auto"});case 6:V(!1);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();if(!Q[0]||!Q[0]||!w.cards[Q[0]])return i.a.createElement(i.a.Fragment,null);var ne=ma(Q[0]),ae={};return(null===(t=w.cards[Q[0]])||void 0===t?void 0:t.customColumns)&&(ae=JSON.parse(w.cards[Q[0]].customColumns)),i.a.createElement("div",{style:{width:"calc(100% + 30px)",paddingBottom:"30px",marginLeft:"-15px"}},i.a.createElement(vo,null,i.a.createElement(xo,{xs:12,sm:6,md:6,lg:6,style:{padding:0}},i.a.createElement("div",{style:{width:"100%"}},i.a.createElement($s,{style:{marginTop:"0"}},i.a.createElement(Fa,{title:lt("$__planResume",1),icon:"blur_on",color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"},moreButton:!0,optionsProps:{transparent:!0,btColor:dt("colorText")},options:te&&parseInt(te)>3||ee.owner||ee.planAdmin||ee.planEdit||ee.planModerate?[{name:"$__edit",icon:"edit",onClick:function(){e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{db:"cards",id:Q[0],module:"cardEdit",activeModule:"cardEdit",data:w.cards[Q[0]]}))}}]:[],actionButtonsStyle:{top:"-9px !important"}}),i.a.createElement(Ys,null,i.a.createElement("div",{style:{width:"100%",color:dt("menu")}},i.a.createElement("span",{style:{fontWeight:"bold"}},lt("$__name",1),":")," ",w.cards[Q[0]].name),i.a.createElement("div",{style:{width:"100%",color:dt("menu")}},i.a.createElement("span",{style:{fontWeight:"bold"}},lt("$__description",1),":")," ",w.cards[Q[0]].description),!w.cards[Q[0]].isTemplate&&w.cards[Q[0]]&&w.cards[Q[0]]._users&&i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{width:"100%",marginTop:"15px",color:dt("menu"),fontWeight:"bold"}},lt("$__users","*"),":"),i.a.createElement(Ho,{_id:Q[0],noLimit:!0,avatarSize:"33px",permission:!0}))))),i.a.createElement("div",{style:{width:"100%"}},i.a.createElement("div",null,i.a.createElement($s,{style:{marginTop:"0"}},i.a.createElement(Io,{title:lt("$__notes",1),icon:"note",color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"},customButtons:[].concat(Object(f.a)(Y.text&&!Y.editor?[{title:"$__cleanNote",icon:"clear_all",onClick:function(){re(!0)}},{title:"$__edit",icon:"edit",onClick:function(){R(Object(h.a)(Object(h.a)({},Y),{},{editor:!0}))}}]:[]),[U&&{title:"$__saveNote",icon:"save",onClick:function(){re()}},Y.editor&&{title:"$__cancel",icon:"cancel",onClick:function(){R(Object(h.a)(Object(h.a)({},Y),{},{text:w.cards[Q[0]].note,editor:!1})),V(!1)}}])}),i.a.createElement(Ys,{style:{display:"flex",justifyContent:"center"}},Y.text||Y.editor?Y.editor?i.a.createElement(Jf.a,{style:{borderRadius:"7px",border:"0px",padding:"7px",fontFamily:'"Soleto", "Roboto", "Helvetica", "Arial", sans-serif',fontSize:"16px",minWidth:"calc(100% - 0px)",maxWidth:"calc(100% - 0px)"},placeholder:lt("$__planNotePlaceholder"),onChange:function(e){V(!0),R(Object(h.a)(Object(h.a)({},Y),{},{text:e.target.value}))},onBlur:function(e){""!==e.target.value&&e.target.value!==w.cards[Q[0]].note||(V(!1),R(Object(h.a)(Object(h.a)({},Y),{},{editor:!1})))},autoFocus:!0,spellcheck:!1},Y.text):i.a.createElement("div",{style:{fontSize:"16px",width:"100%"},onClick:function(){R(Object(h.a)(Object(h.a)({},Y),{},{editor:!0}))},dangerouslySetInnerHTML:{__html:st(Y.text)}}):i.a.createElement("div",{style:{display:"flex",alignItems:"center",userSelect:"none",cursor:"pointer"},onClick:function(){R(Object(h.a)(Object(h.a)({},Y),{},{editor:!0}))}},i.a.createElement("div",{style:{padding:"7px",border:"dotted 1px rgba(0,0,0,0.2)",borderRadius:"7px"}},i.a.createElement(kt,{size:"33px",color:"rgba(0,0,0,0.2)"},"add")),i.a.createElement("div",{style:{color:"rgba(0,0,0,0.2)",fontSize:"22px",fontWeight:"bold",marginLeft:"15px"}},lt("$__addNote")))))))),i.a.createElement(xo,{xs:12,sm:6,md:6,lg:6},i.a.createElement("div",null,i.a.createElement($s,{style:{marginTop:"0",height:"500px"}},i.a.createElement(Io,{title:lt("$__timeline",1),icon:"blur_on",color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"},customButtons:[{name:"$__timeline",icon:"timeline",actionsSize:"22px",count:ne.comment,onClick:function(){K({type:"comment",disabledSend:!1})}},{name:"$__log",icon:"history",actionsSize:"22px",count:ne.log,onClick:function(){K({type:"log",disabledSend:!0})}},{name:"$__timer",icon:"timer",actionsSize:"22px",count:ne.timer,onClick:function(){K({type:"timer",disabledSend:!0})}},{name:"$__kpi",icon:"analytics",actionsSize:"22px",count:ne.kpi,onClick:function(){K({type:"kpi",disabledSend:!0})}}],actionButtonsStyle:{top:"-9px !important"}}),i.a.createElement(Ys,null,i.a.createElement(Xc,Object(h.a)({nodeId:Q[0],db:"cards",loadTimeline:!0},J)))))),i.a.createElement(xo,{xs:12,sm:12,md:12,lg:12},i.a.createElement(vo,null,w.cards[Q[0]]&&"operational"===w.cards[Q[0]].planType?i.a.createElement(xo,{xs:12,sm:6,md:6,lg:3},i.a.createElement($s,null,i.a.createElement(Fa,{title:(null===(r=ae)||void 0===r||null===(n=r.guidelines)||void 0===n?void 0:n.name)?ae.guidelines.name:lt("$__guidelines",1),icon:(null===(a=ae)||void 0===a||null===(o=a.guidelines)||void 0===o?void 0:o.icon)?ae.guidelines.icon:G.a,color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"}}),i.a.createElement(Ws,{style:{height:"300px",display:"flex"}},i.a.createElement(Is.a,{data:[].concat(Object(f.a)(w.status.map((function(e,t){return{id:lt(e.label,1),label:lt(e.label,1),value:Object.keys(w.cards).filter((function(t){return w.cards[t]._planId===Q[0]&&!w.cards[t].deleted&&w.cards[t].type.indexOf("guideline")>-1&&w.cards[t].status&&w.cards[t].status===e.value})).length,color:e.color}}))),[{id:lt("$__late",1),label:lt("$__late",1),value:Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&!w.cards[e].deleted&&w.cards[e].type.indexOf("guideline")>-1&&w.cards[e].endDate&&Ve()(new Date(1e3*w.cards[e].endDate)).tz("America/Sao_Paulo").format()<=Ve()(new Date(Z)).tz("America/Sao_Paulo").format()})).length,color:"red"}]),colors:["#929497","#011E41","#EBA900","#5A7F71","red"],margin:{top:17,right:17,bottom:17,left:17},arcLabelsTextColor:{from:"color",modifiers:[["brighter",3]]},innerRadius:.5,padAngle:3,cornerRadius:3,activeOuterRadiusOffset:8,borderWidth:1,borderColor:{from:"color",modifiers:[["darker",.2]]},enableArcLinkLabels:!1})),i.a.createElement(Ys,null,i.a.createElement("h3",null,i.a.createElement("small",null,lt("$__total",1),": ",Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&!w.cards[e].deleted&&w.cards[e].type.indexOf("guideline")>-1})).length)),w.status.map((function(e,t){return i.a.createElement("div",{key:"".concat(t,"_").concat(e.value),style:{color:"black",display:"flex",justifyContent:"space-between",height:"30px",alignItems:"center",width:"100%"}},i.a.createElement("div",{style:{display:"flex"}},i.a.createElement(kt,{color:e.color},e.icon),i.a.createElement("span",{style:{marginLeft:"15px"}},lt(e.label,1))),i.a.createElement("div",null,Object.keys(w.cards).filter((function(t){return w.cards[t]._planId===Q[0]&&!w.cards[t].deleted&&w.cards[t].type.indexOf("guideline")>-1&&w.cards[t].status&&w.cards[t].status===e.value})).length))})),i.a.createElement("div",{style:{color:"black",display:"flex",justifyContent:"space-between",height:"30px",alignItems:"center",width:"100%"}},i.a.createElement("div",{style:{display:"flex"}},i.a.createElement(kt,{color:"red"},"assignment_late"),i.a.createElement("span",{style:{marginLeft:"15px"}},lt("$__late",1))),i.a.createElement("div",null,Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&!w.cards[e].deleted&&w.cards[e].type.indexOf("guideline")>-1&&w.cards[e].endDate&&Ve()(new Date(1e3*w.cards[e].endDate)).tz("America/Sao_Paulo").format()<=Ve()(new Date(Z)).tz("America/Sao_Paulo").format()})).length))))):i.a.createElement(xo,{xs:12,sm:6,md:6,lg:3},i.a.createElement($s,null,i.a.createElement(Fa,{title:lt("$__matrix",1),icon:G.a,color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"}}),i.a.createElement(Ws,{style:{height:"300px",display:"flex"}},i.a.createElement(Xf.a,{data:{name:"root",children:[{name:lt("$__guidelines",1),value:Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&w.cards[e].type.indexOf("guideline")>-1})).length},{name:lt("$__strength",1),value:Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&"strength"===w.cards[e].type})).length},{name:lt("$__weakness",1),value:Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&"weakness"===w.cards[e].type})).length},{name:lt("$__opportunity",1),value:Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&"opportunity"===w.cards[e].type})).length},{name:lt("$__threat",1),value:Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&"threat"===w.cards[e].type})).length}]},margin:{top:20,right:20,bottom:20,left:20},id:"name",colors:{scheme:"purpleRed_green"},colorBy:"id",childColor:{from:"color",modifiers:[["brighter",.4]]},padding:1,leavesOnly:!0,enableLabels:!0,label:"value",labelTextColor:"#FFFFFF",borderColor:{from:"color",modifiers:[["darker",.3]]},animate:!1})),i.a.createElement(Ys,null,i.a.createElement("h3",null,i.a.createElement("small",null,lt("$__total",1),": ",Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&(w.cards[e].type.indexOf("guideline")>-1||"strength"===w.cards[e].type||"weakness"===w.cards[e].type||"opportunity"===w.cards[e].type||"threat"===w.cards[e].type)})).length)),i.a.createElement("div",{style:{color:"black",display:"flex",justifyContent:"space-between",height:"30px",alignItems:"center",width:"100%"}},i.a.createElement("div",{style:{display:"flex"}},i.a.createElement(kt,{icon:G.a}),i.a.createElement("span",{style:{marginLeft:"15px"}},lt("$__guidelines",1))),i.a.createElement("div",null,Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&w.cards[e].type.indexOf("guideline")>-1})).length)),i.a.createElement("div",{style:{color:"black",display:"flex",justifyContent:"space-between",height:"30px",alignItems:"center",width:"100%"}},i.a.createElement("div",{style:{display:"flex"}},i.a.createElement(kt,null,"arrow_upward"),i.a.createElement("span",{style:{marginLeft:"15px"}},lt("$__strength",1))),i.a.createElement("div",null,Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&!w.cards[e].checklist&&!w.cards[e].deleted&&"strength"===w.cards[e].type})).length)),i.a.createElement("div",{style:{color:"black",display:"flex",justifyContent:"space-between",height:"30px",alignItems:"center",width:"100%"}},i.a.createElement("div",{style:{display:"flex"}},i.a.createElement(kt,null,"arrow_downward"),i.a.createElement("span",{style:{marginLeft:"15px"}},lt("$__weakness",1))),i.a.createElement("div",null,Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&!w.cards[e].checklist&&!w.cards[e].deleted&&"weakness"===w.cards[e].type})).length)),i.a.createElement("div",{style:{color:"black",display:"flex",justifyContent:"space-between",height:"30px",alignItems:"center",width:"100%"}},i.a.createElement("div",{style:{display:"flex"}},i.a.createElement(kt,null,"trending_up"),i.a.createElement("span",{style:{marginLeft:"15px"}},lt("$__opportunity",1))),i.a.createElement("div",null,Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&!w.cards[e].checklist&&!w.cards[e].deleted&&"opportunity"===w.cards[e].type})).length)),i.a.createElement("div",{style:{color:"black",display:"flex",justifyContent:"space-between",height:"30px",alignItems:"center",width:"100%"}},i.a.createElement("div",{style:{display:"flex"}},i.a.createElement(kt,null,"trending_down"),i.a.createElement("span",{style:{marginLeft:"15px"}},lt("$__threat",1))),i.a.createElement("div",null,Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&!w.cards[e].checklist&&!w.cards[e].deleted&&"threat"===w.cards[e].type})).length))))),i.a.createElement(xo,{xs:12,sm:6,md:6,lg:3},i.a.createElement($s,null,i.a.createElement(Fa,{title:(null===(c=ae)||void 0===c||null===(l=c.objectives)||void 0===l?void 0:l.name)?ae.objectives.name:lt("$__objectives",1),icon:(null===(s=ae)||void 0===s||null===(u=s.objectives)||void 0===u?void 0:u.icon)?ae.objectives.icon:"gps_fixed",color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"}}),i.a.createElement(Ws,{style:{height:"300px",display:"flex"}},i.a.createElement(Is.a,{data:[].concat(Object(f.a)(w.status.map((function(e,t){return{id:lt(e.label,1),label:lt(e.label,1),value:Object.keys(w.cards).filter((function(t){return w.cards[t]._planId===Q[0]&&!w.cards[t].checklist&&!w.cards[t].deleted&&"objective"===w.cards[t].type&&w.cards[t].status&&w.cards[t].status===e.value})).length,color:e.color}}))),[{id:lt("$__late",1),label:lt("$__late",1),value:Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&!w.cards[e].checklist&&!w.cards[e].deleted&&"completed"!==w.cards[e].status&&"objective"===w.cards[e].type&&w.cards[e].endDate&&Ve()(new Date(1e3*w.cards[e].endDate)).tz("America/Sao_Paulo").format()<=Ve()(new Date(Z)).tz("America/Sao_Paulo").format()})).length,color:"red"}]),colors:["#929497","#011E41","#EBA900","#5A7F71","red"],margin:{top:17,right:17,bottom:17,left:17},arcLabelsTextColor:{from:"color",modifiers:[["brighter",3]]},innerRadius:.5,padAngle:3,cornerRadius:3,activeOuterRadiusOffset:8,borderWidth:1,borderColor:{from:"color",modifiers:[["darker",.2]]},enableArcLinkLabels:!1})),i.a.createElement(Ys,null,i.a.createElement("h3",null,i.a.createElement("small",null,lt("$__total",1),": ",Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&!w.cards[e].deleted&&!w.cards[e].checklist&&"objective"===w.cards[e].type})).length)),w.status.map((function(e,t){return i.a.createElement("div",{key:"".concat(t,"_").concat(e.value),style:{color:"black",display:"flex",justifyContent:"space-between",height:"30px",alignItems:"center",width:"100%"}},i.a.createElement("div",{style:{display:"flex"}},i.a.createElement(kt,{color:e.color},e.icon),i.a.createElement("span",{style:{marginLeft:"15px"}},lt(e.label,1))),i.a.createElement("div",null,Object.keys(w.cards).filter((function(t){return w.cards[t]._planId===Q[0]&&"objective"===w.cards[t].type&&w.cards[t].status&&!w.cards[t].checklist&&w.cards[t].status===e.value})).length))})),i.a.createElement("div",{style:{color:"black",display:"flex",justifyContent:"space-between",height:"30px",alignItems:"center",width:"100%"}},i.a.createElement("div",{style:{display:"flex"}},i.a.createElement(kt,{color:"red"},"assignment_late"),i.a.createElement("span",{style:{marginLeft:"15px"}},lt("$__late",1))),i.a.createElement("div",null,Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&!w.cards[e].checklist&&!w.cards[e].deleted&&"completed"!==w.cards[e].status&&"objective"===w.cards[e].type&&w.cards[e].endDate&&Ve()(new Date(1e3*w.cards[e].endDate)).tz("America/Sao_Paulo").format()<=Ve()(new Date(Z)).tz("America/Sao_Paulo").format()})).length))))),i.a.createElement(xo,{xs:12,sm:6,md:6,lg:3},i.a.createElement($s,null,i.a.createElement(Fa,{title:(null===(d=ae)||void 0===d||null===(p=d.goals)||void 0===p?void 0:p.name)?ae.goals.name:lt("$__goals",1),icon:(null===(m=ae)||void 0===m||null===(g=m.goals)||void 0===g?void 0:g.icon)?ae.goals.icon:"flag",color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"}}),i.a.createElement(Ws,{style:{height:"300px",display:"flex"}},i.a.createElement(Is.a,{data:[].concat(Object(f.a)(w.status.map((function(e,t){return{id:lt(e.label,1),label:lt(e.label,1),value:Object.keys(w.cards).filter((function(t){return w.cards[t]._planId===Q[0]&&"goal"===w.cards[t].type&&!w.cards[t].checklist&&!w.cards[t].deleted&&w.cards[t].status&&w.cards[t].status===e.value})).length,color:e.color}}))),[{id:lt("$__late",1),label:lt("$__late",1),value:Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&!w.cards[e].checklist&&!w.cards[e].deleted&&"completed"!==w.cards[e].status&&"goal"===w.cards[e].type&&w.cards[e].endDate&&Ve()(new Date(1e3*w.cards[e].endDate)).tz("America/Sao_Paulo").format()<=Ve()(new Date(Z)).tz("America/Sao_Paulo").format()})).length,color:"red"}]),colors:["#929497","#011E41","#EBA900","#5A7F71","red"],margin:{top:17,right:17,bottom:17,left:17},arcLabelsTextColor:{from:"color",modifiers:[["brighter",3]]},innerRadius:.5,padAngle:3,cornerRadius:3,activeOuterRadiusOffset:8,borderWidth:1,borderColor:{from:"color",modifiers:[["darker",.2]]},enableArcLinkLabels:!1})),i.a.createElement(Ys,null,i.a.createElement("h3",null,i.a.createElement("small",null,lt("$__total",1),": ",Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&!w.cards[e].checklist&&!w.cards[e].deleted&&"goal"===w.cards[e].type})).length)),w.status.map((function(e,t){return i.a.createElement("div",{key:"".concat(t,"_").concat(e.value),style:{color:"black",display:"flex",justifyContent:"space-between",height:"30px",alignItems:"center",width:"100%"}},i.a.createElement("div",{style:{display:"flex"}},i.a.createElement(kt,{color:e.color},e.icon),i.a.createElement("span",{style:{marginLeft:"15px"}},lt(e.label,1))),i.a.createElement("div",null,Object.keys(w.cards).filter((function(t){return w.cards[t]._planId===Q[0]&&"goal"===w.cards[t].type&&!w.cards[t].checklist&&!w.cards[t].deleted&&w.cards[t].status&&w.cards[t].status===e.value})).length))})),i.a.createElement("div",{style:{color:"black",display:"flex",justifyContent:"space-between",height:"30px",alignItems:"center",width:"100%"}},i.a.createElement("div",{style:{display:"flex"}},i.a.createElement(kt,{color:"red"},"assignment_late"),i.a.createElement("span",{style:{marginLeft:"15px"}},lt("$__late",1))),i.a.createElement("div",null,Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&!w.cards[e].checklist&&!w.cards[e].deleted&&"completed"!==w.cards[e].status&&"goal"===w.cards[e].type&&w.cards[e].endDate&&Ve()(new Date(1e3*w.cards[e].endDate)).tz("America/Sao_Paulo").format()<=Ve()(new Date(Z)).tz("America/Sao_Paulo").format()})).length))))),i.a.createElement(xo,{xs:12,sm:6,md:6,lg:3},i.a.createElement($s,null,i.a.createElement(Fa,{title:(null===(v=ae)||void 0===v||null===(y=v.actions)||void 0===y?void 0:y.name)?ae.actions.name:lt("$__actions",1),icon:(null===(b=ae)||void 0===b||null===(x=b.actions)||void 0===x?void 0:x.icon)?ae.actions.icon:"play_arrow",color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"}}),i.a.createElement(Ws,{style:{height:"300px",display:"flex"}},i.a.createElement(Is.a,{data:[].concat(Object(f.a)(w.status.map((function(e,t){return{id:lt(e.label,1),label:lt(e.label,1),value:Object.keys(w.cards).filter((function(t){return w.cards[t]._planId===Q[0]&&!w.cards[t].deleted&&w.cards[t].status&&w.cards[t].status===e.value&&("iniciative"===w.cards[t].type||"task"===w.cards[t].type||"meeting"===w.cards[t].type||"iniciative"===w.cards[t].type||"myTask"===w.cards[t].type||!w.cards[t].checklist||w.cards[t].checklist&&w.cards[t].showCard)})).length,color:e.color}}))),[{id:lt("$__late",1),label:lt("$__late",1),value:Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&!w.cards[e].deleted&&"completed"!==w.cards[e].status&&("iniciative"===w.cards[e].type||"task"===w.cards[e].type||"meeting"===w.cards[e].type||"iniciative"===w.cards[e].type||"myTask"===w.cards[e].type||!w.cards[e].checklist||w.cards[e].checklist&&w.cards[e].showCard)&&w.cards[e].endDate&&Ve()(new Date(1e3*w.cards[e].endDate)).tz("America/Sao_Paulo").format()<=Ve()(new Date(Z)).tz("America/Sao_Paulo").format()})).length,color:"red"}]),colors:["#929497","#011E41","#EBA900","#5A7F71","red"],margin:{top:17,right:17,bottom:17,left:17},arcLabelsTextColor:{from:"color",modifiers:[["brighter",3]]},innerRadius:.5,padAngle:3,cornerRadius:3,activeOuterRadiusOffset:8,borderWidth:1,borderColor:{from:"color",modifiers:[["darker",.2]]},enableArcLinkLabels:!1})),i.a.createElement(Ys,null,i.a.createElement("h3",null,i.a.createElement("small",null,lt("$__total",1),": ",Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&!w.cards[e].deleted&&("iniciative"===w.cards[e].type||"task"===w.cards[e].type||"meeting"===w.cards[e].type||"iniciative"===w.cards[e].type||"myTask"===w.cards[e].type||!w.cards[e].checklist||w.cards[e].checklist&&w.cards[e].showCard)})).length)),w.status.map((function(e,t){return i.a.createElement("div",{key:"".concat(t,"_").concat(e.value),style:{color:"black",display:"flex",justifyContent:"space-between",height:"30px",alignItems:"center",width:"100%"}},i.a.createElement("div",{style:{display:"flex"}},i.a.createElement(kt,{color:e.color},e.icon),i.a.createElement("span",{style:{marginLeft:"15px"}},lt(e.label,1))),i.a.createElement("div",null,Object.keys(w.cards).filter((function(t){return w.cards[t]._planId===Q[0]&&!w.cards[t].deleted&&("iniciative"===w.cards[t].type||"task"===w.cards[t].type||"meeting"===w.cards[t].type||"iniciative"===w.cards[t].type||"myTask"===w.cards[t].type||!w.cards[t].checklist||w.cards[t].checklist&&w.cards[t].showCard)&&w.cards[t].status&&w.cards[t].status===e.value})).length))})),i.a.createElement("div",{style:{color:"black",display:"flex",justifyContent:"space-between",height:"30px",alignItems:"center",width:"100%"}},i.a.createElement("div",{style:{display:"flex"}},i.a.createElement(kt,{color:"red"},"assignment_late"),i.a.createElement("span",{style:{marginLeft:"15px"}},lt("$__late",1))),i.a.createElement("div",null,Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&!w.cards[e].deleted&&"completed"!==w.cards[e].status&&("iniciative"===w.cards[e].type||"task"===w.cards[e].type||"meeting"===w.cards[e].type||"iniciative"===w.cards[e].type||"myTask"===w.cards[e].type||!w.cards[e].checklist||w.cards[e].checklist&&w.cards[e].showCard)&&w.cards[e].endDate&&Ve()(new Date(1e3*w.cards[e].endDate)).tz("America/Sao_Paulo").format()<=Ve()(new Date(Z)).tz("America/Sao_Paulo").format()})).length)))))))),i.a.createElement(vo,null,Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&"completed"!==w.cards[e].status&&w.cards[e].startDate&&Ve()(new Date(1e3*w.cards[e].startDate)).tz("America/Sao_Paulo").format()>=Ve()(new Date(Z)).tz("America/Sao_Paulo").format()})).length>0&&i.a.createElement(xo,{md:6,xs:12},i.a.createElement($s,null,i.a.createElement(Fa,{title:lt("$__nextActivities",1),icon:"pending_actions",color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"}}),i.a.createElement(Ys,null,i.a.createElement(vo,null,Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&!w.cards[e].deleted&&"completed"!==w.cards[e].status&&w.cards[e].startDate&&Ve()(new Date(1e3*w.cards[e].startDate)).tz("America/Sao_Paulo").format()>=Ve()(new Date(Z)).tz("America/Sao_Paulo").format()})).sort((function(e,t){var r=w.cards[e].completed_at&&w.cards[e].completed_at.low?parseInt(w.cards[e].completed_at.low):"string"===typeof w.cards[e].completed_at?w.cards[e].completed_at:0,n=w.cards[t].completed_at&&w.cards[t].completed_at.low?parseInt(w.cards[t].completed_at.low):"string"===typeof w.cards[t].completed_at?w.cards[t].completed_at:0;return r>n?-1:r<n?1:0})).map((function(e,t){if(t>=7*(N-1)&&t<7*N)return i.a.createElement(oc,{db:"cards",key:e,data:w.cards[e],inLine:!0})})),Math.ceil(Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&"completed"!==w.cards[e].status&&w.cards[e].startDate&&Ve()(new Date(1e3*w.cards[e].startDate)).tz("America/Sao_Paulo").format()>=Ve()(new Date(Z)).tz("America/Sao_Paulo").format()})).length/7)>1&&i.a.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"center"}},i.a.createElement(Ss.a,{page:N,count:Math.ceil(Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&"completed"!==w.cards[e].status&&w.cards[e].startDate&&Ve()(new Date(1e3*w.cards[e].startDate)).tz("America/Sao_Paulo").format()>=Ve()(new Date(Z)).tz("America/Sao_Paulo").format()})).length/7),onChange:function(e,t){P(t)}})))))),Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&"completed"!==w.cards[e].status&&w.cards[e].endDate&&Ve()(new Date(1e3*w.cards[e].endDate)).tz("America/Sao_Paulo").format()<=Ve()(new Date(Z)).tz("America/Sao_Paulo").format()})).length>0&&i.a.createElement(xo,{md:6,xs:12},i.a.createElement($s,null,i.a.createElement(Fa,{title:lt("$__lateActivities",1),icon:"pending_actions",color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"}}),i.a.createElement(Ys,null,i.a.createElement(vo,null,Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&!w.cards[e].deleted&&"completed"!==w.cards[e].status&&w.cards[e].endDate&&Ve()(new Date(1e3*w.cards[e].endDate)).tz("America/Sao_Paulo").format()<=Ve()(new Date(Z)).tz("America/Sao_Paulo").format()})).sort((function(e,t){var r=w.cards[e].completed_at&&w.cards[e].completed_at.low?parseInt(w.cards[e].completed_at.low):"string"===typeof w.cards[e].completed_at?w.cards[e].completed_at:0,n=w.cards[t].completed_at&&w.cards[t].completed_at.low?parseInt(w.cards[t].completed_at.low):"string"===typeof w.cards[t].completed_at?w.cards[t].completed_at:0;return r>n?-1:r<n?1:0})).map((function(e,t){if(t>=7*($-1)&&t<7*$)return i.a.createElement(oc,{db:"cards",key:e,data:w.cards[e],inLine:!0})})),Math.ceil(Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&"completed"!==w.cards[e].status&&w.cards[e].endDate&&Ve()(new Date(1e3*w.cards[e].endDate)).tz("America/Sao_Paulo").format()<=Ve()(new Date(Z)).tz("America/Sao_Paulo").format()})).length/7)>1&&i.a.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"center"}},i.a.createElement(Ss.a,{page:$,count:Math.ceil(Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&"completed"!==w.cards[e].status&&w.cards[e].endDate&&Ve()(new Date(1e3*w.cards[e].endDate)).tz("America/Sao_Paulo").format()<=Ve()(new Date(Z)).tz("America/Sao_Paulo").format()})).length/7),onChange:function(e,t){z(t)}})))))),Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&"completed"===w.cards[e].status})).length>0&&i.a.createElement(xo,{md:6,xs:12},i.a.createElement($s,null,i.a.createElement(Fa,{title:lt("$__lastCompletedCards",1),icon:"pending_actions",color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"}}),i.a.createElement(Ys,null,i.a.createElement(vo,null,Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&!w.cards[e].deleted&&(!w.cards[e].checklist||w.cards[e].checklist&&w.cards[e].showCard)&&"completed"===w.cards[e].status})).sort((function(e,t){var r=w.cards[e].completed_at&&w.cards[e].completed_at.low?parseInt(w.cards[e].completed_at.low):"string"===typeof w.cards[e].completed_at?w.cards[e].completed_at:0,n=w.cards[t].completed_at&&w.cards[t].completed_at.low?parseInt(w.cards[t].completed_at.low):"string"===typeof w.cards[t].completed_at?w.cards[t].completed_at:0;return r>n?-1:r<n?1:0})).map((function(e,t){if(t>=7*(C-1)&&t<7*C)return i.a.createElement(oc,{db:"cards",key:e,data:w.cards[e],inLine:!0})})),Math.ceil(Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&"completed"===w.cards[e].status})).length/7)>1&&i.a.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"center"}},i.a.createElement(Ss.a,{page:C,count:Math.ceil(Object.keys(w.cards).filter((function(e){return w.cards[e]._planId===Q[0]&&"completed"===w.cards[e].status})).length/7),onChange:function(e,t){I(t)}})))))),Object.keys(w.cards).filter((function(e){if(w.cards[e]._planId===Q[0]&&w.cards[e]._users&&Object.keys(w.cards[e]._users).filter((function(t){return w.cards[e]._users[t].myDay&&Ve()(new Date(1e3*w.cards[e]._users[t].myDay)).tz("America/Sao_Paulo").format("YYYY/MM/DD")===Z})).length>0)return!0})).length>0&&i.a.createElement(xo,{md:6,xs:12},i.a.createElement($s,null,i.a.createElement(Fa,{title:lt("$__todayTasks",1),icon:"today",color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"}}),i.a.createElement(Ys,null,i.a.createElement(vo,null,Object.keys(w.cards).filter((function(e){if(w.cards[e]._planId===Q[0]&&!w.cards[e].deleted&&w.cards[e]._users&&Object.keys(w.cards[e]._users).filter((function(t){return w.cards[e]._users[t].myDay&&Ve()(new Date(1e3*w.cards[e]._users[t].myDay)).tz("America/Sao_Paulo").format("YYYY/MM/DD")===Z})).length>0)return!0})).map((function(e){return i.a.createElement(oc,{db:"cards",key:e,data:w.cards[e]})})))))),i.a.createElement(xo,{md:6,xs:12},i.a.createElement(Ut,null,i.a.createElement(Zs,{nodeId:Q[0]})))))}));var Qf,eh=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(bd)((function(e){e.classes;var t=De.getState(),r=t.db,n=t.search,a=i.a.useState(0),o=Object(Be.a)(a,2),c=o[0],l=o[1],s=i.a.useState(25),u=Object(Be.a)(s,2),d=u[0],p=u[1],f=window.location.hash.split("/");f[0]=f[0].replace("#","");var h={};return h=36===f[0].length?(h=Object.keys(r.cards).filter((function(e){return r.cards[e]._parent&&r.cards[e]._parent===f[0]&&"insight"===r.cards[e].type&&!r.cards[e].deleted})).sort((function(e,t){return r.cards[e].created_at>r.cards[t].created_at?-1:0})).map((function(e){return r.cards[e]}))).filter((function(e){return e.description&&e.description.toLowerCase().indexOf(n.text.toLowerCase())>-1||e.name&&e.name.toLowerCase().indexOf(n.text.toLowerCase())>-1})).map((function(e){return e})):(h=Object.keys(r.cards).filter((function(e){return!r.cards[e]._parent&&"insight"===r.cards[e].type})).sort((function(e,t){return r.cards[e].created_at>r.cards[t].created_at?-1:0})).map((function(e){return r.cards[e]}))).filter((function(e){return e.description&&e.description.toLowerCase().indexOf(n.text.toLowerCase())>-1||e.name&&e.name.toLowerCase().indexOf(n.text.toLowerCase())>-1})).map((function(e){return e})),i.a.createElement("div",{style:{position:"relative",justifyContent:"space-between",margin:"auto",width:"100%"}},Object.keys(h).length>25&&i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",left:"0px",right:"0px",padding:"15px",display:"flex",alignItems:"center",justifyContent:"center"}},lt("$__page")," ",c+1," ",lt("$__of")," ",Math.ceil(Object.keys(h).length/d),i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},i.a.createElement(ad.a,{component:"div",count:Object.keys(h).length,page:c,onChangePage:function(e,t){l(t)},rowsPerPage:d,onChangeRowsPerPage:function(e){p(parseInt(e.target.value,10))},labelRowsPerPage:lt("$__insightsPerPage")}))),i.a.createElement(vo,null,Object.keys(h).map((function(e,t){if(t<=(c+1)*d&&t>=c*d)return i.a.createElement(xo,{key:h[e]._id,xs:12,sm:6,md:4,lg:3,xl:2},i.a.createElement(oc,{db:"cards",data:h[e],expanded:!0,Avatar:!0,Resume:!0}))}))),Object.keys(h).length>25&&i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",left:"0px",right:"0px",padding:"15px",display:"flex",alignItems:"center",justifyContent:"center"}},lt("$__page")," ",c+1," ",lt("$__of")," ",Math.ceil(Object.keys(h).length/d),i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},i.a.createElement(ad.a,{component:"div",count:Object.keys(h).length,page:c,onChangePage:function(e,t){l(t)},rowsPerPage:d,onChangeRowsPerPage:function(e){p(parseInt(e.target.value,10))},labelRowsPerPage:lt("$__insightsPerPage")}))))}))),th=r(1700),rh=r(1811),nh=r(1812),ah=r(1810),oh=r(566),ih=Object(Lt.a)({avatar:{backgroundColor:oh.a[100],color:oh.a[600]}});function ch(e){ih();var t=e.open,r=(e.selectedValue,e.onClose);return i.a.createElement(Ko.a,{onClose:function(){r()},"aria-labelledby":"simple-dialog-title",open:t},e&&e.title&&i.a.createElement(ah.a,{id:"simple-dialog-title"},e.title),i.a.createElement(Jt.a,null,e.options.map((function(e,t){return i.a.createElement(th.a,{button:!0,onClick:function(){e.onClick&&e.onClick(),r()},key:t},i.a.createElement(rh.a,null,i.a.createElement(kt,{icon:e.icon})),i.a.createElement(nh.a,{primary:lt(e.name,1)}))}))))}function lh(e){var t=i.a.useState(!1),r=Object(Be.a)(t,2),n=r[0],a=r[1],o=i.a.useState(null),c=Object(Be.a)(o,2),l=c[0],s=c[1];return i.a.createElement(i.a.Fragment,null,i.a.createElement(rn,{text:e.text?e.text:null,icon:e.icon?e.icon:"add_box",size:e.iconSize?e.iconSize:null,iconColor:e.iconColor?e.iconColor:dt("medium"),onClick:function(){a(!0)}}),i.a.createElement(ch,{selectedValue:l,open:n,onClose:function(){var e;a(!1),s(e)},options:e.options}))}function sh(){sh=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var uh,dh=Xe.default.div(Qf||(Qf=Object(ze.a)(["\n background-color:none;\n "]))),ph=Object($e.b)((function(e){return{store:e}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.db,n=t.session,a=De.getState().functions.socket,o=i.a.useState(e.defaultName?e.defaultName:""),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.useState(!1),d=Object(Be.a)(u,2),p=d[0],f=d[1],m=window.location.hash.split("/");m[0]=m[0].replace("#",""),36!==m[0].length&&(m[0]=null);var g=function(){var t=Object(Me.a)(sh().mark((function t(){var r;return sh().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(r=De.getState().functions.socket).emit("data",{module:"cards",method:"post",action:"add"},{_parent:m[0],planId:m[0]&&36===m[0].length?m[0]:null,name:l,type:e.cardType,status:"notStarted"},function(){var e=Object(Me.a)(sh().mark((function e(t){return sh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.emit("card.UPD",{cardId:t.id,cardData:Object(h.a)(Object(h.a)({},t.data),{},{_parent:m[0],_timeline:Object(O.a)({},t.log._id,Object(h.a)(Object(h.a)({},t.log),{},{_parent:[t.id]})),_users:Object(O.a)({},n._id,{name:De.getState().db.users[n._id].name?De.getState().db.users[n._id].name:null,displayName:De.getState().db.users[n._id].displayName?De.getState().db.users[n._id].displayName:null,image:De.getState().db.users[n._id].image?De.getState().db.users[n._id].image:null,access:5,_id:n._id})})});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),s("");case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),v=function(){var t=Object(Me.a)(sh().mark((function t(n){var o,i,c,l,s;return sh().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=n.destination,i=n.source,c=n.draggableId,o){t.next=3;break}return t.abrupt("return",!1);case 3:if(o.droppableId!==i.droppableId||o.id!==i.index){t.next=5;break}return t.abrupt("return",!1);case 5:return(l=e.cards).splice(i.index,1),l.splice(o.index,0,c),ot.put("cards/reorder",{cards:l}),s={},l.map((function(e,t){return(s=Object(h.a)(Object(h.a)({},s),{},Object(O.a)({},e,r.cards[e])))[e].order||(s[e].order.low=t),s[e].order.low=t,!0})),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),s)})),a.emit("card.UPD",s),t.abrupt("return");case 14:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),y=function(){var e=Object(Me.a)(sh().mark((function e(t){return sh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),b=function(){var e=Object(Me.a)(sh().mark((function e(t){return sh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return i.a.createElement(i.a.Fragment,null,i.a.createElement(di.a,{onDragEnd:v,onDragStart:y,onDragUpdate:b},i.a.createElement(di.c,{droppableId:"Drop_".concat(e.cardType||""),type:"column",direction:"vertical"},(function(t,n){return i.a.createElement(dh,Object.assign({ref:t.innerRef},t.droppableProps,{isDraggingOver:n.isDraggingOver}),e.cards.map((function(e,t){return i.a.createElement(di.b,{draggableId:e,index:t,key:e},(function(t,n){return i.a.createElement(oc,{provided:t,snapshot:n,data:r.cards[e],db:"cards",viewButton:!0,selectOption:!0})}))})),t.placeholder)}))),!p&&i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",padding:"7px"}},i.a.createElement(rn,{text:lt("$__add","*"),icon:"add_box",iconColor:dt("medium"),onClick:function(){f(!p)}})),p&&i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",padding:"7px",display:"flex",alignItems:"center"}},i.a.createElement("div",{style:{width:"calc(100% - 50px)",display:"flex"}},i.a.createElement(La,{label:lt("$__nameOfCard"),variant:dt("fieldVariant"),name:"name",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",onChange:function(e){s(e.target.value)},onBlur:function(e){""===e.target.value&&f(!p)},onKeyDown:function(e){13===e.keyCode&&l&&g(),27===e.keyCode&&(f(!p),s(""))}},autoFocus:!0,value:l,placeholder:lt("$__titleOfCard_placeholder")})),i.a.createElement("div",{style:{display:"flex"}},i.a.createElement("div",{onClick:function(){return g()}},i.a.createElement(kt,{color:"green",icon:"save",title:lt("$__save","*"),size:e.actionsSize||"25px"})),i.a.createElement("div",{onClick:function(){f(!p),s("")}},i.a.createElement(kt,{color:dt("medium"),icon:"cancel",title:lt("$__cancel","*"),size:e.actionsSize||"25px"}))))))}));function fh(){fh=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var hh=Xe.default.div(uh||(uh=Object(ze.a)(["\n","\n","\n @media(max-width: 959px) {\n display: contents !important;\n width: -webkit-fill-available;\n height:auto;\n }\n "])),(function(e){return!e.inLine&&e.styles&&e.styles.discountHeight&&"height:calc(100vh - ".concat(e.styles.discountHeight,"px);")}),(function(e){return e.inLine?"display: block;\n width: -webkit-fill-available;\n ".concat(e.style):" display: flex;\n width: 100%;\n ".concat(e.style,"\n @media(min-width: 960px) {\n display: flex;\n }\n ")})),mh=Object($e.b)((function(e){return{store:{cards:e.db.cards}}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState().db,r=i.a.useState(!1),n=Object(Be.a)(r,2),a=n[0],o=n[1];i.a.useEffect((function(){a||(o(!0),Xn(e))}));var c=function(){var r=Object(Me.a)(fh().mark((function r(n){var a,o,i,c,l,s,u,d,p,f,m,g,v;return fh().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(a=De.getState().functions.socket,o=n.destination,i=n.source,c=n.draggableId,!n.combine){r.next=4;break}return r.abrupt("return");case 4:if(o){r.next=6;break}return r.abrupt("return",!1);case 6:if(o.droppableId!==i.droppableId||o.id!==i.index){r.next=8;break}return r.abrupt("return",!1);case 8:if(l=i.droppableId,s=o.droppableId,u=Array.from(e.cards.filter((function(e){return e.type===l&&!e.deleted})).sort((function(e,t){return e.order&&t.order&&e.order.low&&t.order.low&&parseInt(e.order.low)<parseInt(t.order.low)?-1:e.order&&t.order&&e.order.low&&t.order.low&&parseInt(e.order.low)>parseInt(t.order.low)?1:0})).map((function(e){return e._id}))),l!==s){r.next=21;break}return(d=Array.from(e.cards.filter((function(e){return e.type===l&&!e.deleted})).sort((function(e,t){return e.order&&t.order&&String(e.order.low)&&String(t.order.low)&&parseInt(e.order.low)<parseInt(t.order.low)?-1:e.order&&t.order&&String(e.order.low)&&String(t.order.low)&&parseInt(e.order.low)>parseInt(t.order.low)?1:0})).map((function(e){return e._id})))).splice(i.index,1),d.splice(o.index,0,c),p={},d.map((function(e,r){p[e]=Object(h.a)(Object(h.a)({},t.cards[e]),{},{order:{low:r}})})),f=Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},t.cards),p)}),e.reduxFunction("ASYNC","SET_DB",Object(h.a)({},f)),a.emit("data",{module:"cards",method:"put",action:"inColumn"},{node:c,source:i.droppableId,destination:o.droppableId,destinationCards:d,columnName:"type",sourceCards:[]}),r.abrupt("return");case 21:u.splice(i.index,1),m=Array.from(e.cards.filter((function(e){return e.type===s})).sort((function(e,t){return e.order&&t.order&&e.order.low&&t.order.low&&parseInt(e.order.low)<parseInt(t.order.low)?-1:1})).map((function(e){return e._id}))),console.log(m),m.splice(o.index,0,c),g=Object(h.a)({},t.cards),u.map((function(e,t){g=Object(h.a)(Object(h.a)({},g),{},Object(O.a)({},e,Object(h.a)(Object(h.a)({},g[e]?g[e]:{}),{},{order:{low:t}})))})),m.map((function(e,t){g=Object(h.a)(Object(h.a)({},g),{},Object(O.a)({},e,Object(h.a)(Object(h.a)({},g[e]?g[e]:{}),{},{order:{low:t}})))})),v=Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},g),{},Object(O.a)({},c,Object(h.a)(Object(h.a)({},g[c]),{},{type:s,order:{low:o.index}})))}),e.reduxFunction("ASYNC","SET_DB",Object(h.a)({},v)),a.emit("data",{module:"cards",method:"put",action:"inColumn"},{node:c,source:i.droppableId,destination:o.droppableId,destinationCards:m,columnName:"type",sourceCards:u});case 31:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}();return i.a.createElement(di.a,{onDragEnd:c},i.a.createElement(di.c,{droppableId:"ALL-COLUMNS-STATUS",type:"column",direction:"".concat(e.inLine?"vertical":"horizontal")},(function(r){return i.a.createElement(hh,Object.assign({},e,{ref:r.innerRef}),t.swot.map((function(t,r){var n={name:t.label,icon:t.icon,cards:[],emptyHide:!1};return i.a.createElement(Hf,Object.assign({},e,{key:"".concat(t.value),columnId:"".concat(t.value),column:n,cards:e.cards.filter((function(e){return e.type===t.value})).sort((function(e,t){var r=0,n=0;return e.order&&String(e.order.low)&&(r=e.order.low),t.order&&String(t.order.low)&&(n=t.order.low),parseInt(r)<parseInt(n)?-1:parseInt(r)>parseInt(n)?1:0})).map((function(e){return Object(h.a)(Object(h.a)({},e),{},{id:e._id})})),index:r,columnsSettings:!1,columnStyle:{minWidth:"300px"},viewButton:e.viewButton||!1,locked:!(!e.lockColumns||-1!==e.lockColumns.indexOf(t.value)),manualOrder:!0,isDropDisabled:!0}))})),r.placeholder)})))}));var gh,vh=Object($e.b)((function(e,t){return{store:e,hidePrivate:e.controls.hidePrivate}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t,r=De.getState().db,n=r.dataType,a=i.a.useState(!1),o=Object(Be.a)(a,2),c=o[0],l=o[1],s=r.cards,u=window.location.hash.split("/");u[0]=u[0].replace("#",""),u[0]&&36!==u[0].length&&(u[0]=null),i.a.useEffect((function(){c||(l(!0),_())}));var d={};Object.keys(r.cards).filter((function(e){return r.cards[e]&&!r.cards[e].deleted&&(r.cards[e]._planId===u[0]||r.cards[e]._parent===u[0])})).map((function(e){d=Object(h.a)(Object(h.a)({},d),{},Object(O.a)({},e,r.cards[e]))}));var p,f=Object.keys(d).filter((function(e){return!0===d[e]._selected&&d[e].type&&d[e].type.indexOf("guideline")>-1&&d[e]._parent===u[0]}))[0]||null,m=Object.keys(d).filter((function(e){return!0===d[e]._selected&&d[e].type&&"objective"===d[e].type}))[0]||null,g=Object.keys(d).filter((function(e){return!0===d[e]._selected&&d[e].type&&"goal"===d[e].type}))[0]||null,v=Object.keys(d).filter((function(e){return"guidelineR"===d[e].type&&d[e]._parent===u[0]&&!d[e].deleted})).sort((function(e,t){return d[e].order&&String(d[e].order.low)&&d[t].order&&String(d[t].order.low)&&parseInt(d[e].order.low)>parseInt(d[t].order.low)?1:-1})),y=Object.keys(d).filter((function(e){return"guidelineC"===d[e].type&&d[e]._parent===u[0]&&!d[e].deleted})).sort((function(e,t){return d[e].order&&String(d[e].order.low)&&d[t].order&&String(d[t].order.low)&&parseInt(d[e].order.low)>parseInt(d[t].order.low)?1:-1})),b=Object.keys(d).filter((function(e){return"guidelineE"===d[e].type&&d[e]._parent===u[0]&&!d[e].deleted})).sort((function(e,t){return d[e].order&&String(d[e].order.low)&&d[t].order&&String(d[t].order.low)&&parseInt(d[e].order.low)>parseInt(d[t].order.low)?1:-1})),x=Object.keys(d).filter((function(e){return"guidelineD"===d[e].type&&d[e]._parent===u[0]&&!d[e].deleted})).sort((function(e,t){return d[e].order&&String(d[e].order.low)&&d[t].order&&String(d[t].order.low)&&parseInt(d[e].order.low)>parseInt(d[t].order.low)?1:-1})),_=function(){var t=Object(h.a)({},De.getState().db.cards);Object.keys(d).map((function(e){d[e]&&d[e]._selected&&(d[e]._selected=!1)})),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},t),d)}))};g?p=Object.keys(d).filter((function(e){return d[e]._parent===g&&!d[e].checklist})):m?p=Object.keys(d).filter((function(e){return d[e]._parent===m&&!d[e].checklist})):f&&(p=Object.keys(d).filter((function(e){return d[e]._parent===f&&!d[e].checklist})));var w=Object.keys(d).filter((function(e){return d[e]._parent===u[0]})),E=d&&Object.keys(d).filter((function(e){return d[e]&&d[e]._selected&&d[e].type&&d[e].type.indexOf("guideline")>-1}));return i.a.createElement("div",{style:{width:"inherit"}},!m&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Vt.a,{smDown:!0},i.a.createElement("div",{style:{position:"relative",float:"left",width:"calc(50% - 7px)",marginRight:"14px",padding:"7px",background:dt("ColumnTitleColor"),color:dt("colorText"),fontSize:"16px",fontWeight:"bold",marginBottom:"15px",textAlign:"center"}},lt("$__internalAspects",1)),i.a.createElement("div",{style:{position:"relative",float:"left",width:"calc(50% - 7px)",padding:"7px",background:dt("ColumnTitleColor"),color:dt("colorText"),fontSize:"16px",fontWeight:"bold",marginBottom:"15px",textAlign:"center"}},lt("$__externalAspects",1))),i.a.createElement(Vt.a,{smUp:!0},i.a.createElement("div",{style:{position:"relative",float:"left",width:"calc(100% - 7px)",padding:"7px",background:dt("ColumnTitleColor"),color:dt("colorText"),fontSize:"16px",fontWeight:"bold",marginBottom:"15px",textAlign:"center"}},lt("$__s.W.O.T","*"))),i.a.createElement(mh,(t={cards:w.map((function(e){return d[e]})),showSelected:Object.keys(d).filter((function(e){return!0===d[e]._selected})).length>0,lockColumns:E.length>0&&"guidelineD"===d[E[0]].type?["strength","threat"]:E.length>0&&"guidelineR"===d[E[0]].type?["strength","opportunity"]:E.length>0&&"guidelineE"===d[E[0]].type?["weakness","threat"]:E.length>0&&"guidelineC"===d[E[0]].type?["weakness","opportunity"]:null,columnStyle:{minWidth:"calc(25% - 14px)"},showOrder:!0},Object(O.a)(t,"showSelected",Object.keys(d).filter((function(e){return!0===d[e]._selected})).length>0),Object(O.a)(t,"inLineAdd",!0),t))),i.a.createElement(vo,null,i.a.createElement("div",{style:{position:"relative",float:"left",width:"calc(100% - 28px)",marginRight:"14px",marginLeft:"14px",padding:"7px",background:dt("ColumnTitleColor"),color:dt("colorText"),fontSize:"16px",fontWeight:"bold",marginBottom:"15px",textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center"}},i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"}},i.a.createElement(kt,{icon:G.a,color:dt("textColor"),size:25}),i.a.createElement("span",{style:{marginLeft:15}},f?lt("$__planning",1):"MATRIX SWOT"))),f?i.a.createElement(i.a.Fragment,null,i.a.createElement(xo,{md:3,sm:12,xs:12},i.a.createElement("div",null,i.a.createElement(Io,{title:"MATRIX SWOT",icon:n.filter((function(e){return"matrix"===e.name}))[0].icon,color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"}}),e.hidePrivate&&s[f]&&s[f].private?i.a.createElement(i.a.Fragment,null):i.a.createElement(oc,{data:s[f],db:"cards",selectOption:!0,expanded:!0}),i.a.createElement(rn,{icon:"undo",text:lt("$__backToMatrix","*"),onClick:function(){_("guideline")}})),m&&i.a.createElement("div",null,i.a.createElement(Io,{title:lt("$__objective",1),icon:n.filter((function(e){return"objective"===e.name}))[0].icon,color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"}}),e.hidePrivate&&s[m]&&s[m].private?i.a.createElement(i.a.Fragment,null):i.a.createElement(oc,{data:s[m],db:"cards",selectOption:!0,expanded:!0})),g&&i.a.createElement("div",null,i.a.createElement(Io,{title:lt("$__goal",1),icon:n.filter((function(e){return"goal"===e.name}))[0].icon,color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"},customButtons:[{title:"$__new",icon:"add_box",color:dt("menu"),onClick:function(){e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{id:"new",activeModule:n.filter((function(e){return"goal"===e.name}))[0].iniModule,db:"cards",data:{type:"goal",_parent:m,status:"notStarted"}}))}}]}),e.hidePrivate&&s[g]&&s[g].private?i.a.createElement(i.a.Fragment,null):i.a.createElement(oc,{data:s[g],db:"cards",selectOption:!0,expanded:!0}))),i.a.createElement(xo,{md:9,sm:12,xs:12},i.a.createElement(Io,{title:lt(m&&!g?"$__goals":m?"$__actions":"$__objectives",1),icon:m&&!g?n.filter((function(e){return"goal"===e.name}))[0].icon:m?"view_column":n.filter((function(e){return"objective"===e.name}))[0].icon,color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"},actionButtonsStyle:{position:"absolute",top:0,bottom:0,display:"flex",itemAligns:"center"},customButtons:[g?{component:i.a.createElement(lh,{iconColor:dt("color"),options:n.filter((function(e){return"agile"===e.module})).map((function(t){return{icon:t.icon,name:lt("$__".concat(t.name),1),onClick:function(){return e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{id:"new",db:"cards",data:{type:t.name,_parent:g,status:"notStarted"}}))}}}))})}:{title:"$__new",icon:"add_box",color:dt("color"),actionsSize:"22px",show:!0,onClick:function(){e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{id:"new",activeModule:n.filter((function(e){return"objective"===e.name}))[0].iniModule,db:"cards",data:m?{type:"goal",_parent:m,status:"notStarted"}:{type:"objective",_parent:f,status:"notStarted"}}))}}]}),i.a.createElement(Vf,{cards:p.map((function(e){return d[e]})),viewButton:!0}))):i.a.createElement(xo,{md:12},i.a.createElement(vo,{style:{paddingBottom:"33px"}},i.a.createElement(xo,{md:3,sm:12,xs:12},i.a.createElement(Io,{title:lt("$__guidelineR",1),icon:n.filter((function(e){return"guidelineR"===e.name}))[0].icon,color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"}}),i.a.createElement("div",{style:{position:"relative",width:"100%",padding:"7px",minHeight:"130px",backgroundColor:"#F9F9F9",borderRadius:"0 0 7px 7px"}},i.a.createElement("div",{style:{position:"relative",width:"100%",color:dt("menu"),fontWeight:"bold",paddingBottom:"7px",borderBottom:"solid 1px #e4e4e4",textAlign:"center"}},lt("$__guidelineRtypes",1)),i.a.createElement("div",{style:{position:"relative",width:"100%",color:dt("medium"),fontSize:"14px",padding:"7px",textAlign:"center"}},lt("$__guidelineRdetails",1))),i.a.createElement(ph,{cards:v,cardType:"guidelineR"})),i.a.createElement(xo,{md:3,sm:12,xs:12},i.a.createElement(Io,{title:lt("$__guidelineD",1),icon:n.filter((function(e){return"guidelineD"===e.name}))[0].icon,color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"}}),i.a.createElement("div",{style:{position:"relative",width:"100%",padding:"7px",minHeight:"130px",backgroundColor:"#F9F9F9",borderRadius:"0 0 7px 7px"}},i.a.createElement("div",{style:{position:"relative",width:"100%",color:dt("menu"),fontWeight:"bold",paddingBottom:"7px",borderBottom:"solid 1px #e4e4e4",textAlign:"center"}},lt("$__guidelineDtypes",1)),i.a.createElement("div",{style:{position:"relative",width:"100%",color:dt("medium"),fontSize:"14px",padding:"7px",textAlign:"center"}},lt("$__guidelineDdetails",1))),i.a.createElement(ph,{cards:x,cardType:"guidelineD"})),i.a.createElement(xo,{md:3,sm:12,xs:12},i.a.createElement(Io,{title:lt("$__guidelineC",1),icon:n.filter((function(e){return"guidelineC"===e.name}))[0].icon,color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"}}),i.a.createElement("div",{style:{position:"relative",width:"100%",padding:"7px",minHeight:"130px",backgroundColor:"#F9F9F9",borderRadius:"0 0 7px 7px"}},i.a.createElement("div",{style:{position:"relative",width:"100%",color:dt("menu"),fontWeight:"bold",paddingBottom:"7px",borderBottom:"solid 1px #e4e4e4",textAlign:"center"}},lt("$__guidelineCtypes",1)),i.a.createElement("div",{style:{position:"relative",width:"100%",color:dt("medium"),fontSize:"14px",padding:"7px",textAlign:"center"}},lt("$__guidelineCdetails",1))),i.a.createElement(ph,{cards:y,cardType:"guidelineC"})),i.a.createElement(xo,{md:3,sm:12,xs:12},i.a.createElement(Io,{title:lt("$__guidelineE",1),icon:n.filter((function(e){return"guidelineE"===e.name}))[0].icon,color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"}}),i.a.createElement("div",{style:{position:"relative",width:"100%",padding:"7px",minHeight:"130px",backgroundColor:"#F9F9F9",borderRadius:"0 0 7px 7px"}},i.a.createElement("div",{style:{position:"relative",width:"100%",color:dt("menu"),fontWeight:"bold",paddingBottom:"7px",borderBottom:"solid 1px #e4e4e4",textAlign:"center"}},lt("$__guidelineEtypes",1)),i.a.createElement("div",{style:{position:"relative",width:"100%",color:dt("medium"),fontSize:"14px",padding:"7px",textAlign:"center"}},lt("$__guidelineEdetails",1))),i.a.createElement(ph,{cards:b,cardType:"guidelineE"}))))))}));function yh(){yh=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var bh=Xe.default.div(gh||(gh=Object(ze.a)(["\nposition:absolute;\nheight:100%;\n","\n","\n @media(max-width: 959px) {\n display: contents !important;\n width: -webkit-fill-available;\n height:auto;\n }\n "])),(function(e){return!e.inLine&&e.styles&&e.styles.discountHeight&&"height:calc(100vh - ".concat(e.styles.discountHeight,"px);")}),(function(e){return e.inLine?"display: block;\n width: -webkit-fill-available;\n ".concat(e.style):" display: flex;\n width: 100%;\n ".concat(e.style,"\n @media(min-width: 960px) {\n display: flex;\n }\n ")})),xh=Object($e.b)((function(e,t){return{cards:e.db.cards}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.db,n=t.session,a=r.dataType,o=i.a.useState(!1),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.useState({}),d=Object(Be.a)(u,2),p=d[0],f=d[1],m=window.location.hash.split("/");m[0]=m[0].replace("#",""),36!==m[0].length&&(m[0]=null);var g={};Object.keys(r.cards).filter((function(t){var a=ma(t);if(r.cards[t]&&(!r.cards[t].private||r.cards[t].private&&r.cards[t]._users[n._id])&&(r.cards[t]._planId===m[0]||r.cards[t]._parent===m[0])&&(e.showCompleted||!e.showCompleted&&"completed"!==r.cards[t].status)&&(!e.onlyUnReaded||e.onlyUnReaded&&a.total>0))return!0})).map((function(e){g=Object(h.a)(Object(h.a)({},g),{},Object(O.a)({},e,r.cards[e]))}));var v=Object.keys(g).filter((function(e){return g[e]&&g[e].type&&!0===g[e]._selected&&g[e].type.indexOf("guideline")>-1})).length>0?Object.keys(g).filter((function(e){return g[e]&&g[e].type&&!0===g[e]._selected&&g[e].type.indexOf("guideline")>-1}))[0]:null,y=Object.keys(g).filter((function(e){return g[e]&&!0===g[e]._selected&&"objective"===g[e].type})).length>0?Object.keys(g).filter((function(e){return g[e]&&!0===g[e]._selected&&"objective"===g[e].type}))[0]:null,b=Object.keys(g).filter((function(e){return!0===g[e]._selected&&"goal"===g[e].type})).length>0?Object.keys(g).filter((function(e){return!0===g[e]._selected&&"goal"===g[e].type}))[0]:null,x=[{value:"guidelines",type:"guideline",label:"$__guidelines",icon:"alt_route",viewButton:!0,selectedParent:null},{value:"objectives",type:"objective",label:"$__objectives",icon:a.filter((function(e){return"objective"===e.name}))[0].icon,viewButton:!0,selectedParent:v},{value:"goals",type:"goal",label:"$__goals",icon:a.filter((function(e){return"goal"===e.name}))[0].icon,viewButton:!0,selectedParent:y||v},{value:"actions",type:"iniciative",label:"$__actions",icon:"double_arrow",selectedParent:b||y||v}],_={};_.guidelines=Object.keys(g).filter((function(e){return(g[e]._parent===m[0]||g[e]._planId===m[0])&&g[e].type&&g[e].type.indexOf("guideline")>-1}))||null,_.objectives=Object.keys(g).filter((function(e){return g[e].type&&"objective"===g[e].type&&(_.guidelines.indexOf(g[e]._parent)>-1||!v&&g[e]._planId===m[0])}))||null,_.objectives=Object.keys(g).filter((function(e){return"objective"===g[e].type&&!g[e].checklist&&(v&&g[e]._parent===v||!v&&g[e]._planId===m[0])})),_.objectives2=Object.keys(g).filter((function(e){if("objective"===g[e].type&&g[e]._parent!==v&&!g[e].checklist&&_.objectives.indexOf(g[e]._parent)>-1)return!0})),_.objectives2.map((function(e){-1===_.objectives.indexOf(e)&&_.objectives.push(e)})),_.goals=Object.keys(g).filter((function(e){return g[e].type&&"goal"===g[e].type&&(!y&&_.objectives.indexOf(g[e]._parent)>-1||y&&g[e]._parent===y||!y&&v&&g[e]._parent===v||!v&&!y&&g[e]._planId===m[0])}))||null,_.goals2=Object.keys(g).filter((function(e){return"goal"===g[e].type&&!g[e].checklist&&_.goals.indexOf(g[e]._parent)>-1})),_.goals2.map((function(e){-1===_.goals.indexOf(e)&&_.goals.push(e)})),_.actions=Object.keys(g).filter((function(e){return g[e].type&&!g[e].checklist&&"plan"!==g[e].type&&"objective"!==g[e].type&&"goal"!==g[e].type&&"feed"!==g[e].type&&"link"!==g[e].type&&"insight"!==g[e].type&&"link"!==g[e].type&&"chatGroup"!==g[e].type&&-1===g[e].type.indexOf("guideline")&&a.filter((function(t){return t.name===g[e].type})).length>0&&"swot"!==a.filter((function(t){return t.name===g[e].type}))[0].module&&(b&&g[e]._parent===b||!b&&y&&(g[e]._parent===y||_.goals.indexOf(g[e]._parent)>-1)||!b&&!y&&v&&(g[e]._parent===v||_.objectives.indexOf(g[e]._parent)>-1||_.goals.indexOf(g[e]._parent)>-1)||!b&&!y&&!v&&(!v&&_.guidelines.indexOf(g[e]._parent)>-1||!y&&_.objectives.indexOf(g[e]._parent)>-1||!b&&_.goals.indexOf(g[e]._parent)>-1)||!b&&!y&&!v&&!v&&!y&&!b&&g[e]._planId===m[0])}))||null,_.guidelines=_.guidelines.map((function(e){return g[e]})),_.objectives=_.objectives.map((function(e){return g[e]})),_.goals=_.goals.map((function(e){return g[e]})),_.actions=_.actions.map((function(e){return g[e]}));var w=function(){var t=Object(Me.a)(yh().mark((function t(n){var a,o,i,c,l,u,d,p,m,v,y,b,x;return yh().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=n.destination,o=n.source,i=n.draggableId,r.cards,!n.combine){t.next=5;break}return ft({message:"".concat(lt("$__confirmLink",1),": ").concat(De.getState().db.cards[i].name," >>> ").concat(De.getState().db.cards[n.combine.draggableId]?De.getState().db.cards[n.combine.draggableId].name:""),variant:"warning",persist:!0,horizontal:"right",confirm:function(){oa(e,{cardId:i,cardToLink:n.combine.draggableId})}}),t.abrupt("return");case 5:if(a){t.next=7;break}return t.abrupt("return",!1);case 7:if(a.droppableId!==o.droppableId||a.id!==o.index){t.next=9;break}return t.abrupt("return",!1);case 9:if(c=o.droppableId,l=a.droppableId,u=Array.from(Object.keys(g).filter((function(e){return g[e].status===c})).sort((function(e,t){return g[e].order&&g[t].order&&String(g[e].order.low)&&String(g[t].order.low)&&parseInt(g[e].order.low)<parseInt(g[t].order.low)?-1:1})).map((function(e){return e._id}))),c!==l||!De.getState().db.orderByTitle){t.next=14;break}return t.abrupt("return");case 14:if(c!==l||De.getState().db.orderByTitle){t.next=31;break}return d=De.getState().functions.socket,p="iniciative"===c?"action":c,(m=Array.from(_["".concat(p,"s")].filter((function(e){return e.status&&"completed"!==e.status})).sort((function(e,t){var r,n,a=(null===e||void 0===e||null===(r=e.order)||void 0===r?void 0:r.low)||!isNaN(null===e||void 0===e?void 0:e.order)||e.order?parseInt(e.order):0,o=(null===t||void 0===t||null===(n=t.order)||void 0===n?void 0:n.low)||!isNaN(null===t||void 0===t?void 0:t.order)||t.order?parseInt(t.order):0;return a<o?-1:a>o?1:0})).map((function(e){return e._id})))).splice(o.index,1),t.next=21,setTimeout(500);case 21:return m.splice(a.index,0,i),t.next=24,setTimeout(500);case 24:return d.emit("data",{module:"cards",method:"put",action:"reorder"},{cards:m}),v=Object(h.a)({},De.getState().db.cards),t.next=28,new Promise((function(e,t){m.map((function(t,r){v=Object(h.a)(Object(h.a)({},v),{},Object(O.a)({},t,Object(h.a)(Object(h.a)({},v[t]),{},{order:"".concat(r+1)}))),r+1===m.length&&e(!0)}))}));case 28:return t.sent&&e.reduxFunction("IMMEDIATE","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),v)})),t.abrupt("return");case 31:if(u.splice(o.index,1),(y=Array.from(Object.keys(g).filter((function(e){return e.status===l})).sort((function(e,t){return g[e].order&&g[t].order&&String(g[e].order.low)&&String(g[t].order.low)&&parseInt(g[e].order.low)<parseInt(g[t].order.low)?-1:1})).map((function(e){return e._id})))).splice(a.index,0,i),u.map((function(e,t){r.cards[e].order&&r.cards[e].order.low?r.cards[e].order.low=parseInt(t):r.cards[e]=Object(h.a)(Object(h.a)({},r.cards[e]),{},Object(O.a)({},"order",Object(O.a)({},"low",parseInt(t))))})),y.map((function(e,t){r.cards[e].order&&r.cards[e].order.low?r.cards[e].order.low=parseInt(t):r.cards[e]=Object(h.a)(Object(h.a)({},r.cards[e]),{},Object(O.a)({},"order",Object(O.a)({},"low",parseInt(t))))})),b=ua(i),x={_id:i,type:a.droppableId,_childrens:b,_objectives:_.objectives.filter((function(e){return b[e._id]})).map((function(e){return e})),_goals:_.goals.filter((function(e){return b[e._id]})).map((function(e){return e}))},"goal"!==r.cards[i].type||"guideline"!==a.droppableId){t.next=42;break}return ft({message:lt("$__YouCannotMoveThisItemToThisColumnMoveFirstToTheObjectiveColumn",1),variant:"error",persist:!1,horizontal:"center"}),f({}),t.abrupt("return");case 42:if(-1!==r.cards[i].type.indexOf("guideline")||"objective"===r.cards[i].type||"goal"===r.cards[i].type||"guideline"!==a.droppableId&&"objective"!==a.droppableId){t.next=46;break}return ft({message:lt("$__YouCannotMoveThisItemToThisColumnMoveFirstToTheGoalsColumn",1),variant:"error",persist:!1,horizontal:"center"}),f({}),t.abrupt("return");case 46:r.cards[i].type.indexOf("guideline")>-1&&"guideline"!==r.cards[i].type?ft({message:lt("$__youCantMoveGuidelineWithSwotLinked",1),variant:"error",persist:!1,horizontal:"center"}):"guideline"===r.cards[i].type&&"guideline"!==a.droppableId&&(_.objectives.filter((function(e){return e._parent===i})).length>0||_.goals.filter((function(e){return e._parent===i})).length>0)||r.cards[i].type.indexOf("objective")>-1&&"guideline"!==a.droppableId&&"objective"!==a.droppableId&&_.goals.filter((function(e){return e._parent===i})).length>0?(f(x),s(!0)):ft({message:"".concat(lt("$__confirmTransformIn",1),": ").concat(lt("$__".concat(a.droppableId))),variant:"warning",persist:!0,horizontal:"right",confirm:function(){E(x),r.cards[r.cards[i]._parent].type.indexOf(a.droppableId)>-1&&oa(e,{cardId:i,cardToLink:r.cards[r.cards[i]._parent]._parent})},cancel:function(){f({})}});case 47:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),E=function(){var t=Object(Me.a)(yh().mark((function t(r){var n;return yh().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r,p&&p._id&&(n=p),t.next=4,Gn(e,n);case 4:e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},n._id,Object(h.a)(Object(h.a)({},De.getState().db.cards[n._id]),{},{type:n.type})))})),f({});case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),j=function(){var t=Object(Me.a)(yh().mark((function t(r){var n;return yh().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n="goals"===r?p._goals:p._objectives,_[r].filter((function(e){return p._childrens[e._id]})).map(function(){var t=Object(Me.a)(yh().mark((function t(a,o){return yh().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.filter((function(e){return e._id===a._id})).map((function(e){e.type="goals"===r?"task":"goal"})),t.next=3,Gn(e,{_id:a._id,type:"goals"===r?"task":"goal"});case 3:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()),f(Object(h.a)(Object(h.a)({},p),"goals"===r?{_goals:n}:{_objectives:n}));case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),S=function(){var t=Object(Me.a)(yh().mark((function t(){return yh().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Gn(e,{_id:p._id,type:p.type});case 2:s(!1),f({});case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return i.a.createElement("div",null,i.a.createElement(di.a,{onDragEnd:w},i.a.createElement(di.c,{droppableId:"ALL-COLUMNS-TYPE",type:"column",direction:"".concat(e.inLine?"vertical":"horizontal"),isDropDisabled:!0},(function(t){return i.a.createElement(bh,Object.assign({},e,{ref:t.innerRef}),x.map((function(t,r){var n={name:t.label,icon:t.icon,cards:[],emptyHide:!1};return i.a.createElement(qp,Object.assign({},e,{key:t.value,columnId:t.type,isDropDisabled:!0,column:n,cards:_&&_[t.value]?_[t.value]:[],index:r,columnsSettings:!1,locked:!1,columnStyle:{minWidth:"200px"},viewButton:t.viewButton,isCombineEnabled:!0,inLineAdd:!0,selectedParent:t.selectedParent,cardColorPicker:!!e.showColors}))})),t.placeholder)}))),i.a.createElement(Ko.a,{fullWidth:!0,"aria-labelledby":"simple-dialog-title",open:l},i.a.createElement("div",{style:{position:"relative",marginLeft:"10px",marginTop:"5px",width:"calc(100% - 10px)"}},i.a.createElement(Fa,{title:lt("$__attention",1),icon:"label",onCancel:function(){s(!1),f({})}})),i.a.createElement("div",{style:{color:"#CCCCCC",padding:"15px"}},p._childrens&&!p._skipGoals&&p._goals.length>0&&p._goals.filter((function(e){return De.getState().db.cards[e._id]&&De.getState().db.cards[e._id].type===e.type})).length>0&&i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{style:{color:"gray"}},lt("$__YouHaveLinkedGoals"),i.a.createElement("p",{style:{color:"red"}},lt("$__ThisActionCanOnlyBeUndoneManually"))),p._goals.filter((function(e){return De.getState().db.cards[e._id]&&De.getState().db.cards[e._id].type===e.type})).sort((function(e,t){return De.getState().db.orderByTitle&&"ASC"===De.getState().db.orderByTitlePosition&&e.name.toLowerCase().trim()<t.name.toLowerCase().trim()||De.getState().db.orderByTitle&&"DESC"===De.getState().db.orderByTitlePosition&&e.name.toLowerCase().trim()>t.name.toLowerCase().trim()?-1:De.getState().db.orderByTitle?0:!De.getState().db.orderByTitle&&String(e.order)&&String(t.order)&&String(e.order.low)&&String(t.order.low)&&parseInt(e.order.low)<parseInt(t.order.low)?-1:1})).map((function(t,r){return i.a.createElement("div",{style:{width:"calc(100%)",display:"flex",alignItems:"center",justifyContent:"center"},key:t._id},i.a.createElement(oc,{db:"cards",data:t,noShadow:!0}),i.a.createElement(Nt.a,{onClick:function(){Gn(e,{_id:t._id,type:"task"})}},i.a.createElement(kt,{icon:"change_circle",color:dt("menu"),title:lt("$__transformInTask")})))})),i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",padding:"15px"}},i.a.createElement(At,{shadow:!0,title:lt("$__skipAll"),text:lt("$__skipAll"),color:"lightgrey",icon:"skip_next",size:"25px",onClick:function(){f(Object(h.a)(Object(h.a)({},p),{},{_skipGoals:!0}))}}),i.a.createElement("div",{style:{marginLeft:"15px"}},i.a.createElement(At,{shadow:!0,title:lt("$__changeAllInTasks"),text:lt("$__changeAllInTasks"),icon:"change_circle",size:"25px",onClick:function(){j("goals"),f(Object(h.a)(Object(h.a)({},p),{},{_skipGoals:!0}))}})))),p._childrens&&!p._skipObjectives&&p._objectives.length>0&&p._objectives.filter((function(e){return De.getState().db.cards[e._id]&&De.getState().db.cards[e._id].type===e.type})).length>0&&i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{style:{color:"gray"}},lt("$__YouHaveLinkedObjectives"),i.a.createElement("p",{style:{color:"red"}},lt("$__ThisActionCanOnlyBeUndoneManually"))),p._objectives.filter((function(e){return De.getState().db.cards[e._id]&&De.getState().db.cards[e._id].type===e.type})).sort((function(e,t){return De.getState().db.orderByTitle&&"ASC"===De.getState().db.orderByTitlePosition&&e.name.toLowerCase().trim()<t.name.toLowerCase().trim()||De.getState().db.orderByTitle&&"DESC"===De.getState().db.orderByTitlePosition&&e.name.toLowerCase().trim()>t.name.toLowerCase().trim()?-1:De.getState().db.orderByTitle?0:!De.getState().db.orderByTitle&&String(e.order)&&String(t.order)&&String(e.order.low)&&String(t.order.low)&&parseInt(e.order.low)<parseInt(t.order.low)?-1:1})).map((function(t,r){return i.a.createElement("div",{style:{width:"calc(100%)",display:"flex",alignItems:"center",justifyContent:"center"},key:t._id},i.a.createElement(oc,{db:"cards",data:t,noShadow:!0}),i.a.createElement(Nt.a,{onClick:function(){Gn(e,{_id:t._id,type:"goal"})}},i.a.createElement(kt,{icon:"change_circle",color:dt("menu"),title:lt("$__transformInGoal")})))})),i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",padding:"15px"}},i.a.createElement(At,{shadow:!0,title:lt("$__skipAll"),text:lt("$__skipAll"),color:"lightgrey",icon:"skip_next",size:"25px",onClick:function(){f(Object(h.a)(Object(h.a)({},p),{},{_skipObjectives:!0}))}}),i.a.createElement("div",{style:{marginLeft:"15px"}},i.a.createElement(At,{shadow:!0,title:lt("$__changeAllInGoal"),text:lt("$__changeAllInGoal"),icon:"change_circle",size:"25px",onClick:function(){j("objectives"),f(Object(h.a)(Object(h.a)({},p),{},{_skipObjectives:!0}))}}))),i.a.createElement("div",{style:{marginLeft:"15px"}},i.a.createElement(At,{shadow:!0,title:lt("$__cancel"),text:lt("$__cancel"),icon:"cancel",size:"25px",onClick:function(){s(!1),f({})}}))),(p&&p._childrens&&Object.keys(p._childrens).length>0&&0===p._goals.filter((function(e){return De.getState().db.cards[e._id]&&De.getState().db.cards[e._id].type===e.type})).length&&0===p._objectives.filter((function(e){return De.getState().db.cards[e._id]&&De.getState().db.cards[e._id].type===e.type})).length||(p._skipGoals&&p._goals.length>0||p&&p._goals&&0===p._goals.length)&&(p._skipObjectives&&p._objectives.length>0||p&&p._objectives&&0===p._objectives.length))&&i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{style:{color:"red"}},lt("$__clickInSaveToFinishMigration")),i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",padding:"15px"}},i.a.createElement(At,{shadow:!0,title:lt("$__cancel"),text:lt("$__cancel"),color:"lightgrey",icon:"close",size:"25px",onClick:function(){s(!1),f({})}}),i.a.createElement("div",{style:{marginLeft:"15px"}},i.a.createElement(At,{shadow:!0,title:lt("$__save"),text:lt("$__save"),icon:"done_all",size:"25px",onClick:function(){S()}})))))))})),_h=Object(Lt.a)(gd);var wh=Object($e.b)((function(e){return{store:{search:e.search,users:e.db.users}}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=_h(),r=De.getState(),n=(r.usersStatus,r.db),a=r.search,o=r.session,c=i.a.useState(!1),l=Object(Be.a)(c,2),s=l[0],u=l[1],d=i.a.useState(""),p=Object(Be.a)(d,2),f=p[0],m=p[1],g=i.a.useState(""),v=Object(Be.a)(g,2),y=v[0],b=v[1],x=i.a.useState(""),_=Object(Be.a)(x,2),w=_[0],E=_[1],j=[],S=window.location.hash.split("/");S[0]=S[0].replace("#",""),36!==S[0].length&&(S[0]=null);var k=window.location.pathname.split("/"),L="/".concat(k[1]),C=1;if(S[0]){var I=n.cards[S[0]]||{};(C=I&&I._users&&Object.keys(I._users).length>0?I._users[Object.keys(I._users).find((function(e){return e.indexOf(o._id)>-1}))]:0)&&C.access&&(C=C.access)}var F=function(t,r){De.getState().search.units.selected[t]&&Object.keys(De.getState().search.units.selected).filter((function(e){return De.getState().search.units.selected[e]})).length<=1?e.reduxFunction("ASYNC","SEARCH",Object(h.a)(Object(h.a)({},De.getState().search),{},{units:Object(h.a)(Object(h.a)({},De.getState().search.units),{},{selected:{}})},r?{groups:{selected:{}}}:{})):e.reduxFunction("ASYNC","SEARCH",Object(h.a)(Object(h.a)({},De.getState().search),{},{units:Object(h.a)(Object(h.a)({},De.getState().search.units),{},{selected:Object(h.a)(Object(h.a)({},De.getState().search.units.selected&&De.getState().search.units.selected),{},Object(O.a)({},t,!De.getState().search.units.selected[t]))})},r?{groups:{selected:{}}}:{}))};return S[1]&&$m.filter((function(e){return e.path===L})).length>0&&$m.filter((function(e){return e.path===L}))[0].tabs&&$m.filter((function(e){return e.path===L}))[0].tabs.length>0?($m.filter((function(e){return e.path===L}))[0].tabs&&$m.filter((function(e){return e.path===L}))[0].tabs).map((function(e){e.path===S[1]&&(j=e.searchFields)})):$m.filter((function(e){return e.path===L})).length>0&&$m.filter((function(e){return e.path===L}))[0].searchFields&&(j=$m.filter((function(e){return e.path===L}))[0].searchFields),i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{position:"relative",width:"100%",padding:"0px",marginBottom:"15px"}},j&&j.length>0&&j.indexOf("text")>-1&&i.a.createElement("div",{className:t.textField,style:{width:"100%"}},i.a.createElement(La,{className:t.noLabelLight,label:lt("$__search","*"),variant:"standard",autoFocus:!0,value:a.text,InputProps:{endAdornment:i.a.createElement(To.a,{position:"start"},i.a.createElement(kt,{color:dt("color")},"search")),onChange:function(t){e.reduxFunction("ASYNC","SEARCH",Object(h.a)(Object(h.a)({},De.getState().search),{},{text:t.target.value}))},onKeyDown:function(e){"27"===String(e.which)&&u(!1)}}})),j.indexOf("period")>-1&&i.a.createElement(i.a.Fragment,null,"PERIOD"),j.indexOf("date")>-1?i.a.createElement(i.a.Fragment,null,i.a.createElement(El,{type:"datetime",onChangeStartDate:function(t){var r={startDate:Ve()(t).unix("x")};(!De.getState().search.cards.endDate||De.getState().search.cards.endDate<Ve()(t).unix("x"))&&(r=Object(h.a)(Object(h.a)({},r),{},{endDate:Ve()("".concat(Ve()(t).format("YYYY-MM-DD")," 23:59:59")).add(1,"week").unix("X")})),e.reduxFunction("ASYNC","SEARCH",Object(h.a)(Object(h.a)({},De.getState().search),{},{cards:Object(h.a)(Object(h.a)({},De.getState().search.cards),r)}))},onChangeEndDate:function(t){e.reduxFunction("ASYNC","SEARCH",Object(h.a)(Object(h.a)({},De.getState().search),{},{cards:Object(h.a)(Object(h.a)({},De.getState().search.cards),{},{endDate:Ve()(t).unix("x")})}))},range:!0,startDate:De.getState().search.cards.startDate?new Date(1e3*De.getState().search.cards.startDate):null,endDate:De.getState().search.cards.endDate?new Date(1e3*De.getState().search.cards.endDate):null,onClear:function(){e.reduxFunction("ASYNC","SEARCH",Object(h.a)(Object(h.a)({},De.getState().search),{},{cards:Object(h.a)(Object(h.a)({},De.getState().search.cards),{},{startDate:null,endDate:null})}))}})):i.a.createElement(i.a.Fragment,null),j.indexOf("tags")>-1?i.a.createElement(al,{dbNode:"tag",options:De.getState().db.tag,style:{width:"100%"},name:"tag",ws:!0,multiple:!0,value:a.tags,placeholder:lt("$__tags"),onChange:function(t){e.reduxFunction("ASYNC","SEARCH",Object(h.a)(Object(h.a)({},De.getState().search),{},{tags:t}))}}):i.a.createElement(i.a.Fragment,null),j.indexOf("status")>-1&&i.a.createElement(Us.a,{style:{width:"100%",padding:0}},i.a.createElement(qs.a,{style:{minWidth:"100%"},expandIcon:i.a.createElement(kt,null,"expand_more"),"aria-controls":"panel1a-content",id:"panel1a-header"},i.a.createElement("div",{style:{color:dt("color"),fontSize:"16px",justifyContent:"space-between",width:"100%",display:"flex"}},i.a.createElement("div",{style:{position:"relative",float:"left"}},lt("$__status")),i.a.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},Object.keys(a.cards.status).map((function(e,t){if(a.cards.status[e]&&"all"!==e)return i.a.createElement(Qe.a,{title:lt(n.status.filter((function(t){return t.value===e}))[0].label,1),key:t},i.a.createElement("div",{style:{position:"relative",float:"left",width:"11px",height:"11px",borderRadius:"50%",backgroundColor:n.status.filter((function(t){return t.value===e}))[0].color,margin:"7px 3px"}}))}))))),i.a.createElement(Vs.a,{style:{minWidth:"100%"}},i.a.createElement(Js.a,{style:{width:"100%"}},i.a.createElement(Xs.a,{style:{minWidth:"100%"},control:i.a.createElement(Bo,{checked:!(!De.getState().search.cards.status||!De.getState().search.cards.status.all),onChange:function(){var t={};n.status.map((function(e){t=Object(h.a)(Object(h.a)({},t),{},Object(O.a)({},e.value,!De.getState().search.cards.status.all))})),e.reduxFunction("ASYNC","SEARCH",Object(h.a)(Object(h.a)({},De.getState().search),{},{cards:Object(h.a)(Object(h.a)({},De.getState().search.cards),{},{status:Object(h.a)(Object(h.a)({},t),{},{all:!De.getState().search.cards.status.all})})}))},color:"default"}),label:lt("$__allStatus")}),n.status.map((function(t,r){return i.a.createElement(i.a.Fragment,{key:r},i.a.createElement(Xs.a,{style:{minWidth:"100%"},control:i.a.createElement(Bo,{indeterminate:!!De.getState().search.cards.status.all,checked:!(!De.getState().search.cards.status||!De.getState().search.cards.status[t.value]),onChange:function(){var r=De.getState().search.cards.status;r.all&&n.status.map((function(e){r[e.value]=!1,r.all=!1})),e.reduxFunction("ASYNC","SEARCH",Object(h.a)(Object(h.a)({},De.getState().search),{},{cards:Object(h.a)(Object(h.a)({},De.getState().search.cards),{},{status:Object(h.a)(Object(h.a)({},r),{},Object(O.a)({},t.value,!!r.all||!De.getState().search.cards.status[t.value]))})}))},color:"default"}),label:lt(t.label)}))}))))),j.indexOf("priority")>-1&&i.a.createElement(Us.a,{style:{width:"100%"}},i.a.createElement(qs.a,{style:{minWidth:"100%"},expandIcon:i.a.createElement(kt,null,"expand_more"),"aria-controls":"panel1a-content",id:"panel1a-header"},i.a.createElement("div",{style:{color:dt("color"),fontSize:"16px",justifyContent:"space-between",width:"100%",display:"flex"}},i.a.createElement("div",{style:{position:"relative",float:"left"}},lt("$__priority")),i.a.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},Object.keys(a.cards.priority).map((function(e,t){if(a.cards.priority[e]&&"all"!==e)return i.a.createElement(Qe.a,{title:lt(n.priority.filter((function(t){return String(t.value)===String(e)}))[0].label,1),key:t},i.a.createElement("div",{style:{position:"relative",float:"left",width:"11px",height:"11px",borderRadius:"50%",backgroundColor:n.priority.filter((function(t){return String(t.value)===String(e)}))[0].color,margin:"7px 3px"}}))}))))),i.a.createElement(Vs.a,{style:{minWidth:"100%"}},i.a.createElement(Js.a,{style:{width:"100%"}},i.a.createElement(Xs.a,{style:{minWidth:"100%"},control:i.a.createElement(Bo,{checked:!(!De.getState().search.cards.priority||!De.getState().search.cards.priority.all),onChange:function(){var t=De.getState().search.cards.priority;t.all?n.priority.map((function(e){t[String(e.value)]=!1})):n.priority.map((function(e){t[String(e.value)]=!0})),e.reduxFunction("ASYNC","SEARCH",Object(h.a)(Object(h.a)({},De.getState().search),{},{cards:Object(h.a)(Object(h.a)({},De.getState().search.cards),{},{priority:Object(h.a)(Object(h.a)({},t),{},{all:!De.getState().search.cards.priority.all})})}))},color:"default"}),label:lt("$__allPriorities")}),n.priority.map((function(t,r){return i.a.createElement(i.a.Fragment,{key:r},i.a.createElement(Xs.a,{style:{minWidth:"100%",borderLeft:"3px solid ".concat(t.color)},control:i.a.createElement(Bo,{indeterminate:!(!De.getState().search.cards.priority||!De.getState().search.cards.priority.all),checked:!(!De.getState().search.cards.priority||!De.getState().search.cards.priority[t.value]),onChange:function(){var r=De.getState().search.cards.priority;r.all&&n.priority.map((function(e){r[String(e.value)]=!1,r.all=!1})),e.reduxFunction("ASYNC","SEARCH",Object(h.a)(Object(h.a)({},De.getState().search),{},{cards:Object(h.a)(Object(h.a)({},De.getState().search.cards),{},{priority:Object(h.a)(Object(h.a)({},r),{},Object(O.a)({},t.value,!!r.all||!De.getState().search.cards.priority[t.value]))})}))},color:"default"}),label:lt(t.label)}))}))))),j.indexOf("risk")>-1&&i.a.createElement(Us.a,{style:{width:"100%"}},i.a.createElement(qs.a,{style:{minWidth:"100%"},expandIcon:i.a.createElement(kt,null,"expand_more"),"aria-controls":"panel1a-content",id:"panel1a-header"},i.a.createElement("div",{style:{color:dt("color"),fontSize:"16px",justifyContent:"space-between",width:"100%",display:"flex"}},i.a.createElement("div",{style:{position:"relative",float:"left"}},lt("$__risk")),i.a.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},Object.keys(a.cards.risk).map((function(e,t){if(a.cards.risk[e]&&"all"!==e)return i.a.createElement(Qe.a,{title:lt(n.priority.filter((function(t){return String(t.value)===String(e)}))[0].label,1),key:t},i.a.createElement("div",{style:{position:"relative",float:"left",width:"11px",height:"11px",borderRadius:"50%",backgroundColor:n.priority.filter((function(t){return String(t.value)===String(e)}))[0].color,margin:"7px 3px"}}))}))))),i.a.createElement(Vs.a,{style:{minWidth:"100%"}},i.a.createElement(Js.a,{style:{width:"100%"}},i.a.createElement(Xs.a,{style:{minWidth:"100%"},control:i.a.createElement(Bo,{checked:!(!De.getState().search.cards.risk||!De.getState().search.cards.risk.all),onChange:function(){var t=De.getState().search.cards.risk;t.all?n.priority.map((function(e){t[String(e.value)]=!1})):n.priority.map((function(e){t[String(e.value)]=!0})),e.reduxFunction("ASYNC","SEARCH",Object(h.a)(Object(h.a)({},De.getState().search),{},{cards:Object(h.a)(Object(h.a)({},De.getState().search.cards),{},{risk:Object(h.a)(Object(h.a)({},t),{},{all:!De.getState().search.cards.risk.all})})}))},color:"default"}),label:lt("$__allPriorities")}),n.priority.map((function(t,r){return i.a.createElement(i.a.Fragment,{key:r},i.a.createElement(Xs.a,{style:{minWidth:"100%",borderLeft:"3px solid ".concat(t.color)},control:i.a.createElement(Bo,{indeterminate:!(!De.getState().search.cards.risk||!De.getState().search.cards.risk.all),checked:!(!De.getState().search.cards.risk||!De.getState().search.cards.risk[t.value]),onChange:function(){var r=De.getState().search.cards.risk;r.all&&n.priority.map((function(e){r[String(e.value)]=!1,r.all=!1})),e.reduxFunction("ASYNC","SEARCH",Object(h.a)(Object(h.a)({},De.getState().search),{},{cards:Object(h.a)(Object(h.a)({},De.getState().search.cards),{},{risk:Object(h.a)(Object(h.a)({},r),{},Object(O.a)({},t.value,!!r.all||!De.getState().search.cards.risk[t.value]))})}))},color:"default"}),label:lt(t.label)}))}))))),j.indexOf("complexity")>-1&&i.a.createElement(Us.a,{style:{width:"100%"}},i.a.createElement(qs.a,{style:{minWidth:"100%"},expandIcon:i.a.createElement(kt,null,"expand_more"),"aria-controls":"panel1a-content",id:"panel1a-header"},i.a.createElement("div",{style:{color:dt("color"),fontSize:"16px",justifyContent:"space-between",width:"100%",display:"flex"}},i.a.createElement("div",{style:{position:"relative",float:"left"}},lt("$__complexity")),i.a.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},Object.keys(a.cards.complexity).map((function(e,t){if(a.cards.complexity[e]&&"all"!==e)return i.a.createElement(Qe.a,{title:lt(n.priority.filter((function(t){return String(t.value)===String(e)}))[0].label,1),key:t},i.a.createElement("div",{style:{position:"relative",float:"left",width:"11px",height:"11px",borderRadius:"50%",backgroundColor:n.priority.filter((function(t){return String(t.value)===String(e)}))[0].color,margin:"7px 3px"}}))}))))),i.a.createElement(Vs.a,{style:{minWidth:"100%"}},i.a.createElement(Js.a,{style:{width:"100%"}},i.a.createElement(Xs.a,{style:{minWidth:"100%"},control:i.a.createElement(Bo,{checked:!(!De.getState().search.cards.complexity||!De.getState().search.cards.complexity.all),onChange:function(){var t=De.getState().search.cards.complexity;t.all?n.priority.map((function(e){t[String(e.value)]=!1})):n.priority.map((function(e){t[String(e.value)]=!0})),e.reduxFunction("ASYNC","SEARCH",Object(h.a)(Object(h.a)({},De.getState().search),{},{cards:Object(h.a)(Object(h.a)({},De.getState().search.cards),{},{complexity:Object(h.a)(Object(h.a)({},t),{},{all:!De.getState().search.cards.complexity.all})})}))},color:"default"}),label:lt("$__allPriorities")}),n.priority.map((function(t,r){return i.a.createElement(i.a.Fragment,{key:r},i.a.createElement(Xs.a,{style:{minWidth:"100%",borderLeft:"3px solid ".concat(t.color)},control:i.a.createElement(Bo,{indeterminate:!(!De.getState().search.cards.complexity||!De.getState().search.cards.complexity.all),checked:!(!De.getState().search.cards.complexity||!De.getState().search.cards.complexity[t.value]),onChange:function(){var r=De.getState().search.cards.complexity;r.all&&n.priority.map((function(e){r[String(e.value)]=!1,r.all=!1})),e.reduxFunction("ASYNC","SEARCH",Object(h.a)(Object(h.a)({},De.getState().search),{},{cards:Object(h.a)(Object(h.a)({},De.getState().search.cards),{},{complexity:Object(h.a)(Object(h.a)({},r),{},Object(O.a)({},t.value,!!r.all||!De.getState().search.cards.complexity[t.value]))})}))},color:"default"}),label:lt(t.label)}))}))))),j.indexOf("impact")>-1&&i.a.createElement(Us.a,{style:{width:"100%"}},i.a.createElement(qs.a,{style:{minWidth:"100%"},expandIcon:i.a.createElement(kt,null,"expand_more"),"aria-controls":"panel1a-content",id:"panel1a-header"},i.a.createElement("div",{style:{color:dt("color"),fontSize:"16px",justifyContent:"space-between",width:"100%",display:"flex"}},i.a.createElement("div",{style:{position:"relative",float:"left"}},lt("$__impact")),i.a.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},Object.keys(a.cards.impact).map((function(e,t){if(a.cards.impact[e]&&"all"!==e)return i.a.createElement(Qe.a,{title:lt(n.priority.filter((function(t){return String(t.value)===String(e)}))[0].label,1),key:t},i.a.createElement("div",{style:{position:"relative",float:"left",width:"11px",height:"11px",borderRadius:"50%",backgroundColor:n.priority.filter((function(t){return String(t.value)===String(e)}))[0].color,margin:"7px 3px"}}))}))))),i.a.createElement(Vs.a,{style:{minWidth:"100%"}},i.a.createElement(Js.a,{style:{width:"100%"}},i.a.createElement(Xs.a,{style:{minWidth:"100%"},control:i.a.createElement(Bo,{checked:!(!De.getState().search.cards.impact||!De.getState().search.cards.impact.all),onChange:function(){var t=De.getState().search.cards.impact;t.all?n.priority.map((function(e){t[String(e.value)]=!1})):n.priority.map((function(e){t[String(e.value)]=!0})),e.reduxFunction("ASYNC","SEARCH",Object(h.a)(Object(h.a)({},De.getState().search),{},{cards:Object(h.a)(Object(h.a)({},De.getState().search.cards),{},{impact:Object(h.a)(Object(h.a)({},t),{},{all:!De.getState().search.cards.impact.all})})}))},color:"default"}),label:lt("$__allPriorities")}),n.priority.map((function(t,r){return i.a.createElement(i.a.Fragment,{key:r},i.a.createElement(Xs.a,{style:{minWidth:"100%",borderLeft:"3px solid ".concat(t.color)},control:i.a.createElement(Bo,{indeterminate:!(!De.getState().search.cards.impact||!De.getState().search.cards.impact.all),checked:!(!De.getState().search.cards.impact||!De.getState().search.cards.impact[t.value]),onChange:function(){var r=De.getState().search.cards.impact;r.all&&n.priority.map((function(e){r[String(e.value)]=!1,r.all=!1})),e.reduxFunction("ASYNC","SEARCH",Object(h.a)(Object(h.a)({},De.getState().search),{},{cards:Object(h.a)(Object(h.a)({},De.getState().search.cards),{},{impact:Object(h.a)(Object(h.a)({},r),{},Object(O.a)({},t.value,!!r.all||!De.getState().search.cards.impact[t.value]))})}))},color:"default"}),label:lt(t.label)}))}))))),n.users&&Object.keys(n.users).length>0&&Object.keys(n.users).filter((function(e){if(n.users[e]&&n.users[e].type&&"user"!==n.users[e].type&&!n.users[e].deleted&&Object.keys(n.cards).filter((function(t){return n.cards[t]&&n.cards[t].client&&n.cards[t].client===e&&n.cards[t]._users&&n.cards[t]._users[o._id]})).length>0)return!0})).length>0&&j.indexOf("units")>-1&&a&&a.groups&&a.groups.selected&&0===Object.keys(a.groups.selected).length&&a.plans&&a.plans.selected&&0===Object.keys(a.plans.selected).length&&i.a.createElement(Us.a,{style:{width:"100%"}},i.a.createElement(qs.a,{style:{minWidth:"100%"},expandIcon:i.a.createElement(kt,null,"expand_more"),"aria-controls":"panel1a-content",id:"panel1a-header"},i.a.createElement("div",{style:{color:dt("color"),fontSize:"16px",justifyContent:"space-between",width:"100%",display:"flex"}},lt("$__units"),i.a.createElement(Yo.a,{max:6},Object.keys(De.getState().search.units.selected).length>0&&Object.keys(De.getState().search.units.selected).map((function(e,t){return i.a.createElement(Qe.a,{title:n.users[e].name,key:t},i.a.createElement(nn.a,{alt:n.users[e].name,src:n.users[e].image||null},n.users[e].name.substr(0,1)))}))))),i.a.createElement(Vs.a,{style:{minWidth:"100%"}},i.a.createElement(Js.a,{style:{width:"100%"}},i.a.createElement(La,{className:t.noLabelLight,label:lt("$__search","*"),variant:"standard",autoFocus:!0,value:y,InputProps:{endAdornment:i.a.createElement(To.a,{position:"start"},i.a.createElement(kt,{color:dt("color")},"search")),onChange:function(e){b(e.target.value)}}}),Object.keys(n.users).filter((function(e){return"user"!==n.users[e].type&&!n.users[e].deleted&&Object.keys(n.cards).filter((function(t){return n.cards[t]&&n.cards[t].client&&n.cards[t].client===e&&n.cards[t]._users&&n.cards[t]._users[o._id]})).length>0&&(""===y||n.users[e].name.toLowerCase().indexOf(y.toLowerCase())>-1)})).map((function(e){return i.a.createElement(i.a.Fragment,{key:e},i.a.createElement(Xs.a,{key:e,style:{minWidth:"100%"},control:i.a.createElement(i.a.Fragment,null,i.a.createElement(nn.a,{alt:n.users[e].name,src:n.users[e].image||null},n.users[e].name.substr(0,1)),i.a.createElement(Bo,{checked:!(!De.getState().search.units.selected||!De.getState().search.units.selected[e]),onChange:function(){!function(e){De.getState().search.groups.selected&&Object.keys(De.getState().search.groups.selected).length>0?ft({message:lt("$__alertGroupsFilterClear",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){F(e,!0)}}):F(e,!1)}(e)},color:"default"})),label:n.users[e].name||n.users[e].name}))}))))),n.users&&Object.keys(n.users).length>0&&j.indexOf("users")>-1&&i.a.createElement(Us.a,{style:{width:"100%"}},i.a.createElement(qs.a,{style:{minWidth:"100%"},expandIcon:i.a.createElement(kt,null,"expand_more"),"aria-controls":"panel1a-content",id:"panel1a-header"},i.a.createElement("div",{style:{color:dt("color"),fontSize:"16px",justifyContent:"space-between",width:"100%",display:"flex"}},lt("$__users"),i.a.createElement(Yo.a,{max:6},Object.keys(De.getState().search.users.selected).length>0&&Object.keys(De.getState().search.users.selected).map((function(e,t){return i.a.createElement(Qe.a,{title:n.users[e].name,key:t},i.a.createElement(nn.a,{alt:n.users[e].name,src:n.users[e].image||null},n.users[e].name.substr(0,1)))}))))),i.a.createElement(Vs.a,{style:{minWidth:"100%"}},i.a.createElement(Js.a,{style:{width:"100%"}},i.a.createElement(La,{className:t.noLabelLight,label:lt("$__search","*"),variant:"standard",autoFocus:!0,value:f,InputProps:{endAdornment:i.a.createElement(To.a,{position:"start"},i.a.createElement(kt,{color:dt("color")},"search")),onChange:function(e){m(e.target.value)}}}),Object.keys(n.users).filter((function(e){if("user"===n.users[e].type&&!n.users[e].deleted&&(0===Object.keys(a.units.selected).length||Object.keys(a.units.selected).length>0&&Object.keys(a.units.selected).filter((function(t){return t===e})).length>0)&&(!S[0]&&Object.keys(n.cards).filter((function(t){return n.cards[t]._users[e]&&"chatGroup"!==n.cards[t].type&&"plan"!==n.cards[t].type})).length>0||S[0]&&36===S[0].length&&Object.keys(n.cards).filter((function(t){return(n.cards[t]._planId===S[0]||n.cards[t]._id===S[0])&&n.cards[t]._users[e]&&"chatGroup"!==n.cards[t].type&&"plan"!==n.cards[t].type})).length>0)&&(""===f||""!==f&&(n.users[e]&&n.users[e].name&&n.users[e].name.toLowerCase().indexOf(f.toLowerCase())>-1||n.users[e].email.toLowerCase().indexOf(f.toLowerCase())>-1)))return!0})).sort((function(e,t){return n.users[e].name.trim().toLowerCase()<n.users[t].name.trim().toLowerCase()?-1:n.users[e].name.trim().toLowerCase()>n.users[t].name.trim().toLowerCase()?1:0})).map((function(t){return n.users&&n.users[t]&&n.users[t]._id&&i.a.createElement(i.a.Fragment,{key:t},i.a.createElement(Xs.a,{key:t,style:{minWidth:"100%"},control:i.a.createElement(i.a.Fragment,null,i.a.createElement(Pt.a,{overlap:"rectangular",color:"secondary"},i.a.createElement(sc,{overlap:"circular",anchorOrigin:{vertical:"bottom",horizontal:"right"},userId:n.users[t]._id},i.a.createElement(nn.a,{alt:n.users[t].name,src:n.users[t].image||null},n.users[t].name.substr(0,1)))),i.a.createElement(Bo,{checked:!(!De.getState().search.users.selected||!De.getState().search.users.selected[t]),onChange:function(){!function(t){De.getState().search.users.selected[t]&&Object.keys(De.getState().search.users.selected).filter((function(e){return De.getState().search.users.selected[e]})).length<=1?e.reduxFunction("ASYNC","SEARCH",Object(h.a)(Object(h.a)({},De.getState().search),{},{users:Object(h.a)(Object(h.a)({},De.getState().search.users),{},{selected:{}})})):e.reduxFunction("ASYNC","SEARCH",Object(h.a)(Object(h.a)({},De.getState().search),{},{users:Object(h.a)(Object(h.a)({},De.getState().search.users),{},{selected:Object(h.a)(Object(h.a)({},De.getState().search.users.selected&&De.getState().search.users.selected),{},Object(O.a)({},t,!De.getState().search.users.selected[t]))})}))}(t)},color:"default"})),label:n.users[t].name}))}))))),Object.keys(n.cards).filter((function(e){return"plan"===n.cards[e].type&&!n.cards[e].deleted&&!n.cards[e].archived&&n.cards[e]._users&&n.cards[e]._users[o._id]&&Object.keys(n.cards).filter((function(t){return!n.cards[t].deleted&&n.cards[t]._planId===e&&n.cards[t]._users&&n.cards[t]._users[o._id]})).length>0})).length>0&&j.indexOf("plans")>-1&&i.a.createElement(Us.a,{style:{width:"100%"}},i.a.createElement(qs.a,{style:{minWidth:"100%"},expandIcon:i.a.createElement(kt,null,"expand_more"),"aria-controls":"panel1a-content",id:"panel1a-header"},i.a.createElement("div",{style:{color:dt("color"),fontSize:"16px",justifyContent:"space-between",width:"100%",display:"flex"}},lt("$__plans"),i.a.createElement(Yo.a,{max:6},Object.keys(De.getState().search.plans.selected).length>0&&Object.keys(De.getState().search.plans.selected).map((function(e,t){return i.a.createElement(Qe.a,{title:n.cards[e].name,key:t},i.a.createElement(nn.a,{alt:n.cards[e].name,src:n.cards[e].image||null,style:{width:33,height:33}},n.cards[e].name.substr(0,1)))}))))),i.a.createElement(Vs.a,{style:{minWidth:"100%",width:"100%"}},i.a.createElement(Js.a,{style:{width:"100%"}},i.a.createElement(La,{className:t.noLabelLight,label:lt("$__search","*"),variant:"standard",autoFocus:!0,value:w,InputProps:{endAdornment:i.a.createElement(To.a,{position:"start"},i.a.createElement(kt,{color:dt("color")},"search")),onChange:function(e){E(e.target.value)}}}),Object.keys(n.cards).filter((function(e){return"plan"===n.cards[e].type&&!n.cards[e].deleted&&!n.cards[e].archived&&n.cards[e]._users&&n.cards[e]._users[o._id]&&Object.keys(n.cards).filter((function(t){return!n.cards[t].deleted&&n.cards[t]._planId===e&&n.cards[t]._users&&n.cards[t]._users[o._id]})).length>0&&(0===Object.keys(a.units.selected).length&&0===Object.keys(a.groups.selected).length||Object.keys(a.units.selected).length>0&&Object.keys(a.units.selected).filter((function(t){return t===n.cards[e].client})).length>0||Object.keys(a.groups.selected).length>0&&Object.keys(a.groups.selected).filter((function(t){return t===n.cards[e].client})).length>0)&&(""===w||n.cards[e].name.toLowerCase().indexOf(w.toLowerCase())>-1)})).sort((function(e,t){return e.name<t.name?-1:e.name>t.name?1:0})).map((function(t){return i.a.createElement(i.a.Fragment,{key:t},i.a.createElement(Xs.a,{key:t,style:{width:"calc(100% - 15px)",paddingRight:"15px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},control:i.a.createElement(i.a.Fragment,null,i.a.createElement(nn.a,{alt:n.cards[t].name,src:n.cards[t].image||null},n.cards[t].name.substr(0,1)),i.a.createElement(Bo,{checked:!(!De.getState().search.plans.selected||!De.getState().search.plans.selected[t]),onChange:function(){!function(t){De.getState().search.plans.selected[t]&&Object.keys(De.getState().search.plans.selected).filter((function(e){return De.getState().search.plans.selected[e]})).length<=1?e.reduxFunction("ASYNC","SEARCH",Object(h.a)(Object(h.a)({},De.getState().search),{},{plans:Object(h.a)(Object(h.a)({},De.getState().search.plans),{},{selected:{}})})):e.reduxFunction("ASYNC","SEARCH",Object(h.a)(Object(h.a)({},De.getState().search),{},{plans:Object(h.a)(Object(h.a)({},De.getState().search.plans),{},{selected:Object(h.a)(Object(h.a)({},De.getState().search.plans.selected&&De.getState().search.plans.selected),{},Object(O.a)({},t,!De.getState().search.plans.selected[t]))})}))}(t)},color:"default"})),label:n.cards[t].name||n.cards[t].name,title:n.cards[t].name||n.cards[t].name}))}))))),i.a.createElement("div",{style:{padding:"5px",width:"100%",display:"flex",justifyContent:"flex-end"},onClick:function(){u(!s)}},i.a.createElement(rn,{reverse:!0,icon:"clear_all",text:lt("$__removeFilter","*"),onClick:function(){e.reduxFunction("ASYNC","SEARCH_CLEAR",{})}}))))})),Eh=Object(Lt.a)((function(e){return{iconButtonStyleTransaparent:{padding:3,margin:0,"&:hover":{backgroundColor:"rgba(250,250,250,0.9)"}},iconButtonStyleWhite:{padding:3,margin:0,backgroundColor:"#FFFFFF","&:hover":{backgroundColor:"rgba(250,250,250,0.9)"}}}}));var Oh=function(e){var t=Eh(),r=i.a.useState(!1),n=Object(Be.a)(r,2),a=n[0],o=n[1],c=i.a.useRef(null),l=function(t){c.current&&c.current.contains(t.target)||(o(!1),e.onClose&&e.onClose())};return i.a.createElement("div",{style:Object(h.a)({zIndex:"100 !important"},e.style?e.style:{})},i.a.createElement(Qe.a,{title:lt("$__options",1)},e.hideText?i.a.createElement(Tt.a,{ref:c,"aria-controls":a?"menu-list-grow":void 0,"aria-haspopup":"true","aria-label":"menu",onClick:function(t){o((function(e){return!e})),!a&&e.onOpen&&e.onOpen(),a&&e.onClose&&e.onClose(),t.stopPropagation()},className:e.transparent?t.iconButtonStyleTransaparent:t.iconButtonStyleWhite},i.a.createElement(kt,{usePropagation:!0,size:e.size?e.size:"20px",color:e.btColor?e.btColor:dt("menu"),icon:e.icon?e.icon:e.horizontalButton?"more_horiz":"more_vert"})):i.a.createElement(Nt.a,{ref:c,"aria-controls":a?"menu-list-grow":void 0,"aria-haspopup":"true","aria-label":"menu",onClick:function(t){o((function(e){return!e})),!a&&e.onOpen&&e.onOpen(),a&&e.onClose&&e.onClose(),t.stopPropagation()},className:e.transparent?t.iconButtonStyleTransaparent:t.iconButtonStyleWhite},i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{style:{marginRight:"15px",color:e.textColor?e.textColor:e.color?e.color:dt("menu"),overflow:"hidden",textOverflow:"ellipsis",width:"90%",maxWidth:e.maxWidth?e.maxWidth:"90%",whiteSpace:"nowrap"}},lt("$__filter")),i.a.createElement(kt,{usePropagation:!0,size:e.size?e.size:"20px",color:e.btColor?e.btColor:dt("menu"),icon:"filter_alt"})))),i.a.createElement(mn.a,{open:a,anchorEl:c.current,role:void 0,transition:!0,style:{zIndex:"100 !important"}},(function(e){var t=e.TransitionProps;e.placement;return i.a.createElement(fn.a,Object.assign({},t,{style:{transformOrigin:"right center",zIndex:"100 !important"}}),i.a.createElement(hn.a,null,i.a.createElement(pn.a,{onClickAway:l},i.a.createElement("div",{style:{padding:"15px"}},i.a.createElement(wh,{onChange:function(e){console.log(e)}})))))})))};function jh(){jh=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Sh=Object($e.b)((function(e){return{groupByColor:e.db.groupByColor,orderByTitle:e.db.orderByTitle,orderByTitlePosition:e.db.orderByTitlePosition}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState().db,r=i.a.useState(!0),n=Object(Be.a)(r,2),a=n[0],o=n[1],c=i.a.useState(!0),l=Object(Be.a)(c,2),s=l[0],u=l[1],d=i.a.useState(!1),p=Object(Be.a)(d,2),f=p[0],m=p[1],g=i.a.useState(!1),v=Object(Be.a)(g,2),y=v[0],b=v[1],x=i.a.useState(!1),_=Object(Be.a)(x,2),w=_[0],E=_[1],O=window.location.hash.split("/");O[0]=O[0].replace("#",""),i.a.useEffect((function(){return function(){e.reduxFunction("ASYNC","SET_CONTROL",Object(h.a)(Object(h.a)({},De.getState().controls),{},{deleted:!1}))}}),[]),i.a.useEffect((function(){y&&j()}),[y]);var j=function(){var t=Object(Me.a)(jh().mark((function t(){var r;return jh().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return E(!0),(r=window.location.hash.split("/"))[0]=r[0].replace("#",""),t.next=5,In(e,{idRel:r[0],cardLoad:"deleted"});case 5:t.sent&&E(!1);case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),S=0;return Object.keys(t.cards).filter((function(e){var r=ma(e);if(t.cards[e]&&!t.cards[e].deleted&&(t.cards[e]._planId===O[0]||t.cards[e]._parent===O[0])&&(a||!a&&"completed"!==t.cards[e].status)&&r.total>0)return!0})).map((function(e){var t=ma(e);S+=t.total})),i.a.createElement("div",null,i.a.createElement(xo,{md:12,sm:12,xs:12},i.a.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},i.a.createElement(Oh,{style:{marginRight:"7px"}}),i.a.createElement(En,{text:lt("$__options"),icon:"settings",horizontalButton:!0,size:"21px",color:"lightgray",btColor:"lightgray",options:[{name:"ASC"===t.orderByTitlePosition?lt("$__orderByAsc"):lt("$__orderByDesc"),icon:"ASC"===t.orderByTitlePosition?"text_rotation_down":"text_rotate_up",onClick:function(){e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{orderByTitlePosition:"ASC"===De.getState().db.orderByTitlePosition?"DESC":"ASC"}))}},{name:t.orderByTitle?lt("$__manualOrder"):lt("$__orderByName"),icon:t.orderByTitle?"drag_handle":"format_list_numbered_rtl",onClick:function(){e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{orderByTitle:!De.getState().db.orderByTitle}))}},{name:lt(s?"$__hideCatenationColors":"$__showCatenationColors"),icon:"palette",color:s?"lightGray":dt("menu"),onClick:function(){u((function(e){return!e}))}},{name:lt("$__groupByColor"),icon:"gradient",color:t.groupByColor?dt("menu"):"lightGray",onClick:function(){e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{groupByColor:!t.groupByColor}))}}]}),i.a.createElement("div",{style:{marginLeft:"7px",display:"flex",alignItems:"center"}},i.a.createElement(At,{title:lt(a?"$__hideCompleted":"$__showCompleted","*"),text:lt(a?"$__hideCompleted":"$__showCompleted","*"),color:a?dt("menu"):"lightGray",icon:a?"toggle_on":"toggle_off",onClick:function(){o((function(e){return!e}))},size:"21px",style:{padding:"0px !important"}}),S>0?i.a.createElement(At,{title:lt(f?"$__hideUnreaded":"$__showUnreaded","*"),text:lt(f?"$__hideUnreaded":"$__showUnreaded","*"),color:f?dt("menu"):"lightGray",icon:f?"toggle_on":"toggle_off",onClick:function(){m((function(e){return!e}))},badgeContent:S,size:"21px",style:{marginLeft:"7px",padding:"0px !important"}}):i.a.createElement(i.a.Fragment,null),i.a.createElement("div",{style:{marginLeft:15}},i.a.createElement(At,{title:De.getState().controls.deleted?lt("$__hideDeleted"):lt("$__showDeleted"),color:De.getState().controls.deleted?"red":"lightgray",load:w,icon:"recycling",onClick:function(){b((function(e){return!e})),e.reduxFunction("ASYNC","SET_CONTROL",Object(h.a)(Object(h.a)({},De.getState().controls),{},{deleted:!y}))},size:"21px",style:{padding:"0px !important"}}))))),i.a.createElement(xo,{md:12,style:{marginLeft:"-30px"}},i.a.createElement(xh,{nodeId:O[0]||null,showCompleted:a,showColors:s,onlyUnReaded:f,styles:{discountHeight:140}})))}));var kh=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(bd)((function(e){e.classes;var t=De.getState(),r=t.db,n=t.search,a=i.a.useState(0),o=Object(Be.a)(a,2),c=o[0],l=o[1],s=i.a.useState(25),u=Object(Be.a)(s,2),d=u[0],p=u[1],f=i.a.useState(!1),h=Object(Be.a)(f,2),m=(h[0],h[1],window.location.hash.split("/"));m[0]=m[0].replace("#","");var g={};return g=36===m[0].length?(g=Object.keys(r.cards).filter((function(e){return r.cards[e]._parent&&r.cards[e]._parent===m[0]&&"link"===r.cards[e].type&&!r.cards[e].deleted})).sort((function(e,t){return r.cards[e].created_at>r.cards[t].created_at?-1:0})).map((function(e){return r.cards[e]}))).filter((function(e){return e.description&&e.description.toLowerCase().indexOf(n.text.toLowerCase())>-1||e.name&&e.name.toLowerCase().indexOf(n.text.toLowerCase())>-1})).map((function(e){return e})):(g=Object.keys(r.cards).filter((function(e){return!r.cards[e]._parent&&"link"===r.cards[e].type})).sort((function(e,t){return r.cards[e].created_at>r.cards[t].created_at?-1:0})).map((function(e){return r.cards[e]}))).filter((function(e){return e.description&&e.description.toLowerCase().indexOf(n.text.toLowerCase())>-1||e.name&&e.name.toLowerCase().indexOf(n.text.toLowerCase())>-1})).map((function(e){return e})),i.a.createElement("div",{style:{position:"relative",justifyContent:"space-between",margin:"auto",width:"100%"}},Object.keys(g).length>25&&i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",left:"0px",right:"0px",padding:"15px",display:"flex",alignItems:"center",justifyContent:"center"}},lt("$__page")," ",c+1," ",lt("$__of")," ",Math.ceil(Object.keys(g).length/d),i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},i.a.createElement(ad.a,{component:"div",count:Object.keys(g).length,page:c,onChangePage:function(e,t){l(t)},rowsPerPage:d,onChangeRowsPerPage:function(e){p(parseInt(e.target.value,10))},labelRowsPerPage:lt("$__cardsPerPage")}))),i.a.createElement(vo,null,Object.keys(g).map((function(e,t){if(t<=(c+1)*d&&t>=c*d)return i.a.createElement(xo,{key:g[e]._id,xs:12,sm:6,md:4,lg:3,xl:2},i.a.createElement(oc,{db:"cards",data:g[e],expanded:!0,Avatar:!0,Resume:!0}))}))),Object.keys(g).length>25&&i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",left:"0px",right:"0px",padding:"15px",display:"flex",alignItems:"center",justifyContent:"center"}},lt("$__page")," ",c+1," ",lt("$__of")," ",Math.ceil(Object.keys(g).length/d),i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},i.a.createElement(ad.a,{component:"div",count:Object.keys(g).length,page:c,onChangePage:function(e,t){l(t)},rowsPerPage:d,onChangeRowsPerPage:function(e){p(parseInt(e.target.value,10))},labelRowsPerPage:lt("$__cardsPerPage")}))))}))),Lh=r(552),Ch=r.n(Lh);var Ih=Object($e.b)((function(e){return{store:{plans:Object.keys(e.db.cards).filter((function(t){return"plan"===e.db.cards[t].type}))}}}),(function(e){return Object(u.b)(n,e)}))(Object(o.memo)((function(e){var t=De.getState(),r=t.db,n=t.session,a=t.search,o=xt(),c=window.location.hash.split("/");c[0]=c[0].replace("#","");var l=[];return l=Object.keys(r.cards).filter((function(e){return"plan"===r.cards[e].type&&("trash"!==c[1]&&!r.cards[e].deleted||"trash"===c[1]&&r.cards[e].deleted)})).sort((function(e,t){return r.cards[e].order&&r.cards[t].order&&parseInt(r.cards[e].order.low)<parseInt(r.cards[t].order.low)?-1:r.cards[e].order&&r.cards[t].order&&parseInt(r.cards[e].order.low)>parseInt(r.cards[t].order.low)?1:0})).map((function(e){return r.cards[e]})),l=o&&!o.owner&&!o.planAdmin&&!o.planEdit&&!o.planRead&&!o.planModerate&&r.cards&&n&&n._id||!r.adminView?Object.keys(r.cards).filter((function(e){return r.cards[e]&&"plan"===r.cards[e].type&&(!r.cards[e].private||r.cards[e].private&&r.cards[e]._users&&r.cards[e]._users[n._id])&&("templates"===c[1]||"templates"!==c[1]&&r.cards[e]._users&&Object.keys(r.cards[e]._users).filter((function(e){return e===n._id})).length>0||"admin"===c[1]&&r.cards[e]._users&&0===Object.keys(r.cards[e]._users).filter((function(e){return e===n._id})).length)})).sort((function(e,t){return r.cards[e].order&&r.cards[t].order&&parseInt(r.cards[e].order.low)<parseInt(r.cards[t].order.low)?-1:1})).map((function(e){return r.cards[e]})):Object.keys(r.cards).filter((function(e){return r.cards[e]&&"plan"===r.cards[e].type&&r.cards[e]._users&&(Object.keys(r.cards[e]._users).filter((function(e){return e===n._id})).length>0||!r.cards[e].private&&Object.keys(r.cards[e]._users).filter((function(e){return e!==n._id})).length>0)})).sort((function(e,t){return r.cards[e].order&&r.cards[t].order&&parseInt(r.cards[e].order.low)<parseInt(r.cards[t].order.low)?-1:1})).map((function(e){return r.cards[e]})),a.text&&(l=l.filter((function(e){return!!(e&&e.name&&e.name.toLowerCase().indexOf(a.text.toLowerCase())>-1)})).map((function(e){return e}))),l=(l=l.filter((function(e){return!!(e&&e.status&&a.cards.status[e.status]||!e.status&&a.cards.status.notStarted)})).map((function(e){return e}))).filter((function(e){return!!(e&&e.priority&&a.cards.priority[e.priority]||a.cards.priority.null&&!e.priority)})).map((function(e){return e})),Object.keys(a.users.selected).length>0&&(l=l.filter((function(e){var t=!1;if(!a.users.selected.unassigned||e._users&&0!==Object.keys(e._users).length){if(!a.users.selected.unassigned&&e&&e._users&&Object.keys(e._users).length>0)return Object.keys(e._users).filter((function(e){a.users.selected[e]&&(t=!0)})),t}else t=!0})).map((function(e){return e}))),Object.keys(a.units.selected).length>0&&(l=l.filter((function(e){return!(!a.units.selected.unassigned||e.client)||(!(!e.client||!a.units.selected[e.client]||!0!==a.units.selected[e.client])||void 0)})).map((function(e){return e}))),a.tags.length>0&&(l=l.filter((function(e){return e._tags&&e._tags.length>0&&e._tags.filter((function(e){var t=!1;return a.tags.map((function(r){r.value===e.value&&(t=!0)})),t})).length>0})).map((function(e){return e}))),i.a.createElement(vo,{style:{marginTop:"7px"}},l&&l.length>0&&l.filter((function(e){if((!e._planId||e._planId&&0===l.filter((function(t){return t._id===e._planId})).length)&&("templates"!==c[1]&&(!e.isTemplate||e.isTemplate&&"trash"===c[1])||"templates"===c[1]&&e.isTemplate)&&("archived"===c[1]&&e.archived||"archived"!==c[1]&&!e.archived)&&("trash"===c[1]&&e.deleted||"trash"!==c[1]&&!e.deleted))return!0})).sort((function(e,t){return e.name<t.name?-1:e.name>t.name?1:0})).map((function(e){var t;return i.a.createElement(xo,{key:e._id,xs:12,sm:6,md:4,lg:3,xl:2},i.a.createElement(oc,(t={db:"cards",data:e},Object(O.a)(t,"db","cards"),Object(O.a)(t,"Avatar",!0),Object(O.a)(t,"expanded",!0),Object(O.a)(t,"ignoreList",!0),t)))})),r.loaded&&(!l||0===l.length)&&i.a.createElement("div",{style:{width:"100%",height:"calc(100vh - 150px)",display:"flex",alignItems:"center",justifyContent:"center"}},i.a.createElement("img",{src:Ch.a})))}))),Fh=r(575),Th=r.n(Fh),Nh=r(576),Ph=r.n(Nh);function Dh(){Dh=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Ah=function(e){var t=De.getState().db.users,r=De.getState().db.cards,n=Object.keys(r).filter((function(t){return r[t].client===e.id&&"plan"===r[t].type&&!r[t].deleted&&!r[t].archived&&!r[t].isTemplate&&(!e.completed&&"completed"!==r[t].status||e.completed&&"completed"===r[t].status)})).sort((function(e,t){return e.name<t.name?-1:e.name>t.name?1:0})).map((function(e){return r[e]}));return i.a.createElement("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap"}},Object.keys(t).filter((function(r){return t[r]&&t[r]._parent===e.id})).length>0&&i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{width:"100%"}},lt("$__users",1),":"),i.a.createElement(Yo.a,{max:12},Object.keys(t).filter((function(r){return t[r]&&t[r]._parent===e.id})).map((function(e,r){return i.a.createElement(Qe.a,{title:t[e].name,key:e},i.a.createElement(nn.a,{alt:t[e].name,src:t[e].image||null,style:{width:"23px",height:"23px"}},t[e].name.substr(0,1)))})))),n.length>0&&i.a.createElement("div",{style:{width:"100%"}},n.map((function(e,t){return i.a.createElement("div",{key:"".concat(e._id,"-").concat(t)},i.a.createElement(oc,{data:e,db:"cards",Avatar:!1,expanded:!1,ignoreList:!0,notGlobalExpanded:!0}))}))))},$h=Object($e.b)((function(e){return{usersStatus:e.usersStatus,users:e.db.users}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Tl)((function(e){var t,r,n=e.data,a=(e.classes,De.getState()),o=a.db,c=a.session,l=(a.usersStatus,i.a.useState(!1)),u=Object(Be.a)(l,2),d=u[0],p=u[1],f=i.a.useState(null),m=Object(Be.a)(f,2),g=m[0],v=m[1];Ve()().tz("America/Sao_Paulo").format("YYYY/MM/DD"),i.a.useEffect((function(){d||(p(!0),y())}));var y=function(){var e=Object(Me.a)(Dh().mark((function e(){return Dh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),b=window.location.hash.split("/");b[0]=b[0].replace("#","");var x=[],_={};return Object.keys(o.cards).filter((function(e){return!!(o.cards[e]&&"chatGroup"!==o.cards[e].type&&"link"!==o.cards[e].type&&"insight"!==o.cards[e].type&&o.cards[e]._users&&Object.keys(o.cards[e]._users).length>0&&1===Object.keys(o.cards[e]._users).filter((function(e){return e===n._id})).length)})).map((function(e){if(o.dataType.filter((function(t){return t.name===o.cards[e].type}))[0]&&o.dataType.filter((function(t){return t.name===o.cards[e].type}))[0].module&&"swot"!==o.dataType.filter((function(t){return t.name===o.cards[e].type}))[0].module||o.cards[e]&&o.cards[e].type&&o.dataType.filter((function(t){return t.name===o.cards[e].type})).length>0&&"swot"===o.dataType.filter((function(t){return t.name===o.cards[e].type}))[0].module){var t,r;if(o.cards[e]&&o.cards[e].status&&"completed"!==o.cards[e].status)_=Object(h.a)(Object(h.a)({},_),{},(t={},Object(O.a)(t,o.cards[e].status,_&&_[o.cards[e].status]?_[o.cards[e].status]+1:1),Object(O.a)(t,"total",_.total?_.total+1:1),Object(O.a)(t,"late",o.cards[e].endDate&&Ve()(new Date(1e3*o.cards[e].endDate)).tz("America/Sao_Paulo").format()<=Ve()().tz("America/Sao_Paulo").format()?_.late?_.late+1:1:_.late?_.late:0),t));else _=Object(h.a)(Object(h.a)({},_),{},(r={},Object(O.a)(r,"completed",_&&_.completed?_.completed+1:1),Object(O.a)(r,"total",_.total?_.total+1:1),r));x[o.cards[e].type]=x[o.cards[e].type]?x[o.cards[e].type]+1:1}else x.swot=null==x.swot?1:x.swot+1})),x=[],_={},n.name.indexOf("Abel")>-1&&console.log(n),e.expanded?i.a.createElement("div",{style:Object(h.a)({boxShadow:"0 0 3px 3px rgba(0,0,0,0.1)",position:"relative",marginLeft:"15px"},e.onClick?{cursor:"pointer"}:{}),onClick:e.onClick?function(){e.onClick()}:null},i.a.createElement("div",{style:{backgroundColor:dt("menu"),height:"43px",paddingLeft:"60px",fontSize:"12px",color:"#FFFFFF",fontWeight:"bold",textOverflow:"ellipsis ",whiteSpace:"nowrap",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"space-between",left:"15px"}},(n.name,n.name),!e.resume&&i.a.createElement("div",{style:{float:"right",display:"flex",alignItems:"center",marginRight:"7px"}},!e.noActions&&i.a.createElement("div",{style:{float:"right",display:"flex",alignItems:"center",marginRight:"7px"}},i.a.createElement(kt,{color:dt("color"),icon:"close",onClick:function(){s.push("c#tab/".concat(b[1]))}})))),!g&&n.image?i.a.createElement("img",{style:{width:"70px",height:"70px",top:"-20px",left:"-6px",borderRadius:"50%",border:"solid 2px ".concat(dt("color")),zIndex:"5 !important",position:"absolute",backgroundColor:"".concat(dt("color"))},src:"".concat(n.image?n.image:n.type&&"user"!==n.type?Ph.a:Th.a),onError:function(e){v(null)},onLoad:function(e){v("".concat(n.image?n.image:n.type&&"user"!==n.type?Ph.a:Th.a))},width:"100%"}):n.image?i.a.createElement("div",{style:{width:"50px",height:"50px",top:"-4px",left:"-13px",borderRadius:"50%",border:"solid 2px ".concat(dt("color")),zIndex:"5 !important",position:"absolute",background:dt("AvatarBackground"),backgroundImage:'url("'.concat(g,'")'),backgroundSize:"cover",backgroundPosition:"center center"}}):i.a.createElement("div",{style:{width:"50px",height:"50px",top:"-4px",left:"-13px",borderRadius:"50%",border:"solid 2px ".concat(dt("color")),zIndex:"5 !important",position:"absolute",background:dt("AvatarBackground"),display:"flex",alignItems:"center",justifyContent:"center"}},n.type&&"user"!==n.type?i.a.createElement(kt,{size:"16px",color:"rgba(250,250,250,0.77)"},"business"):i.a.createElement(kt,{size:"16px",color:"rgba(250,250,250,0.77)"},"person"))):i.a.createElement("div",{style:{marginTop:"33px",width:e.style&&e.style.width?e.style.width:"calc(100% - 15px)",minHeight:"120px",backgroundColor:"#FFFFFF",boxShadow:"0 0 3px 3px rgba(0,0,0,0.1)",position:"relative",marginLeft:e.style&&e.style.marginLeft?e.style.marginLeft:"15px"}},i.a.createElement("div",{style:{backgroundColor:dt("menu"),height:"43px",paddingLeft:"95px",fontSize:"12px",color:"#FFFFFF",fontWeight:"bold",display:"flex",alignItems:"center",justifyContent:"space-between"}},i.a.createElement("div",{style:{maxWidth:"calc(100% - 10px)",textOverflow:"ellipsis ",whiteSpace:"nowrap",overflow:"hidden"}},(n.name,n.name)),!e.resume&&i.a.createElement("div",{style:{float:"right",display:"flex",alignItems:"center",marginRight:"7px"}},!e.noActions&&(!n.independentAccount||n.independentAccount&&c&&c.matrixAdmin)&&(!n._parent||n._parent&&De.getState().db.users[n._parent]&&!De.getState().db.users[n._parent].independentAccount)&&i.a.createElement("div",{style:{float:"right",display:"flex",alignItems:"center",marginRight:"7px"}},i.a.createElement(kt,{color:dt("color"),icon:"create",onClick:function(){e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},o.sideModule),{},{id:n._id,activeModule:"userEdit",db:"users",data:Object(h.a)({type:"user"},n)}))}})),!e.noActions&&"user"!==n.type&&i.a.createElement("div",{style:{float:"right",display:"flex",alignItems:"center",marginRight:"7px"}},i.a.createElement(kt,{color:dt("color"),icon:"contacts",onClick:function(){s.push("c#tab/units/".concat(n._id))}})),!e.noActions&&"sic"===n.type&&i.a.createElement("div",{style:{float:"right",display:"flex",alignItems:"center",marginRight:"7px"}},i.a.createElement(kt,{color:dt("color"),icon:"badge",onClick:function(){s.push("c#tab/units/".concat(n._id))}})))),n.image&&(!g||n.image&&n.image!==g)?i.a.createElement("img",{style:{width:"90px",height:"90px",top:"-24px",left:"-6px",borderRadius:"50%",border:"solid 2px ".concat(dt("color")),zIndex:"5 !important",position:"absolute",backgroundColor:"".concat(dt("color"))},src:"".concat(n.image?n.image:n.type&&"user"!==n.type?Ph.a:Th.a),onError:function(e){},onLoad:function(e){v("".concat(n.image?n.image:null))},width:"100%"}):n.image?i.a.createElement("div",{style:{width:"90px",height:"90px",top:"-24px",left:"-6px",borderRadius:"50%",border:"solid 2px ".concat(dt("color")),zIndex:"5 !important",position:"absolute",background:dt("AvatarBackground"),backgroundImage:'url("'.concat(g,'")'),backgroundSize:"cover",backgroundPosition:"center center"}}):i.a.createElement("div",{style:{width:"90px",height:"90px",top:"-24px",left:"-6px",borderRadius:"50%",border:"solid 2px ".concat(dt("color")),zIndex:"5 !important",position:"absolute",background:dt("AvatarBackground"),display:"flex",alignItems:"center",justifyContent:"center"}},n.type&&"user"!==n.type?i.a.createElement(kt,{size:"33px",color:"rgba(250,250,250,0.77)"},"business"):i.a.createElement(kt,{size:"33px",color:"rgba(250,250,250,0.77)"},"person")),e.children?e.children:i.a.createElement(i.a.Fragment,null,(null===n||void 0===n||null===(t=n._access)||void 0===t?void 0:t.enabled)&&"user"===n.type?i.a.createElement("div",{style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"flex-end",fontSize:12,color:dt("medium"),padding:"3px 7px"}},(null===n||void 0===n||null===(r=n._access)||void 0===r?void 0:r.admin)?i.a.createElement(i.a.Fragment,null,i.a.createElement(kt,{color:dt("medium"),size:"12px"},"supervisor_account"),i.a.createElement("span",null,lt("$__supervisorAccount"))):i.a.createElement(i.a.Fragment,null,i.a.createElement(kt,{color:dt("medium"),size:"12px"},"supervised_user_circle"),i.a.createElement("span",null,lt("$__guest")))):"user"===n.type&&n._access&&!n._access.enabled?i.a.createElement("div",{style:{width:"100%",display:"flex",alignItems:"center",color:"red",fontSize:10}},lt("$__notEnabled")):i.a.createElement(i.a.Fragment,null),n.groups&&n.groups.length>0?i.a.createElement("div",{style:{position:"relative",width:"100%",fontSize:"12px",color:dt("mediumText"),paddingLeft:"94px",paddingRight:"15px",marginTop:"15px"}},n.groups.filter((function(e){return e.value})).sort((function(e,t){return e.label<t.label?-1:1})).map((function(e,t){return"".concat(t>0?" / ":"").concat(e.label)}))):"user"===n.type?i.a.createElement("div",{style:{position:"relative",width:"100%",fontSize:"12px",color:dt("mediumText"),paddingLeft:"94px",marginTop:"15px"}},lt("$__doesntBelongToAGroup")):i.a.createElement(i.a.Fragment,null),!e.noShowUsers&&"user"!==n.type&&i.a.createElement("div",{style:{marginTop:"11px",width:"100%",padding:"15px"}},i.a.createElement(Ah,Object.assign({id:n._id},e))),"user"===n.type&&Object.keys(x).length>0?i.a.createElement("div",{style:{display:"flex",width:"100%",paddingLeft:"15px",paddingRight:"15px",flexFlow:"wrap",paddingTop:15,paddingBottom:15}},Object.keys(x).map((function(e,t){return"null"!==String(e)&&"undefined"!==String(e)?i.a.createElement(Qr,{overlap:"rectangular",key:t,style:{padding:3},icon:o.dataType.filter((function(t){return t.name===e}))[0].icon,title:lt("$__".concat(e),1),size:"16px",count:x[e],disabled:!0}):null}))):i.a.createElement(i.a.Fragment,null),"user"===n.type&&_&&_.total>0?i.a.createElement("div",{style:{display:"flex",width:"100%",paddingLeft:"15px",paddingRight:"15px",flexFlow:"wrap",paddingTop:15,paddingBottom:15}},i.a.createElement("fieldset",{style:{padding:7,width:"calc(100% - 14px)"}},i.a.createElement("legend",{style:{color:"lightgray",fontSize:12}},lt("$__openActivities")),i.a.createElement("h3",null,i.a.createElement("small",null,lt("$__total",1),": ",_.total)),o.status.filter((function(e){return"completed"!==e.value})).map((function(e,t){return i.a.createElement("div",{key:"".concat(t,"_").concat(e.value),style:{color:"black",display:"flex",justifyContent:"space-between",height:"30px",alignItems:"center",width:"100%"}},i.a.createElement("div",{style:{display:"flex"}},i.a.createElement(kt,{color:e.color},e.icon),i.a.createElement("span",{style:{marginLeft:"15px"}},lt(e.label,1))),i.a.createElement("div",null,_[e.value]?_[e.value]:0))})),i.a.createElement("div",{style:{color:"black",display:"flex",justifyContent:"space-between",height:"30px",alignItems:"center",width:"100%"}},i.a.createElement("div",{style:{display:"flex"}},i.a.createElement(kt,{color:"red"},"assignment_late"),i.a.createElement("span",{style:{marginLeft:"15px"}},lt("$__late",1))),i.a.createElement("div",null,_.late)))):i.a.createElement(i.a.Fragment,null),!e.resume&&i.a.createElement(bn,{options:n.tags,showOptions:!1}),e.resume&&i.a.createElement("div",null,i.a.createElement(sc,{overlap:"circular",anchorOrigin:{vertical:"top",horizontal:"left"},userId:n._id},i.a.createElement(kt,{size:"27px"},"chat")))))})));var zh=function(e){var t=De.getState().db,r=[];return e.plans.map((function(e){0===r.filter((function(t){return t._id===e.client})).length&&t.users[e.client]&&r.push(t.users[e.client])})),i.a.createElement(i.a.Fragment,null,r.sort((function(e,t){var r=e.displayName||e.name,n=t.displayName||t.name;return r<n?-1:r>n?1:0})).map((function(t,r){return i.a.createElement(xo,{key:"".concat(t._id,"-").concat(r),xs:12,sm:6,md:4,lg:4,xl:3,style:{height:"calc(100% - 34px)",padding:"0px 0px !important"}},i.a.createElement($h,{data:t,expanded:!1,noActions:!0,style:{height:"calc(100% - 34px)",margin:0},completed:!!e.completed}))})))},Mh=function(e){return i.a.createElement(i.a.Fragment,null,e.plans.sort((function(e,t){return e.name<t.name?-1:e.name>t.name?1:0})).map((function(e,t){return i.a.createElement(xo,{key:"".concat(e._id,"_").concat(t),xs:12,sm:6,md:4,lg:3,xl:2},i.a.createElement(oc,{data:e,db:"cards",Avatar:!0,expanded:!0,ignoreList:!0}))})))},Bh=Object($e.b)((function(e,t){return Object(h.a)(Object(h.a)({},t),{},{cards:e.db.cards})}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.db,n=t.session,a=t.search;i.a.useEffect((function(){}),[]);var o=xt(),c=window.location.hash.split("/");c[0]=c[0].replace("#","");var l=[];return l=Object.keys(r.cards).filter((function(t){return"plan"===r.cards[t].type&&!r.cards[t].deleted&&!r.cards[t].isTemplate&&!r.cards[t].archived&&(!e.completed&&"completed"!==r.cards[t].status||e.completed&&"completed"===r.cards[t].status)})).sort((function(e,t){return r.cards[e].order&&r.cards[t].order&&parseInt(r.cards[e].order.low)<parseInt(r.cards[t].order.low)?-1:r.cards[e].order&&r.cards[t].order&&parseInt(r.cards[e].order.low)>parseInt(r.cards[t].order.low)?1:0})).map((function(e){return r.cards[e]})),l=o&&!o.owner&&!o.planAdmin&&!o.planEdit&&!o.planRead&&!o.planModerate&&r.cards&&n&&n._id||!r.adminView?l.filter((function(e){return"plan"===e.type&&e&&e._users&&Object.keys(e._users).filter((function(e){return e===n._id})).length>0})).sort((function(e,t){return e&&e.order&&t&&t.order&&parseInt(e.order.low)<parseInt(t.order.low)?-1:1})).map((function(e){return e})):l.filter((function(e){return"plan"===e.type&&e&&e._users&&(Object.keys(e._users).filter((function(e){return e===n._id})).length>0||!e.private&&Object.keys(e._users).filter((function(e){return e!==n._id})).length>0)})).sort((function(e,t){return e.order&&r.cards[t].order&&parseInt(e.order.low)<parseInt(r.cards[t].order.low)?-1:1})).map((function(e){return e})),a.text&&(l=l.filter((function(e){return!!(e&&e.name&&e.name.toLowerCase().indexOf(a.text.toLowerCase())>-1)})).map((function(e){return e}))),l=(l=l.filter((function(e){return!!(e&&e.status&&a.cards.status[e.status]||!e.status&&a.cards.status.notStarted)})).map((function(e){return e}))).filter((function(e){return!!(e&&e.priority&&a.cards.priority[e.priority]||a.cards.priority.null&&!e.priority)})).map((function(e){return e})),Object.keys(a.users.selected).length>0&&(l=l.filter((function(e){var t=!1;if(!a.users.selected.unassigned||e._users&&0!==Object.keys(e._users).length){if(!a.users.selected.unassigned&&e&&e._users&&Object.keys(e._users).length>0)return Object.keys(e._users).filter((function(e){a.users.selected[e]&&(t=!0)})),t}else t=!0})).map((function(e){return e}))),Object.keys(a.units.selected).length>0&&(l=l.filter((function(e){return!(!a.units.selected.unassigned||e.client)||(!(!e.client||!a.units.selected[e.client]||!0!==a.units.selected[e.client])||void 0)})).map((function(e){return e}))),a.tags.length>0&&(l=l.filter((function(e){return e._tags&&e._tags.length>0&&e._tags.filter((function(e){var t=!1;return a.tags.map((function(r){r.value===e.value&&(t=!0)})),t})).length>0})).map((function(e){return e}))),i.a.createElement("div",null,l.filter((function(e){return e._isFavorite})).length>0&&i.a.createElement("div",{style:{marginBottom:"33px"}},i.a.createElement(Io,{title:lt("$__myFavoritePlans",1),icon:"favorite",color:dt("menu")}),i.a.createElement(vo,null,i.a.createElement(Mh,{plans:l.filter((function(e){return e._isFavorite&&!e.private})).map((function(e){return e}))}))),l.filter((function(e){return e._isFavorite&&e.private})).length>0&&i.a.createElement("div",{style:{marginBottom:"33px"}},i.a.createElement(Io,{title:lt("$__myFavoritePrivatePlans",1),icon:"private_connectivity",color:dt("menu")}),i.a.createElement(vo,null,i.a.createElement(Mh,{plans:l.filter((function(e){return e._isFavorite&&e.private})).map((function(e){return e}))}))),l.filter((function(e){return e.client&&r.users[e.client]})).length>0&&i.a.createElement("div",{style:{marginBottom:"33px"}},i.a.createElement(Io,{title:lt("$__customerPlanning",1),icon:"business",color:dt("menu")}),i.a.createElement(vo,null,i.a.createElement(zh,{plans:l.filter((function(e){return e.client})).map((function(e){return e})),completed:!!e.completed}))),l.filter((function(e){return!e.client&&!e.private})).length>0&&i.a.createElement("div",{style:{marginBottom:"33px"}},i.a.createElement(Io,{title:lt("$__accountPlanning",1),icon:"work",color:dt("menu")}),i.a.createElement(vo,null,i.a.createElement(Mh,{plans:l.filter((function(e){return!e.client&&!e.private})).map((function(e){return e}))}))),l.filter((function(e){return e.client&&!r.users[e.client]})).length>0&&i.a.createElement("div",{style:{marginBottom:"33px"}},i.a.createElement(Io,{title:lt("$__consultingPlanning",1),icon:"work",color:dt("menu")}),i.a.createElement(vo,null,i.a.createElement(Mh,{plans:l.filter((function(e){return e.client&&!r.users[e.client]})).map((function(e){return e}))}))),l.filter((function(e){return!e.client&&e.private})).length>0&&i.a.createElement("div",{style:{marginBottom:"33px"}},i.a.createElement(Io,{title:lt("$__privatePlanning",1),icon:"private_connectivity",color:dt("menu")}),i.a.createElement(vo,null,i.a.createElement(Mh,{plans:l.filter((function(e){return!e.client&&e.private})).map((function(e){return e}))}))),r.loaded&&(!l||0===l.length)&&i.a.createElement("div",{style:{width:"100%",height:"calc(100vh - 150px)",display:"flex",alignItems:"center",justifyContent:"center"}},i.a.createElement("img",{src:Ch.a})))}));var Yh=Object($e.b)((function(e){return{history:e.db.history}}),(function(e){return Object(u.b)(n,e)}))(Object(o.memo)((function(e){var t=De.getState().session;i.a.useEffect((function(){}),[]),i.a.useEffect((function(){var e=setTimeout((function(){document.getElementById("mainPannel").scrollTo(0,0)}),100);return function(){clearTimeout(e)}}),[e.history]);var r=window.location.hash.split("/");r[0]=r[0].replace("#",""),window.location.hash.split("/")[0].replace("#","")||s.push("sp#tab/home");var n=!0;return r[0]&&36===r[0].length&&!De.getState().db.cards[r[0]]&&(n=!1),r[0]&&36===r[0].length&&De.getState().db.cards[r[0]]&&!De.getState().db.cards[r[0]].isTemplate&&De.getState().db.cards[r[0]]._users&&!De.getState().db.cards[r[0]]._users[t._id]&&De.getState().db.cards[r[0]]._account&&De.getState().db.cards[r[0]]._account!==Re()(t.account).toString()&&(n=!1),ga(r[0])&&(n=ga(r[0])),n?i.a.createElement("div",null,i.a.createElement(md,null),(!r[0]||r[0]&&36!==r[0].replace("#","").length)&&"home"===r[1]?i.a.createElement(i.a.Fragment,null,i.a.createElement(Bh,null)):(!r[0]||r[0]&&36!==r[0].replace("#","").length)&&"completed"===r[1]?i.a.createElement(i.a.Fragment,null,i.a.createElement(Bh,{completed:!0})):(!r[0]||r[0]&&36!==r[0].replace("#","").length)&&i.a.createElement(Ih,null),36===r[0].length&&De.getState().db.cards[r[0].replace("#","")]?i.a.createElement(i.a.Fragment,null,r[1]&&"matrix"===r[1]&&i.a.createElement(vh,null),r[1]&&("actions"===r[1]||"guidelines"===r[1]||"objectives"===r[1]||"goals"===r[1])&&i.a.createElement(qf,{type:r[1]}),r[1]&&"dashboard"===r[1]&&i.a.createElement(Zf,null),r[1]&&"overview"===r[1]&&i.a.createElement(Sh,null),r[1]&&"board"===r[1]&&i.a.createElement("div",{style:{width:"100%"}},i.a.createElement(Df,{nodeId:r[0]||null,columProps:{style:{height:"calc(100vh - 190px)"}}})),r[1]&&"bright-and-connected"===r[1]&&i.a.createElement(i.a.Fragment,null,i.a.createElement(ep,null)),r[1]&&"insight-boards"===r[1]&&i.a.createElement(eh,null),r[1]&&"radar"===r[1]&&i.a.createElement(kh,null),r[1]&&"library"===r[1]&&i.a.createElement(Fp,null),r[1]&&"planningBoard"===r[1]&&i.a.createElement("iframe",{style:{position:"absolute",width:"calc(100% - 30px)",height:"100%",border:"none"},src:"https://miro.com/app/live-embed/".concat(De.getState().db.cards[r[0]].miroBoard,"=/?embedAutoplay=true&moveToViewport=-23165,-5837,13803,7546")})):i.a.createElement(i.a.Fragment,null)):(s.push("/deniedAccess"),i.a.createElement(i.a.Fragment,null))})));function Gh(){Gh=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Rh=Object($e.b)((function(e){return{store:{db:{cards:e.db.cards,tag:e.db.tag}},hidePrivate:e.controls.hidePrivate}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Gc)((function(e){var t=i.a.useState(null),r=Object(Be.a)(t,2),n=r[0],a=r[1],o=i.a.useState(!1),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.useState([]),d=Object(Be.a)(u,2),p=d[0],f=d[1],m=i.a.useState([]),g=Object(Be.a)(m,2),v=g[0],y=g[1],b=i.a.useState(!1),x=Object(Be.a)(b,2),_=x[0],w=x[1],E=De.getState().session,j=e.store.db,S=De.getState().db.dataType,k=xt();i.a.useEffect((function(){return function(){}}),[]),i.a.useEffect((function(){C(),_&&L()}),[_]),i.a.useEffect((function(){v.length>0&&v[0]!==n&&(w(!1),a(v[0]));var e=setTimeout((function(){return C()}),400);return function(){return clearTimeout(e)}}),[j.cards,j.tag,v]),i.a.useEffect((function(){var e=window.location.hash.split("/");e[0]=e[0].replace("#",""),JSON.stringify(e)!==JSON.stringify(v)&&y(e)})),i.a.useEffect((function(){var e=setTimeout((function(){return C()}),400);return function(){return clearTimeout(e)}}),[j.cards,j.tag]);var L=function(){In(e,{cardLoad:"tags",idRel:v[0],adminView:!0})},C=function(){var t=Object(Me.a)(Gh().mark((function t(){var r,n;return Gh().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new Promise((function(e,t){e(Object.keys(j.cards).filter((function(e){return j.cards&&j.cards[e]&&!j.cards[e].deleted&&(!_&&E&&E._id&&j.cards[e]&&j.cards[e]._users&&j.cards[e]._users[E._id]||_&&(k.owner||k&&k.plan&&k.planAdmin))&&v&&v.length>0&&v[0]&&j.tag&&j.tag.filter((function(e){return e.value===v[0]})).length>0&&j.cards&&j.cards[e]._tags&&j.cards[e]._tags.filter((function(e){return e.value===v[0]})).length>0&&(!j.cards[e].private||E&&E._id&&j.cards[e].private&&j.cards[e]._users&&j.cards[e]._users[E._id])})))})),t.next=3,r.then((function(e){return e}));case 3:(n=t.sent)&&(f(n),s(!1),e.onFinish&&e.onFinish());case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return i.a.createElement("div",{style:{width:"100%"}},l&&i.a.createElement("div",{style:{position:"absolute",bottom:0,left:"7px",right:"7px"}},i.a.createElement(Fo,null)),j.tag.filter((function(e){return e.value===v[0]})).length>0?i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},i.a.createElement("div",{style:Object(h.a)({position:"relative",padding:"5px 10px",borderRadius:"8px",width:"fit-content",display:"flex",alignItems:"center"},j.tag.filter((function(e){return e.value===v[0]})).length>0&&j.tag.filter((function(e){return e.value===v[0]}))[0].color?{backgroundColor:j.tag.filter((function(e){return e.value===v[0]}))[0].color,color:j.tag.filter((function(e){return e.value===v[0]}))[0].color?Et(j.tag.filter((function(e){return e.value===v[0]}))[0].color,!0):dt("menu")}:{})},i.a.createElement(kt,{size:"22px",color:j.tag.filter((function(e){return e.value===v[0]}))[0].color?Et(j.tag.filter((function(e){return e.value===v[0]}))[0].color,!0):dt("menu"),icon:"tag"}),i.a.createElement("span",{style:{marginLeft:"7px"}},j.tag.filter((function(e){return e.value===v[0]}))[0].label)),k&&k.plan&&k.planAdmin&&k.user&&k.userAdmin?i.a.createElement("div",null,i.a.createElement(At,{title:lt("$__adminMode"),text:lt("$__adminMode"),color:_?dt("menu"):"lightgrey",textColor:_?dt("menu"):"lightgrey",icon:"manage_accounts",onClick:function(){w((function(e){return!e}))},style:{marginLeft:15},size:"25px"})):i.a.createElement(i.a.Fragment,null)):i.a.createElement(i.a.Fragment,null),i.a.createElement("div",{style:{positin:"relative",width:"100%"}},i.a.createElement(vo,null,p.filter((function(t){return j.cards[t].type.indexOf("plan")>-1&&(!e.hidePrivate||e.hidePrivate&&!j.cards[t].private)})).length>0&&i.a.createElement(xo,{xs:12,sm:12,md:12,lg:12,xl:12},i.a.createElement(Io,{title:lt("$__plans",1),icon:S.filter((function(e){return"plan"===e.name}))[0].icon,color:dt("menu"),filterText:e.text,style:{padding:"7px"}}),i.a.createElement(vo,null,p.filter((function(t){return"plan"===j.cards[t].type&&(!e.hidePrivate||e.hidePrivate&&!j.cards[t].private)})).sort((function(e,t){return j.cards[e].name<j.cards[t].name?-1:j.cards[e].name>j.cards[t].name?1:0})).map((function(t,r){return i.a.createElement(xo,{key:t,xs:12,sm:6,md:4,lg:4,xl:3},i.a.createElement(oc,{db:"cards",data:j.cards[t],showConnectedIn:!0,showTags:!0,searchText:e.text,expanded:!0,onAction:e.onAction?function(){e.onAction()}:null}))})))),p.filter((function(t){return j.cards[t].type.indexOf("guideline")>-1&&(!e.hidePrivate||e.hidePrivate&&!j.cards[t].private)})).length>0&&i.a.createElement(xo,{xs:12,sm:12,md:12,lg:12,xl:12},i.a.createElement(Io,{title:lt("$__guidelines",1),icon:S.filter((function(e){return"guideline"===e.name}))[0].icon,color:dt("menu"),style:{padding:"7px"}}),i.a.createElement(vo,null,p.filter((function(t){return j.cards[t].type.indexOf("guideline")>-1&&(!e.hidePrivate||e.hidePrivate&&!j.cards[t].private)})).sort((function(e,t){return j.cards[e].name.toLowerCase()<j.cards[t].name.toLowerCase()?-1:j.cards[e].name.toLowerCase()<j.cards[t].name.toLowerCase()?1:0})).map((function(t,r){var n;return i.a.createElement(xo,{key:t,xs:12,sm:6,md:4,lg:4,xl:3},i.a.createElement(oc,(n={db:"cards",data:j.cards[t]},Object(O.a)(n,"db","cards"),Object(O.a)(n,"showConnectedIn",!0),Object(O.a)(n,"searchText",e.text),Object(O.a)(n,"expanded",!0),Object(O.a)(n,"onAction",e.onAction?function(){e.onAction()}:null),n)))})))),p.filter((function(t){return j.cards[t].type.indexOf("objective")>-1&&(!e.hidePrivate||e.hidePrivate&&!j.cards[t].private)})).length>0&&i.a.createElement(xo,{xs:12,sm:12,md:12,lg:12,xl:12},i.a.createElement(Io,{title:lt("$__objectives",1),icon:S.filter((function(e){return"objective"===e.name}))[0].icon,color:dt("menu"),style:{padding:"7px"}}),i.a.createElement(vo,null,p.filter((function(t){return j.cards[t].type.indexOf("objective")>-1&&(!e.hidePrivate||e.hidePrivate&&!j.cards[t].private)})).sort((function(e,t){return j.cards[e].name.toLowerCase()<j.cards[t].name.toLowerCase()?-1:j.cards[e].name.toLowerCase()<j.cards[t].name.toLowerCase()?1:0})).map((function(t,r){var n;return i.a.createElement(xo,{key:t,xs:12,sm:6,md:4,lg:4,xl:3},i.a.createElement(oc,(n={db:"cards",data:j.cards[t]},Object(O.a)(n,"db","cards"),Object(O.a)(n,"showConnectedIn",!0),Object(O.a)(n,"searchText",e.text),Object(O.a)(n,"expanded",!0),Object(O.a)(n,"onAction",e.onAction?function(){e.onAction()}:null),n)))})))),p.filter((function(t){return j.cards[t].type.indexOf("goal")>-1&&(!e.hidePrivate||e.hidePrivate&&!j.cards[t].private)})).length>0&&i.a.createElement(xo,{xs:12,sm:12,md:12,lg:12,xl:12},i.a.createElement(Io,{title:lt("$__goals",1),icon:S.filter((function(e){return"goal"===e.name}))[0].icon,color:dt("menu"),style:{padding:"7px"}}),i.a.createElement(vo,null,p.filter((function(t){return j.cards[t].type.indexOf("goal")>-1&&(!e.hidePrivate||e.hidePrivate&&!j.cards[t].private)})).sort((function(e,t){return j.cards[e].name.toLowerCase()<j.cards[t].name.toLowerCase()?-1:j.cards[e].name.toLowerCase()<j.cards[t].name.toLowerCase()?1:0})).map((function(t,r){var n;return i.a.createElement(xo,{key:t,xs:12,sm:6,md:4,lg:4,xl:3},i.a.createElement(oc,(n={db:"cards",data:j.cards[t]},Object(O.a)(n,"db","cards"),Object(O.a)(n,"showConnectedIn",!0),Object(O.a)(n,"searchText",e.text),Object(O.a)(n,"expanded",!0),Object(O.a)(n,"onAction",e.onAction?function(){e.onAction()}:null),n)))})))),p.filter((function(t){return S.filter((function(e){return e.name===j.cards[t].type})).length>0&&S.filter((function(e){return e.name===j.cards[t].type}))[0]&&"objective"!==j.cards[t].type&&"goal"!==j.cards[t].type&&"plan"!==j.cards[t].type&&"chatGroup"!==j.cards[t].type&&"link"!==j.cards[t].type&&"insight"!==j.cards[t].type&&-1===j.cards[t].type.indexOf("guideline")&&(!e.hidePrivate||e.hidePrivate&&!j.cards[t].private)})).length>0&&i.a.createElement(xo,{xs:12,sm:12,md:12,lg:12,xl:12},i.a.createElement(Io,{title:lt("$__actions",1),icon:"double_arrow",color:dt("menu"),style:{padding:"7px"}}),i.a.createElement(vo,null,p.filter((function(t){return S.filter((function(e){return e.name===j.cards[t].type})).length>0&&S.filter((function(e){return e.name===j.cards[t].type}))[0]&&"objective"!==j.cards[t].type&&"goal"!==j.cards[t].type&&"plan"!==j.cards[t].type&&"chatGroup"!==j.cards[t].type&&"link"!==j.cards[t].type&&"insight"!==j.cards[t].type&&-1===j.cards[t].type.indexOf("guideline")&&(!e.hidePrivate||e.hidePrivate&&!j.cards[t].private)})).sort((function(e,t){return j.cards[e].name.toLowerCase()<j.cards[t].name.toLowerCase()?-1:j.cards[e].name.toLowerCase()<j.cards[t].name.toLowerCase()?1:0})).map((function(t,r){return i.a.createElement(xo,{key:t,xs:12,sm:6,md:4,lg:4,xl:3},i.a.createElement(oc,{db:"cards",data:j.cards[t],showConnectedIn:!0,searchText:e.text,expanded:!0,onAction:e.onAction?function(){e.onAction()}:null}))})))),p.filter((function(e){return"insight"===j.cards[e].type||"link"===j.cards[e].type})).length>0&&i.a.createElement(xo,{xs:12,sm:12,md:12,lg:12,xl:12},i.a.createElement(Io,{title:"BRIGHT & CONNECTED",icon:U.a,color:dt("menu"),style:{padding:"7px"}}),i.a.createElement(vo,null,p.filter((function(e){return"insight"===j.cards[e].type||"link"===j.cards[e].type})).sort((function(e,t){return j.cards[e].name.toLowerCase()<j.cards[t].name.toLowerCase()?-1:j.cards[e].name.toLowerCase()<j.cards[t].name.toLowerCase()?1:0})).map((function(t,r){return i.a.createElement(xo,{key:t,xs:12,sm:6,md:4,lg:4,xl:3},i.a.createElement(oc,{db:"cards",data:j.cards[t],showConnectedIn:!0,expanded:!0,Avatar:!0,Resume:!0,onAction:e.onAction?function(){e.onAction()}:null}))})))))))})));var Hh=Object($e.b)((function(e){return{store:e}}),(function(e){return Object(u.b)(n,e)}))((function(e){return i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"calc(100vh - 115px)"}},e.provisorio||"N\xe3o Autorizado")})),Wh={root:{}};function Uh(){var e=De.getState().db.users;return{maxUsers:De.getState().session.maxUsers&&De.getState().session.maxUsers.low||0,usedUsers:Object.keys(e).filter((function(t){if(!e[t].deleted&&"user"===e[t].type&&(!e[t]._parent||e[t]._parent&&e[e[t]._parent]))return!0})).length}}var Vh=Object($e.b)((function(e){return{users:e.db.users,page:e.db.history}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Wh)((function(e){var t=i.a.useState([]),r=Object(Be.a)(t,2),n=r[0],a=r[1],o=De.getState(),c=o.db,l=(o.session,o.search),u=c.users,d=xt();Uh(),i.a.useEffect((function(){var e=window.location.hash.split("/");e[0]=e[0].replace("#",""),JSON.stringify(e)!==JSON.stringify(n)&&a(e)}));var p=Object.keys(u).filter((function(e){return!u[e].deleted})).map((function(e){return u[e]}));l.text&&(p=p.filter((function(e){return!!(e.name&&e.name.toLowerCase().indexOf(l.text.toLowerCase())>-1||e.name&&e.name.toLowerCase().indexOf(l.text.toLowerCase())>-1||e.email&&e.email.toLowerCase().indexOf(l.text.toLowerCase())>-1)})).map((function(e){return e}))),"tab"===n[0]&&"users"===n[1]&&(p=p.filter((function(e){return"user"===e.type&&!e._parent})).map((function(e){return e}))),"tab"===n[0]&&"units"===n[1]&&(p=p.filter((function(e){return"user"!==e.type})).map((function(e){return e}))),l.users&&l.users.userGroup.length>0&&(p=p.filter((function(e){return e.groups.filter((function(e){return e.value===l.users.userGroup[0].value})).length>0})).map((function(e){return e}))),l.tags.length>0&&(p=p.filter((function(e){return e.tags&&e.tags.length>0&&e.tags.filter((function(e){var t=!1;return l.tags.map((function(r){r.value===e.value&&(t=!0)})),t})).length>0})).map((function(e){return e}))),l.userGroups.length>0&&(p=p.filter((function(e){return e.groups&&e.groups.length>0&&e.groups.filter((function(e){var t=!1;return l.userGroups.map((function(r){r.value===e.value&&(t=!0)})),t})).length>0})).map((function(e){return e})));var f=Object.keys(u).map((function(e){return u[e]}));return l.text&&(f=f.filter((function(e){return!!(e.name&&e.name.toLowerCase().indexOf(l.text.toLowerCase())>-1||e.name&&e.name.toLowerCase().indexOf(l.text.toLowerCase())>-1||e.email&&e.email.toLowerCase().indexOf(l.text.toLowerCase())>-1)})).map((function(e){return e}))),"tab"===n[0]&&"units"===n[1]&&n[2]&&36===n[2].length&&(f=f.filter((function(e){return"user"===e.type&&e._parent===n[2]})).map((function(e){return e}))),l.users&&l.users.userGroup.length>0&&(f=f.filter((function(e){return e.groups.filter((function(e){return e.value===l.users.userGroup[0].value})).length>0})).map((function(e){return e}))),l.tags.length>0&&(f=f.filter((function(e){return e.tags&&e.tags.length>0&&e.tags.filter((function(e){var t=!1;return l.tags.map((function(r){r.value===e.value&&(t=!0)})),t})).length>0})).map((function(e){return e}))),l.userGroups.length>0&&(f=f.filter((function(e){return e.groups&&e.groups.length>0&&e.groups.filter((function(e){var t=!1;return l.userGroups.map((function(r){r.value===e.value&&(t=!0)})),t})).length>0})).map((function(e){return e}))),!d||d.owner||d.user?(window.location.hash.split("/")[0].replace("#","")||s.push("c#tab/units"),i.a.createElement("div",null,i.a.createElement(md,null),i.a.createElement("div",{style:{marginLeft:"-30px",width:"calc(100% + 30px)"}},i.a.createElement(yd,null),i.a.createElement(vo,null,p.sort((function(e,t){return e&&e.name&&e.name<t.name||u&&e&&e.name&&e.name<t.name?-1:1})).map((function(e,t){return!n[2]||n[2]&&e._id===n[2]?i.a.createElement(xo,{key:e._id,xs:12,sm:n[1]&&n[2]&&"units"===n[1]&&36===n[2].length&&c.users[n[2]]?12:6,md:n[1]&&n[2]&&"units"===n[1]&&36===n[2].length&&c.users[n[2]]?12:4,lg:n[1]&&n[2]&&"units"===n[1]&&36===n[2].length&&c.users[n[2]]?12:4,xl:n[1]&&n[2]&&"units"===n[1]&&36===n[2].length&&c.users[n[2]]?12:3,style:{minWidth:"300px"}},i.a.createElement($h,{data:e,expanded:!!(n[1]&&n[2]&&"units"===n[1]&&36===n[2].length&&c.users[n[2]])})):!n[2]&&i.a.createElement(xo,{key:e._id,xs:12,sm:n[1]&&n[2]&&"units"===n[1]&&36===n[2].length&&c.users[n[2]]?12:6,md:n[1]&&n[2]&&"units"===n[1]&&36===n[2].length&&c.users[n[2]]?12:4,lg:n[1]&&n[2]&&"units"===n[1]&&36===n[2].length&&c.users[n[2]]?12:3,xl:n[1]&&n[2]&&"units"===n[1]&&36===n[2].length&&c.users[n[2]]?12:3},i.a.createElement($h,{data:e,expanded:!!(n[1]&&n[2]&&"units"===n[1]&&36===n[2].length&&c.users[n[2]])}))})),"tab"===n[0]&&"units"===n[1]&&n[2]&&36===n[2].length&&f.filter((function(e){return!e.deleted})).sort((function(e,t){return e&&e.name&&e.name<t.name||u&&e&&e.name&&e.name<t.name?-1:1})).map((function(e,t){return i.a.createElement(xo,{key:"".concat(e._id,"-").concat(t),xs:12,sm:6,md:4,lg:3,xl:2},i.a.createElement($h,{data:e}))})))))):i.a.createElement(Hh,null)}))),qh=Object(Lt.a)({clearfix:{"&:after,&:before":{display:"table",content:'" "'},"&:after":{clear:"both"}}});function Xh(){var e=qh();return i.a.createElement("div",{className:e.clearfix})}var Jh={cardIcon:{"&$warningCardHeader,&$successCardHeader,&$dangerCardHeader,&$infoCardHeader,&$primaryCardHeader,&$roseCardHeader,&$customCardHeader":{borderRadius:"3px",backgroundColor:sr[0],padding:"7px",marginTop:"-20px",marginRight:"15px",float:"left"}},warningCardHeader:vr,successCardHeader:yr,dangerCardHeader:br,infoCardHeader:xr,primaryCardHeader:_r,roseCardHeader:wr,customCardHeader:{}};Object(Lt.a)(Jh);var Kh={cardAvatar:{"&$cardAvatarProfile img,&$cardAvatarTestimonial img":{width:"100%",height:"auto"}},cardAvatarProfile:{maxWidth:"130px",maxHeight:"130px",margin:"-50px auto 0",borderRadius:"50%",overflow:"hidden",padding:"0",boxShadow:"0 16px 38px -12px rgba("+Zt("#000")+", 0.56), 0 4px 25px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt("#000")+", 0.2)","&$cardAvatarPlain":{marginTop:"0"}},cardAvatarPlain:{},cardAvatarTestimonial:{margin:"-50px auto 0",maxWidth:"100px",maxHeight:"100px",borderRadius:"50%",overflow:"hidden",padding:"0",boxShadow:"0 16px 38px -12px rgba("+Zt("#000")+", 0.56), 0 4px 25px 0px rgba("+Zt("#000")+", 0.12), 0 8px 10px -5px rgba("+Zt("#000")+", 0.2)","&$cardAvatarPlain":{marginTop:"0"}},cardAvatarTestimonialFooter:{marginBottom:"-50px",marginTop:"10px"}},Zh=["children","className","plain","profile","testimonial","testimonialFooter"],Qh=Object(Lt.a)(Kh);function em(e){var t,r=Qh(),n=e.children,a=e.className,o=e.plain,c=e.profile,l=e.testimonial,s=e.testimonialFooter,u=Object(Kt.a)(e,Zh),d=We()((t={},Object(O.a)(t,r.cardAvatar,!0),Object(O.a)(t,r.cardAvatarProfile,c),Object(O.a)(t,r.cardAvatarPlain,o),Object(O.a)(t,r.cardAvatarTestimonial,l),Object(O.a)(t,r.cardAvatarTestimonialFooter,s),Object(O.a)(t,a,void 0!==a),t));return i.a.createElement("div",Object.assign({className:d},u),n)}var tm={cardTitle:jr,cardIconTitle:Object(h.a)(Object(h.a)({},jr),{},{marginTop:"15px",marginBottom:0,"& small":{fontSize:"80%",fontWeight:"400"}}),cardCategory:{marginTop:"10px",color:sr[0]+" !important",textAlign:"center"},description:{color:sr[0]},updateProfileButton:{float:"right"}},rm=Object(Lt.a)(tm);Object($e.b)((function(e){return{}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=rm();return i.a.createElement("div",{style:{position:"relative",width:"calc(100% - 7px)"}},i.a.createElement(vo,null,i.a.createElement("div",{style:{position:"relative",width:"100%",boxShadow:"0px -2px 5px 2px rgba(0,0,0,0.1)",height:150,backgroundColor:"black",borderTopRightRadius:11,borderTopLeftRadius:11,backgroundPosition:"center center",backgroundSize:"cover",marginBottom:"-15px"}}),i.a.createElement(xo,{xs:12,sm:12,md:8},i.a.createElement($s,null,i.a.createElement(Ys,null,i.a.createElement(vo,null,i.a.createElement(xo,{xs:12,sm:12,md:5},i.a.createElement(Yu,{labelText:"Company (disabled)",id:"company-disabled",formControlProps:{fullWidth:!0},inputProps:{disabled:!0}})),i.a.createElement(xo,{xs:12,sm:12,md:3},i.a.createElement(Yu,{labelText:"Username",id:"username",formControlProps:{fullWidth:!0}})),i.a.createElement(xo,{xs:12,sm:12,md:4},i.a.createElement(Yu,{labelText:"Email address",id:"email-address",formControlProps:{fullWidth:!0}}))),i.a.createElement(vo,null,i.a.createElement(xo,{xs:12,sm:12,md:6},i.a.createElement(Yu,{labelText:"First Name",id:"first-name",formControlProps:{fullWidth:!0}})),i.a.createElement(xo,{xs:12,sm:12,md:6},i.a.createElement(Yu,{labelText:"Last Name",id:"last-name",formControlProps:{fullWidth:!0}}))),i.a.createElement(vo,null,i.a.createElement(xo,{xs:12,sm:12,md:4},i.a.createElement(Yu,{labelText:"City",id:"city",formControlProps:{fullWidth:!0}})),i.a.createElement(xo,{xs:12,sm:12,md:4},i.a.createElement(Yu,{labelText:"Country",id:"country",formControlProps:{fullWidth:!0}})),i.a.createElement(xo,{xs:12,sm:12,md:4},i.a.createElement(Yu,{labelText:"Postal Code",id:"postal-code",formControlProps:{fullWidth:!0}}))),i.a.createElement(vo,null,i.a.createElement(xo,{xs:12,sm:12,md:12},i.a.createElement(Au.a,{style:{color:"#AAAAAA"}},"About me"),i.a.createElement(Yu,{labelText:"Lamborghini Mercy, Your chick she so thirsty, I'm in that two seat Lambo.",id:"about-me",formControlProps:{fullWidth:!0},inputProps:{multiline:!0,rows:5}}))),i.a.createElement(Cr,{color:"rose",className:t.updateProfileButton},"Update Profile"),i.a.createElement(Xh,null)))),i.a.createElement(xo,{xs:12,sm:12,md:4},i.a.createElement($s,{db:"cards",profile:!0},i.a.createElement(em,{profile:!0},i.a.createElement("a",{href:"#pablo",onClick:function(e){return e.preventDefault()}})),i.a.createElement(Ys,{profile:!0},i.a.createElement("h6",{className:t.cardCategory},"CEO / CO-FOUNDER"),i.a.createElement("h4",{className:t.cardTitle},"Alec Thompson"),i.a.createElement("p",{className:t.description},"Don","'","t be scared of the truth because we need to restart the human foundation in truth And I love you like Kanye loves Kanye I love Rick Owens\u2019 bed design but the back is..."),i.a.createElement(Cr,{color:"rose",round:!0},"Follow"))))))}));var nm=r(1e3);r(907);var am=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(pl)((function(e){De.getState().functions.socket;var t=i.a.useState({cvc:"",expiry:"",focus:"",name:"",number:""}),r=Object(Be.a)(t,2),n=r[0],a=r[1];return xt(),i.a.createElement("div",null,i.a.createElement(nm.a,{cvc:n.cvc,expiry:n.expiry,focused:n.focus,name:n.name,number:n.number}),i.a.createElement("fieldset",{style:{wordBreak:"break-word"}},i.a.createElement("legend",null,lt("$__paymentPreffer")),i.a.createElement("div",{style:{borderRadius:15,background:dt("ColumnTitleColor"),color:"#FFFFFF",boxShadow:"0 0 3px 7px rgba(0,0,0,0.03)",padding:15}}),i.a.createElement(La,{id:"sideModule_user_displayName",label:lt("$__displayName",1),variant:dt("fieldVariant"),name:"number",InputProps:{autoComplete:"new-password",multiline:!0,endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"view_comfy_ind"})),onChange:function(e){a(Object(h.a)(Object(h.a)({},n),{},Object(O.a)({},"number",e.target.value)))}},value:n&&n.number?n.number:"",placeholder:lt("$__cardNumber",1)})),i.a.createElement("fieldset",{style:{wordBreak:"break-word"}},i.a.createElement("legend",null,lt("$__forceChangePassword")),i.a.createElement(vi,{checked:!!(n&&n._access&&n._access.user),onChange:function(e){},name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__forceChangePasswordDescription")))})));function om(){om=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var im=Object($e.b)((function(e){return{history:e.db.history}}),(function(e){return Object(u.b)(n,e)}))(Object(o.memo)((function(e){var t=function(){var e=Object(Me.a)(om().mark((function e(){return om().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:De.getState().functions.socket.emit("data",{module:"galaxPay",method:"post",action:"integration"},{action:"reqData",accountData:De.getState().session.GlobalData},(function(e){console.log(e),e.error&&(console.log("companyDataError",e.error),console.log(e))}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return i.a.createElement("div",null,i.a.createElement(am,null),i.a.createElement("div",{style:{padding:15,backgroundColor:"black"},onClick:function(){t()}},"TEST"))})));var cm=Object($e.b)((function(e){return{history:e.db.history}}),(function(e){return Object(u.b)(n,e)}))(Object(o.memo)((function(e){i.a.useEffect((function(){console.log("StrategyAndPlans")}),[]),i.a.useEffect((function(){var e=setTimeout((function(){document.getElementById("mainPannel").scrollTo(0,0)}),100);return function(){clearTimeout(e)}}),[e.history]);var t=window.location.hash.split("/");return t[0]=t[0].replace("#",""),window.location.hash.split("/")[0].replace("#","")||s.push("sp#tab/home"),t[0]&&36===t[0].length&&!De.getState().db.cards[t[0]]&&s.push("/deniedAccess"),i.a.createElement("div",null,"integration")}))),lm=r(291),sm=r(75),um=r(292),dm=r.n(um),pm=r(293),fm=r.n(pm);r(1607);function hm(){hm=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}r(168).config();var mm=Object($e.b)((function(e){return{history:e.db.history}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.session,n=(t.db,i.a.useState({})),a=Object(Be.a)(n,2),o=a[0],c=a[1],l=i.a.useState(r.GlobalData?r.GlobalData:{}),s=Object(Be.a)(l,2),u=s[0],d=s[1],p=i.a.useState({historyEditor:null}),f=Object(Be.a)(p,2),m=f[0],g=f[1];i.a.useEffect((function(){c(r.GlobalData?r.GlobalData:{}),d(r.GlobalData?r.GlobalData:{});var e=sm.EditorState.createEmpty(),t=sm.EditorState.createEmpty(),n=sm.EditorState.createEmpty(),a=sm.EditorState.createEmpty(),o=sm.EditorState.createEmpty(),i=sm.EditorState.createEmpty();r.GlobalData.history&&(e=fm()("<div>".concat(r.GlobalData.history,"</div>")),e=sm.ContentState.createFromBlockArray(e.contentBlocks),e=sm.EditorState.createWithContent(e)),r.GlobalData.strategicStatement&&(o=fm()("<div>".concat(r.GlobalData.strategicStatement,"</div>")),o=sm.ContentState.createFromBlockArray(o.contentBlocks),o=sm.EditorState.createWithContent(o)),r.GlobalData.values&&(i=fm()("<div>".concat(r.GlobalData.values,"</div>")),i=sm.ContentState.createFromBlockArray(i.contentBlocks),i=sm.EditorState.createWithContent(i)),r.GlobalData.vocation&&(t=fm()("<div>".concat(r.GlobalData.vocation,"</div>")),t=sm.ContentState.createFromBlockArray(t.contentBlocks),t=sm.EditorState.createWithContent(t)),r.GlobalData.legacy&&(n=fm()("<div>".concat(r.GlobalData.legacy,"</div>")),n=sm.ContentState.createFromBlockArray(n.contentBlocks),n=sm.EditorState.createWithContent(n)),r.GlobalData.message&&(a=fm()("<div>".concat(r.GlobalData.message,"</div>")),a=sm.ContentState.createFromBlockArray(a.contentBlocks),a=sm.EditorState.createWithContent(a)),g({history:e,vocation:t,legacy:n,message:a,values:i,strategicStatement:o})}),[]);var v=function(){var t=Object(Me.a)(hm().mark((function t(){var r;return hm().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r={},Object.keys(o).map((function(e){!o[e]||u[e]&&JSON.stringify({a:o[e]})===JSON.stringify({a:u[e]})||(r=Object(h.a)(Object(h.a)({},r),{},Object(O.a)({},e,o[e]&&"string"===typeof o[e]?o[e].trim():o[e])))}));try{De.getState().functions.socket.emit("data",{module:"account",method:"post",action:"save"},r,(function(t){t.error?console.log("companyDataError",t.error):e.reduxFunction("ASYNC","SET_SESSION",Object(h.a)(Object(h.a)({},De.getState().session),{},{GlobalData:Object(h.a)(Object(h.a)({},De.getState().session.GlobalData),r)}))})),c(Object(h.a)(Object(h.a)({},De.getState().session.GlobalData),r)),d(Object(h.a)(Object(h.a)({},De.getState().session.GlobalData),r))}catch(n){console.log(n)}case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return i.a.createElement("div",null,i.a.createElement(vo,{style:{marginTop:15}},i.a.createElement(xo,{xs:12,sm:12,md:6,lg:6,xl:6,style:{marginBottom:33}},i.a.createElement("div",{style:{padding:7,width:"100%",backgroundColor:"#FFFFFF",borderRadius:2,boxShadow:"0px 0px 7px 5px rgba(0,0,0,0.03)"}},i.a.createElement("div",null,lt("$__adminMessage")),console.log(m.message),i.a.createElement(Ut,null,i.a.createElement(lm.Editor,{toolbar:{options:["inline","blockType","fontSize","fontFamily","list","textAlign","colorPicker","link","emoji","image","remove","history"],inline:{inDropdown:!1,options:["bold","italic"]}},editorState:m.message,onEditorStateChange:function(e){c(Object(h.a)(Object(h.a)({},o),{},{message:dm()(Object(sm.convertToRaw)(e.getCurrentContent()))})),g(Object(h.a)(Object(h.a)({},m),{},{message:e}))},hashtag:{separator:" ",trigger:"#"},editorStyle:{minHeight:150}})))),i.a.createElement(xo,{xs:12,sm:12,md:6,lg:6,xl:6,style:{marginBottom:33}},i.a.createElement("div",{style:{padding:7,width:"100%",backgroundColor:"#FFFFFF",borderRadius:2,boxShadow:"0px 0px 7px 5px rgba(0,0,0,0.03)"}},i.a.createElement("div",null,lt("$__strategicStatement")),i.a.createElement(Ut,null,i.a.createElement(lm.Editor,{toolbar:{options:["inline","blockType","fontSize","fontFamily","list","textAlign","colorPicker","link","emoji","image","remove","history"],inline:{inDropdown:!1,options:["bold","italic"]}},editorState:m.strategicStatement,onEditorStateChange:function(e){c(Object(h.a)(Object(h.a)({},o),{},{strategicStatement:dm()(Object(sm.convertToRaw)(e.getCurrentContent()))})),g(Object(h.a)(Object(h.a)({},m),{},{strategicStatement:e}))},hashtag:{separator:" ",trigger:"#"},editorStyle:{minHeight:150}})))),i.a.createElement(xo,{xs:12,sm:12,md:6,lg:6,xl:6,style:{marginBottom:33}},i.a.createElement("div",{style:{padding:7,width:"100%",backgroundColor:"#FFFFFF",borderRadius:2,boxShadow:"0px 0px 7px 5px rgba(0,0,0,0.03)"}},i.a.createElement("div",null,lt("$__vocation")),i.a.createElement(Ut,null,i.a.createElement(lm.Editor,{toolbar:{options:["inline","blockType","fontSize","fontFamily","list","textAlign","colorPicker","link","emoji","image","remove","history"],inline:{inDropdown:!1,options:["bold","italic"]}},editorState:m.vocation,onEditorStateChange:function(e){c(Object(h.a)(Object(h.a)({},o),{},{vocation:dm()(Object(sm.convertToRaw)(e.getCurrentContent()))})),g(Object(h.a)(Object(h.a)({},m),{},{vocation:e}))},hashtag:{separator:" ",trigger:"#"},editorStyle:{minHeight:150}})))),i.a.createElement(xo,{xs:12,sm:12,md:6,lg:6,xl:6,style:{marginBottom:33}},i.a.createElement("div",{style:{padding:7,width:"100%",backgroundColor:"#FFFFFF",borderRadius:2,boxShadow:"0px 0px 7px 5px rgba(0,0,0,0.03)"}},i.a.createElement("div",null,lt("$__history")),i.a.createElement(Ut,null,i.a.createElement(lm.Editor,{toolbar:{options:["inline","blockType","fontSize","fontFamily","list","textAlign","colorPicker","link","emoji","image","remove","history"],inline:{inDropdown:!1,options:["bold","italic"]}},editorState:m.history,onEditorStateChange:function(e){c(Object(h.a)(Object(h.a)({},o),{},{history:dm()(Object(sm.convertToRaw)(e.getCurrentContent()))})),g(Object(h.a)(Object(h.a)({},m),{},{history:e}))},hashtag:{separator:" ",trigger:"#"},editorStyle:{minHeight:150}})))),i.a.createElement(xo,{xs:12,sm:12,md:6,lg:6,xl:6,style:{marginBottom:33}},i.a.createElement("div",{style:{padding:7,width:"100%",backgroundColor:"#FFFFFF",borderRadius:2,boxShadow:"0px 0px 7px 5px rgba(0,0,0,0.03)"}},i.a.createElement("div",null,lt("$__values")),i.a.createElement(Ut,null,i.a.createElement(lm.Editor,{toolbar:{options:["inline","blockType","fontSize","fontFamily","list","textAlign","colorPicker","link","emoji","image","remove","history"],inline:{inDropdown:!1,options:["bold","italic"]}},editorState:m.values,onEditorStateChange:function(e){c(Object(h.a)(Object(h.a)({},o),{},{values:dm()(Object(sm.convertToRaw)(e.getCurrentContent()))})),g(Object(h.a)(Object(h.a)({},m),{},{values:e}))},hashtag:{separator:" ",trigger:"#"},editorStyle:{minHeight:150}})))),i.a.createElement(xo,{xs:12,sm:12,md:6,lg:6,xl:6,style:{marginBottom:33}},i.a.createElement("div",{style:{padding:7,width:"100%",backgroundColor:"#FFFFFF",borderRadius:2,boxShadow:"0px 0px 7px 5px rgba(0,0,0,0.03)"}},i.a.createElement("div",null,lt("$__legacy")),i.a.createElement(Ut,null,i.a.createElement(lm.Editor,{toolbar:{options:["inline","blockType","fontSize","fontFamily","list","textAlign","colorPicker","link","emoji","image","remove","history"],inline:{inDropdown:!1,options:["bold","italic"]}},editorState:m.legacy,onEditorStateChange:function(e){c(Object(h.a)(Object(h.a)({},o),{},{legacy:dm()(Object(sm.convertToRaw)(e.getCurrentContent()))})),g(Object(h.a)(Object(h.a)({},m),{},{legacy:e}))},style:{minHeight:150},hashtag:{separator:" ",trigger:"#"},editorStyle:{minHeight:150}}))))),JSON.stringify(o)!==JSON.stringify(u)?i.a.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},i.a.createElement(At,{title:lt("$__save"),text:lt("$__save"),color:"green",icon:"save",size:"25px",onClick:function(){v()}})):i.a.createElement(i.a.Fragment,null))}));function gm(e){return i.a.createElement("div",{style:{position:"relative",height:5,backgroundColor:"lightgray",width:"100%",overflow:"hidden",borderRadius:3,boxShadow:"0 0 0 2px rgba(0,0,0,0.05)"}},i.a.createElement("div",{style:{position:"absolute",top:1,left:1,bottom:1,width:"calc(".concat(e.value?e.value:0,"% - 2px)"),overflow:"hidden",background:"".concat(e.background?e.background:dt("ColumnTitleColor")),borderRadius:3,boxShadow:"0 0 0 2px rgba(0,0,0,0.05)"}}))}var vm=r(553);function ym(){ym=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var bm=Object($e.b)((function(e){return{session:e.session}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(ll)((function(e){e.classes;var t=De.getState(),r=t.db,n=t.session,a=(r.users,r.dataType,i.a.useState(n.GlobalData?n.GlobalData:{})),o=Object(Be.a)(a,2),c=o[0],l=o[1],s=i.a.useState(n.GlobalData?n.GlobalData:{}),u=Object(Be.a)(s,2),d=u[0],p=u[1],f=i.a.useState(!pt(c&&c.email?c.email:"")),m=Object(Be.a)(f,2),g=(m[0],m[1],i.a.useState(!1)),v=Object(Be.a)(g,2),y=(v[0],v[1],xt()),b=function(){var t=Object(Me.a)(ym().mark((function t(){var r,a,o,i;return ym().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r={},Object.keys(c).map((function(e){if("file"===e)a=c[e];else if("document"===e){var t=!1;11===c[e].length&&vm.b.isValid(c[e])&&(t=!0),14===c[e].length&&vm.a.isValid(c[e])&&(t=!0),t?r=Object(h.a)(Object(h.a)({},r),{},Object(O.a)({},e,c[e]&&"string"===typeof c[e]?c[e].trim():c[e])):ft({message:"".concat(lt("$__".concat(e)),": ").concat(lt("$__invalidDocument")),variant:"warning",persist:!1,horizontal:"right",confirm:null})}else!c[e]||d[e]&&JSON.stringify({a:c[e]})===JSON.stringify({a:d[e]})?c[e]||"_id"===e||ft({message:"".concat(lt("$__".concat(e)),": ").concat(lt("$__cantBeEmpty")),variant:"warning",persist:!1,horizontal:"right",confirm:null}):r=Object(h.a)(Object(h.a)({},r),{},Object(O.a)({},e,c[e]&&"string"===typeof c[e]?c[e].trim():c[e]))})),t.prev=2,o=De.getState().functions.socket,!a){t.next=10;break}return t.next=7,Ln(n.account,a);case 7:t.t0=t.sent,t.next=11;break;case 10:t.t0=!0;case 11:(i=t.t0)&&("true"!==String(i)&&(r=Object(h.a)(Object(h.a)({},r),{},{image:i})),o.emit("data",{module:"account",method:"post",action:"save"},r,(function(t){t.error?console.log("companyDataError",t.error):(e.reduxFunction("ASYNC","SET_SESSION",Object(h.a)(Object(h.a)({},De.getState().session),{},{GlobalData:Object(h.a)(Object(h.a)({},De.getState().session.GlobalData),r)})),p(Object(h.a)(Object(h.a)({},De.getState().session.GlobalData),r)))}))),t.next=18;break;case 15:t.prev=15,t.t1=t.catch(2),console.log(t.t1);case 18:case"end":return t.stop()}}),t,null,[[2,15]])})));return function(){return t.apply(this,arguments)}}();return(c._id===n._id||y&&y.user&&(y.userAdmin||y.userEdit))&&!0,c.independentAccount&&!1,i.a.createElement("div",null,i.a.createElement("div",{id:"sideModule_user_foto"},i.a.createElement(Zi,{maxWidthOrHeight:600,img:c&&c.image?c.image:null,onChange:function(e,t){l(Object(h.a)(Object(h.a)({},c),{},{file:t}))},avatar:!0,avatarIcon:"business"})),i.a.createElement(La,{id:"sideModule_user_fullName",label:lt("$__fullCompanyName",1),variant:dt("fieldVariant"),name:"fullName",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"business"})),onChange:function(e){l(Object(h.a)(Object(h.a)({},c),{},{fullName:e.target.value}))},onBlur:function(e){if(c&&!c.fullName){var t=e.target.value?"".concat(e.target.value.split(" ")[0]," ").concat(e.target.value.split(" ")[1]?e.target.value.split(" ")[1]:""):"";l(Object(h.a)(Object(h.a)({},c),{},{fullName:t}))}}},value:c&&c.fullName?c.fullName:"",placeholder:lt("$__fullName",1),autoFocus:!0,disabled:!0}),i.a.createElement(La,{id:"sideModule_user_displayName",label:lt("$__displayName",1),variant:dt("fieldVariant"),name:"name",InputProps:{autoComplete:"new-password",multiline:!0,endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"view_comfy_ind"})),onChange:function(e){l(Object(h.a)(Object(h.a)({},c),{},{name:e.target.value}))}},value:c&&c.name?c.name:"",placeholder:lt("$__displayName",1),disabled:!0}),i.a.createElement(La,{id:"customURL",label:lt("$__customURL",1),variant:dt("fieldVariant"),name:"customURL",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement("span",{style:{color:"gray",fontSize:12}},".machen.ai")),onChange:function(e){l(Object(h.a)(Object(h.a)({},c),{},{customURL:e.target.value.trim()}))},onBlur:function(e){c&&!c.fullName&&l(Object(h.a)(Object(h.a)({},c),{},{customURL:e.target.value.trim()}))}},value:c&&c.customURL?c.customURL:"",placeholder:lt("$__customURL",1),autoFocus:!0}),i.a.createElement(La,{id:"__documentCPForCNPJ",label:lt("$__documentCPForCNPJ",1),variant:dt("fieldVariant"),name:"document",InputProps:{autoComplete:"new-password",multiline:!0,endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"view_comfy_ind"})),onChange:function(e){l(Object(h.a)(Object(h.a)({},c),{},{document:e.target.value}))}},value:c&&c.document?c.document:"",placeholder:lt("$__displayName",1),disabled:!!d.document}),i.a.createElement("fieldset",null,i.a.createElement("legend",null,lt("$__accountResponsible")),i.a.createElement(Ut,null,i.a.createElement(ei,{includeMe:!0,admins:!0,avatarSize:"33px",permission:!0,noLimit:!0,selected:c.accountResponsible?[c.accountResponsible]:null,onSelect:function(e){l(Object(h.a)(Object(h.a)({},c),{},{accountResponsible:e[0]}))}}))),i.a.createElement("fieldset",null,i.a.createElement("legend",null,lt("$__invoiceResponsible")),i.a.createElement(Ut,null,i.a.createElement(ei,{includeMe:!0,admins:!0,avatarSize:"33px",permission:!0,noLimit:!0,selected:c.invoiceResponsible?[c.invoiceResponsible]:null,onSelect:function(e){l(Object(h.a)(Object(h.a)({},c),{},{invoiceResponsible:e[0]}))}}))),i.a.createElement("ul",{style:{color:dt("color")}},i.a.createElement("li",null,lt("$__createdAt"),": ",Ot(c.created_at)),c.expire_at?i.a.createElement("li",{style:{color:dt("menu")}},lt("$__expireDate"),": ",Ot(c.expire_at)):i.a.createElement(i.a.Fragment,null)),JSON.stringify(c)!==JSON.stringify(d)?i.a.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},i.a.createElement(At,{title:lt("$__save"),text:lt("$__save"),color:"green",icon:"save",size:"25px",onClick:function(){b()}})):i.a.createElement(i.a.Fragment,null))})));function xm(){xm=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var _m=Object($e.b)((function(e,t){return{session:e.session}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(pl)((function(e){e.classes;var t=De.getState(),r=t.session,n=(t.functions,t.db),a=i.a.useState(r.GlobalData?r.GlobalData:{}),o=Object(Be.a)(a,2),c=o[0],l=o[1],s=i.a.useState(r.GlobalData?r.GlobalData:{}),u=Object(Be.a)(s,2),d=u[0],p=(u[1],function(){var t=Object(Me.a)(xm().mark((function t(){var r;return xm().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r={},Object.keys(c).map((function(e){!c[e]||d[e]&&JSON.stringify({a:c[e]})===JSON.stringify({a:d[e]})||(r=Object(h.a)(Object(h.a)({},r),{},Object(O.a)({},e,c[e]&&"string"===typeof c[e]?c[e].trim():c[e])))})),!r.requireExpirePassword&&r.expiresIn&&(r.expiresIn=null);try{De.getState().functions.socket.emit("data",{module:"account",method:"post",action:"save"},r,(function(t){t.error?console.log("companyDataError",t.error):e.reduxFunction("ASYNC","SET_SESSION",Object(h.a)(Object(h.a)({},De.getState().session),{},{GlobalData:Object(h.a)(Object(h.a)({},De.getState().session.GlobalData),r)}))}))}catch(n){console.log(n)}case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}());return i.a.createElement("div",null,i.a.createElement("fieldset",{style:{wordBreak:"break-word"}},i.a.createElement("legend",null,lt("$__2FactorTokenRequired")),i.a.createElement("div",{style:{position:"relative",width:"100%",display:"flex",alignItems:"center"}},i.a.createElement(vi,{checked:!(!c||!c.requireToken),onChange:function(e){var t=Object(h.a)(Object(h.a)({},c),{},{requireToken:!c.requireToken});c.requireToken&&delete t.requireToken,l(t)},name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__required")),i.a.createElement("i",null,lt("$__2FactorTokenRequiredDescription"))),i.a.createElement("fieldset",{style:{wordBreak:"break-word"}},i.a.createElement("legend",null,lt("$__forceChangePassword")),i.a.createElement("div",{style:{position:"relative",width:"100%",display:"flex",alignItems:"center"}},i.a.createElement(vi,{checked:!(!c||!c.requireExpirePassword),onChange:function(e){var t=Object(h.a)(Object(h.a)({},c),{},{requireExpirePassword:!c.requireExpirePassword});c.requireExpirePassword&&(delete t.requireExpirePassword,c.passwordExpire&&delete t.passwordExpire),l(t)},name:"checkedA",inputProps:{"aria-label":"secondary checkbox"}}),lt("$__required")),i.a.createElement("i",null,lt("$__forceChangePasswordDescription")),c.requireExpirePassword?i.a.createElement("fieldset",null,i.a.createElement("legend",null,lt("$__sessionDuration",1)),i.a.createElement(Zc,{id:"combo-box-demo",options:n.passwordExpire,getOptionLabel:function(e){return lt(e.label,1)},style:{width:"100%"},name:"status",disableClearable:!0,value:c&&c.passwordExpire&&n.passwordExpire?n.passwordExpire.filter((function(e){return String(e.value)===String(c.passwordExpire)}))[0]:n.passwordExpire[0],renderInput:function(e){return i.a.createElement(La,Object.assign({},e,{label:lt("$__expiresIn",1),variant:dt("fieldVariant"),value:c&&c.passwordExpire&&n.passwordExpire?n.passwordExpire.filter((function(e){return String(e.value)===String(c.passwordExpire)}))[0]:n.passwordExpire.filter((function(e){return!e.value}))[0]}))},onChange:function(e,t){l(Object(h.a)(Object(h.a)({},c),{},{passwordExpire:t.value}))}})):i.a.createElement(i.a.Fragment,null)),i.a.createElement("fieldset",null,i.a.createElement("legend",null,lt("$__language",1)),i.a.createElement(Zc,{id:"combo-box-demo",options:n.languages,getOptionLabel:function(e){return lt(e.label,1)},style:{width:"100%"},name:"status",disableClearable:!0,value:c&&c.language&&n.languages&&n.languages.filter((function(e){return String(e.value)===String(c.language)})).length>0?n.languages.filter((function(e){return String(e.value)===String(c.language)}))[0]:n.languages[0],renderInput:function(e){return i.a.createElement(La,Object.assign({},e,{label:lt("$__language",1),variant:dt("fieldVariant"),value:c&&c.language&&n.languages&&n.languages.filter((function(e){return String(e.value)===String(c.language)})).length>0?n.languages.filter((function(e){return String(e.value)===String(c.language)}))[0]:n.languages[0]}))},onChange:function(e,t){l(Object(h.a)(Object(h.a)({},c),{},{language:t.value}))}})),i.a.createElement("fieldset",null,i.a.createElement("legend",null,lt("$__sessionExpire",1)),i.a.createElement(Zc,{id:"combo-box-demo",options:n.expiresIn,getOptionLabel:function(e){return lt(e.label,1)},style:{width:"100%"},name:"status",disableClearable:!0,value:c&&c.expiresIn&&n.expiresIn?n.expiresIn.filter((function(e){return String(e.value)===String(c.expiresIn)}))[0]:n.expiresIn.filter((function(e){return!e.value}))[0],renderInput:function(e){return i.a.createElement(La,Object.assign({},e,{label:lt("$__expiresIn",1),variant:dt("fieldVariant"),value:c&&c.expiresIn&&n.expiresIn?n.expiresIn.filter((function(e){return String(e.value)===String(c.expiresIn)}))[0]:n.expiresIn.filter((function(e){return!e.value}))[0]}))},onChange:function(e,t){l(Object(h.a)(Object(h.a)({},c),{},{expiresIn:t.value}))}})),JSON.stringify(c)!==JSON.stringify(d)?i.a.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},i.a.createElement(At,{title:lt("$__save"),text:lt("$__save"),color:"green",icon:"save",size:"25px",onClick:function(){p()}})):i.a.createElement(i.a.Fragment,null))}))),wm=Object(Lt.a)({list:{position:"relative",listStyleType:"disclosure-closed","& li":{marginBottom:3}},item:{display:"flex",alignItems:"center"}});var Em=Object($e.b)((function(e,t){return{}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.functions,n=(t.session,r.socket,e.planDetails),a=e.data,o=wm(),c=(xt(),i.a.createElement("span",{style:{marginLeft:15,color:"red",fontSize:11,cursor:"pointer"},onClick:function(){s.push("#tab/subscriptionUpgrade")}},lt("$__upgradeSubscription")));return i.a.createElement("div",null,i.a.createElement("fieldset",{style:{wordBreak:"break-word",padding:0,position:"relative"}},i.a.createElement("legend",null,lt("$__subscription"),": ",i.a.createElement("span",{style:{fontWeight:"bold"}},lt(n.label))),i.a.createElement("ul",{className:o.list},i.a.createElement("li",null,lt("$__adminLimit",1),": ",a&&a.customAdminsLimit?a.customAdminsLimit:n.settings.admins),i.a.createElement("li",null,lt("$__storageSpace",1),": ",a&&a.customStorageSpace?St(a.customStorageSpace):St(n.settings.space)),i.a.createElement("li",null,lt("$__BrightAndConnected",1),":",i.a.createElement("ul",{style:{position:"relative",paddingLeft:10,listStyleType:"disc"}},i.a.createElement("li",{className:o.item},lt("$__feed",1),": ",n.settings.brightAndConnected.feed?i.a.createElement(kt,{icon:"check",color:dt("color"),size:18}):c),n.settings.brightAndConnected.feed?i.a.createElement("li",{className:o.item},lt("$__feedDays",1),":",n.settings.brightAndConnected.feedDays?"".concat(n.settings.brightAndConnected.feedDays," ").concat(lt("$__days")):lt("$__unlimited")):i.a.createElement(i.a.Fragment,null),i.a.createElement("li",{className:o.item},lt("$__radarLimit",1),": ",n.settings.brightAndConnected.radarLimit?n.settings.brightAndConnected.radarLimit:lt("$__unlimited")),i.a.createElement("li",{className:o.item},lt("$__insights",1),": ",n.settings.brightAndConnected.insight?i.a.createElement(kt,{icon:"check",color:dt("color"),size:18}):c))),i.a.createElement("li",null,lt("$__plannings",1),":",i.a.createElement("ul",{style:{position:"relative",paddingLeft:10,listStyleType:"disc"}},i.a.createElement("li",{className:o.item},lt("$__limit",1),": ",n.settings.plan.limit?n.settings.brightAndConnected.radarLimit:lt("$__unlimited")),i.a.createElement("li",{className:o.item},lt("$__clientPlannings",1),": ",n.settings.plan.planClient?i.a.createElement(kt,{icon:"check",color:dt("color"),size:18}):c),n.settings.plan.planClient?i.a.createElement("li",{className:o.item},lt("$__clientUserAdmins",1),": ",n.settings.plan.clientAdmin?n.settings.plan.clientAdmin:c):i.a.createElement(i.a.Fragment,null),i.a.createElement("li",{className:o.item},lt("$__externalPlanning",1),": ",n.settings.plan.machenPlan?i.a.createElement(kt,{icon:"check",color:dt("color"),size:18}):c),i.a.createElement("li",{className:o.item},lt("$__professionalTemplates",1),": ",n.settings.plan.templates?i.a.createElement(kt,{icon:"check",color:dt("color"),size:18}):c),i.a.createElement("li",{className:o.item},lt("$__guidelineLimit",1),": ",n.settings.plan.guidelineLimit?n.settings.plan.guidelineLimit:lt("$__unlimited")),i.a.createElement("li",{className:o.item},lt("$__feedLimit",1),": ",n.settings.plan.feedLimit?n.settings.plan.feedLimit:lt("$__unlimited")),i.a.createElement("li",{className:o.item},lt("$__radarLimit",1),": ",n.settings.plan.radarLimit?n.settings.plan.radarLimit:lt("$__unlimited")),i.a.createElement("li",{className:o.item},lt("$__insightLimit",1),": ",n.settings.plan.insightLimit?n.settings.plan.insightLimit:lt("$__unlimited")))),i.a.createElement("a",{href:"https://machen.ai/#planos",target:"_blank",style:{fontWeight:"bold",color:dt("menu"),marginTop:33}},lt("$__viewMoreDetails")))))}));function Om(){Om=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}r(168).config();var jm=Object($e.b)((function(e){return{history:e.db.history}}),(function(e){return Object(u.b)(n,e)}))(Object(o.memo)((function(e){var t=De.getState(),r=t.session,n=t.db,a=i.a.useState(0),o=Object(Be.a)(a,2),c=o[0],l=o[1];i.a.useEffect((function(){}),[]),i.a.useEffect((function(){var e=setTimeout((function(){document.getElementById("mainPannel").scrollTo(0,0)}),100);return d(),function(){clearTimeout(e)}}),[e.history]);var u=window.location.hash.split("/");u[0]=u[0].replace("#",""),window.location.hash.split("/")[0].replace("#","")||s.push("sp#tab/home"),u[0]&&36===u[0].length&&!De.getState().db.cards[u[0]]&&s.push("/deniedAccess");var d=function(){var e=Object(Me.a)(Om().mark((function e(){var t;return Om().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Sn.post("/Account_Space");case 3:(t=e.sent)&&l(parseInt(t.data)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}(),p=n.plans[0].settings.space,f=n.plans[0];r&&r.GlobalData&&String(r.GlobalData.plan)&&n.plans[r.GlobalData.plan]&&n.plans[r.GlobalData.plan].settings&&(p=n.plans[r.GlobalData.plan].settings.space,f=n.plans[r.GlobalData.plan]);var h=c*(100/parseInt(p));return i.a.createElement("div",null,i.a.createElement(vo,{style:{marginBottom:15,backgroundColor:"#FFFFFF",borderRadius:2,boxShadow:"0px 0px 7px 5px rgba(0,0,0,0.03)"}},i.a.createElement(xo,{xs:12,sm:6,md:6,lg:6,xl:6,style:{display:"flex",alignItems:"center"}},i.a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},i.a.createElement("div",{style:{padding:10,background:dt("AvatarBackground")}},i.a.createElement(kt,{icon:"card_membership",size:30,color:"#FFFFFF"})),i.a.createElement("div",{style:{marginLeft:7,width:"calc(100% - 40px)"}},i.a.createElement("div",{style:{position:"relative",width:"100%",color:dt("menu"),fontWeight:"bolder",marginTop:7}},lt("$__subscriptionPlan","*"),": ",lt(f.label,"*")),i.a.createElement("div",{style:{width:"100%",color:"mediumgray",fontSize:12,fontWeight:"bold"}},lt("$__adminLimit",1),": ",f.settings.admins),i.a.createElement("a",{href:"#",style:{position:"relative",top:"-7px",color:dt("color"),fontSize:10,fontWeight:"bold"}},lt("$__viewContract"))))),i.a.createElement(xo,{xs:12,sm:6,md:6,lg:6,xl:6,style:{display:"flex",alignItems:"center"}},i.a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},i.a.createElement("div",{style:{padding:10,background:dt("AvatarBackground")}},i.a.createElement(kt,{icon:"storage",size:30,color:"#FFFFFF"})),i.a.createElement("div",{style:{marginLeft:7,width:"calc(100% - 40px)"}},i.a.createElement("div",{style:{position:"relative",marginTop:7,color:dt("menu"),fontWeight:"bolder"}},lt("$__usedStorage","*"),i.a.createElement("span",{style:{marginLeft:15,color:"red",fontSize:11,cursor:"pointer"},onClick:function(){s.push("#tab/subscriptionUpgrade")}},lt("$__upgradeSubscription"))),i.a.createElement(gm,{value:Math.ceil(h),background:h>100?"red":null}),i.a.createElement("div",null,i.a.createElement("span",{style:{color:h>100?"red":"mediumgray",fontSize:12,fontWeight:"bold"}},lt("$__used",1),": ",St(c))," ",i.a.createElement("span",{style:{color:"lightgray",fontSize:11}},lt("$__of")," ",lt("$__accountSpace",1),": ",St(p))))))),i.a.createElement(vo,{style:{}},i.a.createElement(xo,{xs:12,sm:12,md:4,lg:4,xl:4},i.a.createElement("div",{style:{padding:7,width:"100%",backgroundColor:"#FFFFFF",borderRadius:2,boxShadow:"0px 0px 7px 5px rgba(0,0,0,0.03)"}},i.a.createElement("div",null,"Dados da conta"),i.a.createElement(Ut,null,i.a.createElement(bm,{data:r&&r.GlobalData?r.GlobalData:{}})))),i.a.createElement(xo,{xs:12,sm:12,md:4,lg:4,xl:4},i.a.createElement("div",{style:{padding:7,width:"100%",backgroundColor:"#FFFFFF",borderRadius:2,boxShadow:"0px 0px 7px 5px rgba(0,0,0,0.03)"}},"Prefer\xeancias",i.a.createElement(Ut,null,i.a.createElement(_m,{data:r&&r.GlobalData?r.GlobalData:{}})))),i.a.createElement(xo,{xs:12,sm:12,md:4,lg:4,xl:4},i.a.createElement("div",{style:{padding:7,width:"100%",backgroundColor:"#FFFFFF",borderRadius:2,boxShadow:"0px 0px 7px 5px rgba(0,0,0,0.03)"}},lt("$__subscriptionDetails"),i.a.createElement(Ut,null,i.a.createElement(Em,{data:r&&r.GlobalData?r.GlobalData:{},planDetails:f}))))))}))),Sm=r(140),km=r.n(Sm),Lm=r(1006),Cm=(r(961),r(962),["onSelect"]),Im=function(e){var t=e.onSelect,r=Object(Kt.a)(e,Cm);return i.a.createElement(Sm.Panel,Object.assign({},r,{onChange:function(e){t(e.color,e.alpha/100)},animation:"slide-up"}))};var Fm=function(e){var t,r,n=Object(o.useState)(!1),a=Object(Be.a)(n,2),c=a[0],l=a[1],s=(null===e||void 0===e||null===(t=e.value)||void 0===t?void 0:t.css)?function(e){var t=e.replace("linear-gradient(90deg,","").replace("radial-gradient(90deg,","").split("rgba("),r=[];return t.map((function(e){var t=e.split(") ");if(2===t.length){var n=t[0].split(","),a=(parseInt(t[1].replace(")","").replace("%",""))/100).toFixed(2);r.push({color:"rgb(".concat(n[0],", ").concat(n[1],", ").concat(n[2],")"),offset:"".concat(a),opacity:"".concat(n[3])})}})),r}(e.value.css):(null===e||void 0===e||null===(r=e.value)||void 0===r?void 0:r.color)||[];return i.a.createElement(Lm.GradientPickerPopover,{showAnglePicker:!1,showGradientTypePicker:!1,open:c,setOpen:l,width:320,paletteHeight:32,palette:s,onPaletteChange:function(t){!function(t){var r=t.color,n=e.type&&"linear"!==e.type?"radial-gradient(":"linear-gradient(90deg, ";r.map((function(e,t){e.color.indexOf("#")>-1&&(n="".concat(n).concat(ut(e.color,e.opacity||1)," ").concat(Math.ceil(100*e.offset),"% ").concat(t<r.length-1?",":""," ")),e.color.indexOf("rgb")>-1&&-1===e.color.indexOf("rgba")&&(n="".concat(n,"rgba(").concat(e.color.replace("rgb(","").replace(")",", ".concat(e.opacity||1)),") ").concat(Math.ceil(100*e.offset),"% ").concat(t<r.length-1?",":""," "))})),n="".concat(n,")"),e.onChange&&e.onChange({css:n,palette:r})}({name:"ColumnTitleColor",color:t})}},i.a.createElement(Im,null))};function Tm(){Tm=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Nm=Object($e.b)((function(e){return{session:e.session}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(ll)((function(e){var t=De.getState(),r=(t.db,t.session),n=r.custom,a=i.a.useState(r.custom||{}),o=Object(Be.a)(a,2),c=o[0],l=o[1],s=i.a.useState({}),u=Object(Be.a)(s,2),d=u[0],p=u[1],f=i.a.useState({}),m=Object(Be.a)(f,2),g=m[0],v=m[1],y=i.a.useState(null),b=Object(Be.a)(y,2),x=b[0],_=b[1],w=i.a.useState(null),E=Object(Be.a)(w,2),j=E[0],S=E[1],k=i.a.useState(!1),L=Object(Be.a)(k,2),C=L[0],I=L[1],F=i.a.useState(!1),T=Object(Be.a)(F,2),N=T[0],P=T[1],D=xt();i.a.useEffect((function(){p(r.custom||{})}),[]),i.a.useEffect((function(){C&&setTimeout((function(){I(!1)}),500)}),[C]);var A=function(t){e.reduxFunction("ASYNC","SET_SESSION",Object(h.a)(Object(h.a)({},De.getState().session),{},{custom:Object(h.a)(Object(h.a)({},De.getState().session.custom),{},Object(O.a)({},t.name,t.value))})),v(Object(h.a)(Object(h.a)({},g),{},Object(O.a)({},t.name,t.value))),l(Object(h.a)(Object(h.a)({},c),{},Object(O.a)({},t.name,t.value)))},$=function(){var t=Object(Me.a)(Tm().mark((function t(){return Tm().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:l(d),v({}),e.reduxFunction("ASYNC","SET_SESSION",Object(h.a)(Object(h.a)({},De.getState().session),{},{custom:d}));case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),z=function(){var e=Object(Me.a)(Tm().mark((function e(){var t,a,o;return Tm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(P(!0),t=Object(h.a)(Object(h.a)({},(null===n||void 0===n?void 0:n.custom)?JSON.parse(null===n||void 0===n?void 0:n.custom):{}),g),l(t),p(t),e.prev=4,!x){e.next=11;break}return e.next=8,Ln(r.account,x);case 8:e.t0=e.sent,e.next=12;break;case 11:e.t0=!0;case 12:if(a=e.t0,!j){e.next=19;break}return e.next=16,Ln(r.account,j);case 16:e.t1=e.sent,e.next=20;break;case 19:e.t1=!0;case 20:o=e.t1,a&&o&&(x&&(t=Object(h.a)(Object(h.a)({},t),{},{customLogo:a})),j&&(t=Object(h.a)(Object(h.a)({},t),{},{loginBackground:o})),De.getState().functions.socket.emit("data",{module:"account",method:"post",action:"save"},{custom:JSON.stringify(t)},(function(e){P(!1),v({})}))),e.next=27;break;case 24:e.prev=24,e.t2=e.catch(4),console.log(e.t2);case 27:case"end":return e.stop()}}),e,null,[[4,24]])})));return function(){return e.apply(this,arguments)}}();return(c._id===r._id||D&&D.user&&(D.userAdmin||D.userEdit))&&!0,c.independentAccount&&!1,i.a.createElement(vo,null,i.a.createElement(xo,{md:4},i.a.createElement(hn.a,{style:{marginTop:15,padding:7}},i.a.createElement("fieldset",null,i.a.createElement("legend",null,lt("$__logo")),i.a.createElement(Zi,{maxWidthOrHeight:600,img:n.customLogo,onChange:function(e,t){_(t),A({name:"customLogo",value:e})},transparent:!0,ignoreAspect:!0,noGuides:!0,viewMode:0,accept:".png",checkOrientation:!0})))),i.a.createElement(xo,{md:4},i.a.createElement(hn.a,{style:{marginTop:15,padding:7}},i.a.createElement("fieldset",null,i.a.createElement("legend",null,lt("$__loginBackground")),i.a.createElement(Zi,{maxWidthOrHeight:2e3,img:n.loginBackground,onChange:function(e,t){S(t),A({name:"loginBackground",value:e})},transparent:!0,ignoreAspect:!0,noGuides:!0,viewMode:0,accept:".jpg, .jpeg",checkOrientation:!0})))),i.a.createElement(xo,{md:4},i.a.createElement(hn.a,{style:{marginTop:15,padding:7}},i.a.createElement("fieldset",null,i.a.createElement("legend",null,lt("$__backgroundColumnsTitle")),i.a.createElement(Fa,{title:lt("$__backgroundColumnsTitle",1),icon:"gradient",color:dt("colorText"),style:{background:dt("ColumnTitleColor"),padding:"7px"}}),i.a.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexFlow:"wrap"}},i.a.createElement("div",{style:Object(O.a)({display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},"justifyContent","space-between")},i.a.createElement(Ut,null,i.a.createElement(Fm,{value:{css:n.ColumnTitleColor},onChange:function(e){A({name:"ColumnTitleColor",value:e.css})}})),i.a.createElement("div",{style:{marginRight:7}},lt("$__background"))),i.a.createElement("div",{style:Object(O.a)({display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},"justifyContent","space-between")},i.a.createElement(Ut,null,i.a.createElement(km.a,{enableAlpha:!1,animation:"slide-up",color:n.colorText||null,mode:"RGB",onChange:function(e){A({name:"colorText",value:e.color})}}),i.a.createElement("div",{style:{marginRight:7}},lt("$__text")))))))),i.a.createElement(xo,{md:4},i.a.createElement(hn.a,{style:{marginTop:15,padding:7}},i.a.createElement("fieldset",null,i.a.createElement("legend",null,lt("$__menu")),i.a.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexFlow:"wrap"}},i.a.createElement("div",{style:Object(O.a)({display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},"justifyContent","space-between")},i.a.createElement(Ut,null,i.a.createElement(Fm,{value:{css:n.menuColor},onChange:function(e){A({name:"menuColor",value:e.css})}})),i.a.createElement("div",{style:{marginRight:7}},lt("$__background"))),i.a.createElement("div",{style:Object(O.a)({display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},"justifyContent","space-between")},i.a.createElement(Ut,null,i.a.createElement(km.a,{enableAlpha:!1,animation:"slide-up",color:n.menuButtonColor,mode:"RGB",onChange:function(e){A({name:"menuButtonColor",value:e.color})}})),i.a.createElement("div",{style:{marginRight:7}},lt("$__menuText"))),i.a.createElement("div",{style:Object(O.a)({display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},"justifyContent","space-between")},i.a.createElement(Ut,null,i.a.createElement(km.a,{enableAlpha:!1,animation:"slide-up",color:n.active,mode:"RGB",onChange:function(e){A({name:"active",value:e.color})}})),i.a.createElement("div",{style:{marginRight:7}},lt("$__menuActiveText"))))))),i.a.createElement(xo,{md:4},i.a.createElement(hn.a,{style:{marginTop:15,padding:7}},i.a.createElement("fieldset",null,i.a.createElement("legend",null,lt("$__submenu")),i.a.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexFlow:"wrap"}},i.a.createElement("div",{style:Object(O.a)({display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},"justifyContent","space-between")},i.a.createElement(Ut,null,i.a.createElement(Fm,{value:{css:n.subMenuColor},onChange:function(e){A({name:"subMenuColor",value:e.css})}})),i.a.createElement("div",{style:{marginRight:7}},lt("$__background"))),i.a.createElement("div",{style:Object(O.a)({display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},"justifyContent","space-between")},i.a.createElement(Ut,null,i.a.createElement(km.a,{enableAlpha:!1,animation:"slide-up",color:n.subMenuTextColor,mode:"RGB",onChange:function(e){A({name:"subMenuTextColor",value:e.color})}})),i.a.createElement("div",{style:{marginRight:7}},lt("$__menuTextIconColor"))),i.a.createElement("div",{style:Object(O.a)({display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},"justifyContent","space-between")},i.a.createElement(Ut,null,i.a.createElement(km.a,{enableAlpha:!1,animation:"slide-up",color:n.subMenuTextColorActive,mode:"RGB",onChange:function(e){A({name:"subMenuTextColorActive",value:e.color})}})),i.a.createElement("div",{style:{marginRight:7}},lt("$__subMenuActiveText"))))))),i.a.createElement(xo,{md:4},i.a.createElement(hn.a,{style:{marginTop:15,padding:7}},i.a.createElement("fieldset",null,i.a.createElement("legend",null,lt("$__complement")),i.a.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexFlow:"wrap"}},i.a.createElement("div",{style:Object(O.a)({display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},"justifyContent","space-between")},i.a.createElement(Ut,null,i.a.createElement(Fm,{value:{css:n.linearProgress},onChange:function(e){A({name:"linearProgress",value:e.css})}})),i.a.createElement(Fo,{customColor:n.linearProgress}),i.a.createElement("div",{style:{marginRight:7}},lt("$__progress"))),i.a.createElement("div",{style:Object(O.a)({display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},"justifyContent","space-between")},i.a.createElement(Ut,null,i.a.createElement(km.a,{enableAlpha:!1,animation:"slide-up",color:n.color,mode:"RGB",onChange:function(e){A({name:"color",value:e.color})}})),i.a.createElement("div",{style:{marginRight:7}},lt("$__borderColor"))),i.a.createElement("div",{style:Object(O.a)({display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},"justifyContent","space-between")},i.a.createElement(Ut,null,i.a.createElement(km.a,{enableAlpha:!1,animation:"slide-up",color:n.menu,mode:"RGB",onChange:function(e){A({name:"menu",value:e.color})}})),i.a.createElement("div",{style:{marginRight:7,fontWeight:"bold",color:dt("menu")}},lt("$__primaryText"))))))),i.a.createElement(xo,{md:4},i.a.createElement(hn.a,{style:{marginTop:15,padding:7}},i.a.createElement("fieldset",null,i.a.createElement("legend",{style:{display:"flex",alignItems:"center"}},lt("$__cardImageCover"),i.a.createElement(Fm,{value:{css:n.AvatarBackground},onChange:function(e){A({name:"AvatarBackground",value:e.css})},type:"radial"}),i.a.createElement(km.a,{enableAlpha:!1,animation:"slide-up",color:n.avatarIconColor,mode:"RGB",onChange:function(e){A({name:"avatarIconColor",value:e.color})}})),i.a.createElement(ui,{backgroundColor:n.AvatarBackground,avatarIconColor:n.avatarIconColor,responsive:!0})))),i.a.createElement(xo,{md:4},i.a.createElement(hn.a,{style:{marginTop:15,padding:7}},i.a.createElement("fieldset",null,i.a.createElement("legend",{style:{display:"flex",alignItems:"center"}},lt("$__fields")),i.a.createElement("div",{style:Object(O.a)({display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},"justifyContent","space-between")},i.a.createElement(Ut,null,i.a.createElement(km.a,{enableAlpha:!1,animation:"slide-up",color:n.line,mode:"RGB",onChange:function(e){A({name:"line",value:e.color}),I(!0)}})),i.a.createElement("div",{style:{marginRight:7}},lt("$__line"))),i.a.createElement("div",{style:Object(O.a)({display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},"justifyContent","space-between")},i.a.createElement(Ut,null,i.a.createElement(km.a,{enableAlpha:!1,animation:"slide-up",color:n.medium,mode:"RGB",onChange:function(e){A({name:"medium",value:e.color}),I(!0)}})),i.a.createElement("div",{style:{marginRight:7}},lt("$__inputAdorment"))),C?i.a.createElement(La,{label:lt("$__field",1),variant:n.fieldVariant,name:"field",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"format_color_fill"}))}}):i.a.createElement(La,{label:lt("$__field",1),variant:n.fieldVariant,name:"field",InputProps:{autoComplete:"new-password",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"format_color_fill",color:n.medium}))}})))),JSON.stringify(c)!==JSON.stringify(d)?i.a.createElement("div",{style:{position:"fixed",bottom:50,right:50,display:"flex",justifyContent:"flex-end"}},i.a.createElement("div",null,i.a.createElement(At,{title:lt("$__reset"),text:lt("$__reset"),color:"red",icon:"format_color_reset",size:"25px",onClick:function(){$()},load:N})),i.a.createElement("div",{style:{marginLeft:15}},i.a.createElement(At,{title:lt("$__save"),text:lt("$__save"),color:"green",icon:"save",size:"25px",onClick:function(){z()},load:N}))):i.a.createElement(i.a.Fragment,null))})));var Pm=Object($e.b)((function(e){return{history:e.db.history}}),(function(e){return Object(u.b)(n,e)}))(Object(o.memo)((function(e){i.a.useEffect((function(){var e=setTimeout((function(){document.getElementById("mainPannel").scrollTo(0,0)}),100);return function(){clearTimeout(e)}}),[e.history]);var t=window.location.hash.split("/");return t[0]=t[0].replace("#",""),window.location.hash.split("/")[0].replace("#","")||s.push("acc#tab/resume"),i.a.createElement("div",null,t[1]&&"resume"===t[1]?i.a.createElement(Ut,null,i.a.createElement(jm,null)):i.a.createElement(i.a.Fragment,null),t[1]&&"profile"===t[1]?i.a.createElement(Ut,null,i.a.createElement(mm,null)):i.a.createElement(i.a.Fragment,null),t[1]&&"whiteLabel"===t[1]?i.a.createElement(Ut,null,i.a.createElement(Nm,null)):i.a.createElement(i.a.Fragment,null),t[1]&&"integrations"===t[1]?i.a.createElement(Ut,null,i.a.createElement(cm,null)):i.a.createElement(i.a.Fragment,null),t[1]&&"invoicing"===t[1]?i.a.createElement(Ut,null,i.a.createElement(im,null)):i.a.createElement(i.a.Fragment,null))}))),Dm=Object(Lt.a)(Lp);var Am=Object(Lt.a)(Lp);var $m=[{path:"/d",name:"DASHBOARD",alias:"Dashboard",icon:"dashboard",component:kp,show:!0,auth:!0,search:!1,tabs:[{path:"resume",name:"RESUME",alias:"home",icon:"space_dashboard",show:!0,auth:!0},{path:"dayTasks",name:"DAYTASKS",alias:"dayTasks",icon:"hail",show:!0,auth:!0,AppAccess:["planAdmin","planModerate"]}]},{path:"/bright-and-connected",name:"BRIGHTANDCONNECTED",alias:"brightandconnected",icon:U.a,component:ep,show:!0,auth:!0,subMenu:!0,searchFields:["tags","text"],tabs:[{path:"home",name:"home",alias:"home",icon:"home",show:!0,auth:!0},{path:"feeds",name:"FEEDS",alias:"feeds",icon:"menu_book",show:!0,auth:!0,search:!0,searchFields:["tags","text"]},{path:"radar",name:"radar",alias:"radar",icon:"settings_input_antenna",show:!0,auth:!0,search:!0,searchFields:["tags","text","users","priority"]},{path:"insight-boards",name:"INSIGHTS",alias:"insights",icon:xp.a,show:!0,auth:!0,search:!0,searchFields:["tags","text","users","priority"]},{path:"allNews",name:"allNews",alias:"allNews",icon:"feed",show:!0,auth:!0,search:!0,searchFields:["tags","text"]},{path:"hideFeeds",name:"HIDEFEEDS",alias:"hideFeeds",icon:"visibility_off",show:!0,auth:!0,search:!0,searchFields:["tags","text"]}]},{path:"/c",name:"Users",alias:"users",icon:"business",component:Vh,show:!0,auth:!0,search:!0,subMenu:!0,searchFields:["text","tags","users","userGroup"],tabs:[{path:"users",name:"USERS",alias:"users",icon:"supervised_user_circle",show:!0,auth:!0,permission:1,search:!0,searchFields:["text","tags","userGroup"]},{path:"units",name:"units",alias:"units",icon:"business",show:!0,auth:!0,permission:1,search:!0,searchFields:["text","tags","userGroup"]}]},{path:"/sp",name:"Strategy & Plans",alias:"plan",icon:"view_comfy",component:Yh,show:!0,auth:!0,search:!0,subMenu:!0,searchFields:["text","tags","users","priority","units","status"],tabs:[{path:"home",name:"home",alias:"home",icon:"home",show:!0,auth:!0,search:!0,searchFields:["text","tags","users","priority","units","status"],hashId:!1},{path:"StrategyAndPlans",name:"StrategyAndPlans",alias:"StrategyAndPlans",icon:"view_comfy",show:!0,auth:!0,search:!0,searchFields:["text","tags","users","priority","units","status"],hashId:!1},{path:"archived",name:"archivedPlans",alias:"archivedPlans",icon:"archive",show:!0,auth:!0,search:!0,searchFields:["text","tags","users","priority","units","status"],hashId:!1},{path:"admin",name:"admin",alias:"admin",icon:"admin_panel_settings",show:!0,auth:!0,AppAccess:["planAdmin"],search:!0,searchFields:["text","tags","users","priority","units","status"],hashId:!1},{path:"templates",name:"templates",alias:"templates",icon:"smart_button",show:!0,auth:!0,search:!0,searchFields:["text","tags","users","priority","units","status"],hashId:!1},{path:"completed",name:"completed",alias:"completed",icon:"assignment_turned_in",show:!0,auth:!0,search:!0,searchFields:["text","tags","users","priority","units","status"],hashId:!1},{path:"trash",name:"trash",alias:"trash",icon:"recycling",show:!0,auth:!0,search:!0,searchFields:["text","tags","users","priority","units","status"],hashId:!1},{path:"dashboard",name:"dashboard",alias:"home",icon:"dashboard",show:!0,auth:!0,permission:4,search:!1,searchFields:[],hashId:!0,templates:!0},{path:"overview",name:"OVERVIEW",alias:"overview",icon:"select_all",show:!0,auth:!0,permission:4,search:!0,searchFields:["text","tags","users","priority","status","date"],hashId:!0,templates:!0},{path:"board",name:"board",alias:"board",icon:"view_week",show:!0,auth:!0,permission:3,search:!0,searchFields:["text","tags","users","priority","status","date"],hashId:!0,templates:!0},{path:"matrix",name:"MATRIX SWOT",alias:"matrix",icon:G.a,show:!0,auth:!0,permission:3,search:!1,searchFields:["text","tags","users"],hashId:!0,templates:!0},{path:"guidelines",name:"guidelines",alias:"guidelines",icon:"alt_route",show:!0,auth:!0,permission:1,search:!0,searchFields:["text","tags","users","priority","groups","status","date"],hashId:!0},{path:"objectives",name:"objectives",alias:"objectives",icon:"gps_fixed",show:!0,auth:!0,permission:1,search:!0,searchFields:["text","tags","users","priority","groups","status","date"],hashId:!0},{path:"goals",name:"goals",alias:"goals",icon:"flag",show:!0,auth:!0,permission:1,search:!0,searchFields:["text","tags","users","priority","groups","status","date"],hashId:!0},{path:"actions",name:"ACTIONS",alias:"actions",icon:"playlist_play",show:!0,auth:!0,permission:1,search:!0,searchFields:["text","tags","users","priority","status","date"],hashId:!0},{path:"bright-and-connected",name:"feeds",alias:"feeds",icon:"menu_book",show:!0,auth:!0,permission:3,search:!1,searchFields:["tags","text"],hashId:!0,templates:!0},{path:"radar",name:"radar",alias:"radar",icon:"settings_input_antenna",show:!0,auth:!0,permission:3,search:!0,searchFields:["tags","text"],hashId:!0,templates:!0},{path:"insight-boards",name:"INSIGHTS",alias:"insights",icon:xp.a,show:!0,auth:!0,permission:3,search:!0,searchFields:["tags","text"],hashId:!0,templates:!0},{path:"library",name:"library",alias:"library",icon:"folder",show:!0,auth:!0,permission:3,search:!0,searchFields:["text"],hashId:!0}]},{path:"/t",name:"Tasks",alias:"tasks",component:Zp,icon:"recent_actors",show:!0,auth:!0,permission:1,hashId:!1,search:!0,subMenu:!0,searchFields:["text","tags","users","plans","priority","units","groups","status","date"],tabs:[{path:"myDay",name:"myDay",alias:"myDay",icon:"today",show:!0,auth:!0,permission:1,search:!0,searchFields:["text","tags","users","plans","priority","units","groups","status","date"]},{path:"ourDay",name:"ourDay",alias:"ourDay",icon:"reduce_capacity",show:!0,auth:!0,permission:3,AppAccess:["planAdmin","planModerate"],search:!0,searchFields:["text","tags","users","plans","priority","units","groups","status","date"]},{path:"allTasks",name:"allTasks",alias:"allTasks",icon:"how_to_reg",show:!0,auth:!0,permission:1,search:!0,searchFields:["text","tags","users","plans","priority","units","groups","status","date"]},{path:"myTasks",name:"myTasks",alias:"myTasks",icon:"admin_panel_settings",show:!0,auth:!0,permission:1,search:!0,searchFields:["text","tags","users","plans","priority","units","groups","status","date"]},{path:"unreaded",name:"unreaded",alias:"unreaded",icon:"notifications_active",show:!0,auth:!0,permission:1,search:!0,searchFields:["text","tags","users","plans","priority","units","groups","status","date"]},{path:"private",name:"private",alias:"private",icon:"private_connectivity",show:!0,auth:!0,permission:1,search:!0,searchFields:["text","tags","users","plans","priority","units","groups","status","date"]},{path:"unlinkedCards",name:"unlinkedCards",alias:"unlinkedCards",icon:"link_off",show:!0,auth:!0,permission:1,search:!0,searchFields:["text","tags","users","plans","priority","units","groups","status","date"]},{path:"planningCards",name:"planningCards",alias:"planningCards",icon:"apps",show:!0,auth:!0,AppAccess:["planAdmin","planModerate"],permission:5,search:!0,searchFields:["text","tags","users","plans","priority","units","groups","status","date"]},{path:"guidelines",name:"guidelines",alias:"plansGuidelines",icon:G.a,show:!0,auth:!0,permission:1,search:!0,searchFields:["text","tags","users","plans","priority","units","groups","status","date"]},{path:"objectives",name:"objectives",alias:"plansObjectives",icon:"gps_fixed",show:!0,auth:!0,permission:1,search:!0,searchFields:["text","tags","users","plans","priority","units","groups","status","date"]},{path:"goals",name:"goals",alias:"plansGoals",icon:"flag",show:!0,auth:!0,permission:1,search:!0,searchFields:["text","tags","users","plans","priority","units","groups","status","date"]},{path:"lateTasks",name:"lateTasks",alias:"lateTasks",icon:"playlist_play",show:!1,auth:!0,permission:1,search:!0,searchFields:["text","tags","users","plans","priority","units","groups","status","date"]},{path:"nextTasks",name:"nextTasks",alias:"nextTasks",icon:"playlist_play",show:!1,auth:!0,permission:1,search:!0,searchFields:["text","tags","users","plans","priority","units","groups","status","date"]}]},{path:"/tags",name:"Tags",alias:"Tags",component:Rh,icon:"turned_in",show:!0,auth:!0,search:!0,subMenu:!0,permission:1},{path:"/plataformAdministrator",name:"BackOffice",alias:"BackOffice",icon:"business",component:hd,access:["_isDeveloper"],show:!1,auth:!0,search:!1,tabs:[{path:"versions",name:"versions",alias:"versions",icon:"app_registration",show:!0},{path:"accounts",name:"accounts",alias:"accounts",icon:"account_box",show:!0},{path:"languages",name:"languages",alias:"languages",icon:"translate",show:!0},{path:"feeds",name:"feeds",alias:"feeds",icon:"rss_feed",show:!0}]},{path:"/masterAdmin",name:"masterAdmin",alias:"masterAdmin",icon:"admin_panel_settings",component:of,show:!1,access:["_isAdmin"],auth:!0,search:!1,tabs:[{path:"accounts",name:"accounts",alias:"accounts",icon:"account_box",show:!0},{path:"languages",name:"languages",alias:"languages",icon:"translate",show:!0},{path:"feeds",name:"feeds",alias:"feeds",icon:"rss_feed",show:!0}]},{path:"/notifications",name:"Notifications",alias:"Notifications",icon:"notifications",component:gf,show:!1,auth:!0},{collapse:!0,name:"Pages",icon:"image",state:"pageCollapse",show:!1,views:[{path:"/activate",name:"Activate User",mini:"AU",component:function(e){var t=new URLSearchParams(window.location.search),r=i.a.useState({cPassword:null,password:null}),n=Object(Be.a)(r,2),a=n[0],o=n[1],c=qu();t.get("token")&&36===t.get("token").length||s.push("/");var l=function(){var r=Object(Me.a)(Vu().mark((function r(){var n;return Vu().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,ot.post("/user/new-password",{token:t.get("token"),password:a.password});case 3:(n=r.sent)&&(localStorage.setItem("TOKEN",n.data.token),e.callback&&setTimeout((function(){s.push("/login")}),3e3)),r.next=10;break;case 7:r.prev=7,r.t0=r.catch(0),e.callback({fn:"alert",message:"".concat(lt("$__invalidRequest",1)," | ").concat(lt("$__contactSupport",1)),variant:"warning",persist:!1,horizontal:"center",confirm:null});case 10:case"end":return r.stop()}}),r,null,[[0,7]])})));return function(){return r.apply(this,arguments)}}();return i.a.createElement("div",{className:c.container},i.a.createElement(vo,null,i.a.createElement(xo,{xl:4,lg:4,md:4,sm:12,xs:12},i.a.createElement("form",null,i.a.createElement($s,{db:"cards",login:!0},i.a.createElement(Ws,{className:"".concat(c.cardHeader," ").concat(c.textCenter),color:"primary",style:{background:"linear-gradient(60deg, rgba(15,18,35,1), rgba(2,33,88,1))",boxShadow:"0 4px 20px 0 rgba(15,18,35,0.14), 0 7px 10px -5px rgba(15,18,35,0.4)"}},i.a.createElement("h4",{className:c.cardTitle},lt("$__createPassword",1))),i.a.createElement(Ys,null,i.a.createElement(dl,{onConfirmed:function(e){o(Object(h.a)(Object(h.a)({},a),{},{password:e}))}})),i.a.createElement(Wu,{className:c.justifyContentCenter},a&&a.password&&i.a.createElement(Cr,{style:{color:"rgba(15,18,35,1)"},simple:!0,size:"lg",block:!0,onClick:function(){return l()}},lt("$__save","*"))))))))},show:!0,auth:!1},{path:"/login",name:"Login Page",mini:"L",component:Mp,show:!0,auth:!1},{path:"/register",name:"Register Page",mini:"R",component:function(e){var t=i.a.useState([]),r=Object(Be.a)(t,2),n=r[0],a=r[1],o=i.a.useState(!1),c=Object(Be.a)(o,2),l=c[0],u=c[1],d=i.a.useState(""),p=Object(Be.a)(d,2),h=p[0],m=p[1],g=i.a.useState(""),v=Object(Be.a)(g,2),y=v[0],b=v[1],x=i.a.useState(!1),_=Object(Be.a)(x,2),w=_[0],E=_[1],O=i.a.useState(""),j=Object(Be.a)(O,2),S=j[0],k=j[1],L=i.a.useState(""),C=Object(Be.a)(L,2),I=C[0],F=C[1],T=i.a.useState(!1),N=Object(Be.a)(T,2),P=N[0],D=N[1],A=i.a.useState(!1),$=Object(Be.a)(A,2),z=$[0],M=$[1],B=i.a.useState(!1),Y=Object(Be.a)(B,2),G=Y[0],R=Y[1],H=i.a.useState(null),W=Object(Be.a)(H,2),U=W[0],V=W[1],q=wf(),X=function(){var e=Object(Me.a)(_f().mark((function e(t){return _f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u(!0),!pt(t)){e.next=8;break}return e.next=4,Za(t);case 4:e.sent?(k(lt("$__emailAlreadyExists",1)),b(""),E(!1)):(k(null),E(!0),ro(h,t)),e.next=10;break;case 8:k(lt("$__invalidEmail",1)),b("");case 10:u(!1);case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),J=function(){var e=Object(Me.a)(_f().mark((function e(){return _f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(I.length>=6)){e.next=9;break}return u(!0),e.next=4,eo(I,y);case 4:e.sent?(M(!0),D(!1)):D(!0),u(!1),e.next=10;break;case 9:D(!1);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),K=function(){var t=Object(Me.a)(_f().mark((function t(){var r;return _f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u(!0),t.prev=1,t.next=4,ot.post("user/register-final-step/",{name:h,email:y,token:I,password:U,login:!0});case 4:(r=t.sent)&&(localStorage.setItem("TOKEN",r.data.token),e.callback&&setTimeout((function(){s.push("/login")}),3e3)),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(1),u(!1);case 11:case"end":return t.stop()}}),t,null,[[1,8]])})));return function(){return t.apply(this,arguments)}}();return i.a.createElement("div",{className:q.container},i.a.createElement(vo,null,i.a.createElement(xo,{xs:12,sm:10,md:6},i.a.createElement($s,{db:"cards",className:q.cardSignup},i.a.createElement("h2",{className:q.cardTitle},lt("$__register",1)),i.a.createElement(Ys,null,i.a.createElement(vo,null,i.a.createElement(xo,{xs:12},i.a.createElement("div",null,i.a.createElement(La,{className:q.textFields,label:lt("$__fullName",1),variant:"standard",name:lt("$__fullName",1),InputLabelProps:{shrink:!0},InputProps:{endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{className:q.inputAdornmentIcon},"account_box")),autoComplete:"new-password",onChange:function(e){m(e.target.value)}},value:h}),i.a.createElement(La,{label:lt("$__email",1),variant:dt("fieldVariant"),name:"email",type:"email",helperText:S,InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",className:!S&&y&&pt(y)?"":"invalid",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"alternate_email"})),onChange:function(e){E(!1),k(null),b(e.target.value)},onBlur:function(){var e=Object(Me.a)(_f().mark((function e(t){return _f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:X(t.target.value);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},value:y,placeholder:"email@domain.com",disabled:w}),!w&&i.a.createElement(rn,{icon:"navigate_next",text:lt("$__continue","*"),reverse:!0,style:{float:"right"},onClick:function(){X(y)}}),w&&y&&i.a.createElement(i.a.Fragment,null,i.a.createElement(La,{label:lt("$__emailToken",1),variant:dt("fieldVariant"),helperText:lt(P?"registerEmailTokenError":"registerEmailTokenDescription"),type:"password",name:"emailToken",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",className:P?"invalid":"",endAdornment:i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"keyboard"})),onChange:function(e){k(null),F(e.target.value)}},value:I,placeholder:"****"}),i.a.createElement(rn,{icon:"reply_all",text:lt("$__resendCode","*"),reverse:!0,style:{float:"right"},onClick:function(){ro(h,y)}}),!z&&i.a.createElement(rn,{icon:"navigate_next",text:lt("$__continue","*"),reverse:!0,style:{float:"right"},onClick:function(){J()}})),w&&z&&i.a.createElement(i.a.Fragment,null,i.a.createElement(dl,{onConfirmed:function(e){V(e)}}),i.a.createElement(ii.a,{open:G,onClose:function(){return R(!1)},"aria-labelledby":"simple-modal-title","aria-describedby":"simple-modal-description"},i.a.createElement("div",{style:{position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px",display:"flex",justifyContent:"center",alignItems:"center"}},i.a.createElement("div",{style:{position:"relative",width:"80vw",maxHeight:"80vh",overflowY:"auto",backgroundColor:"#FFFFFF",padding:"15px",margin:"auto"}},i.a.createElement("div",{style:{position:"absolute",right:"3px",top:"3px"}},i.a.createElement(kt,{size:"33px",color:"black",onClick:function(){R(!1)}},"close")),i.a.createElement("p",null,"Lorem ipsum dolor sit amet, consectetur adipiscing elit. In nisl sapien, scelerisque non enim quis, mollis euismod ante. Nunc facilisis quam ullamcorper, interdum ante non, congue magna. Maecenas euismod nisl sed risus pretium placerat. Nulla dictum dolor sed tincidunt mollis. Nam elit urna, elementum at mattis fringilla, pharetra sed ipsum. Ut eleifend ullamcorper nulla, consequat cursus arcu efficitur eget. Ut et leo sed lacus molestie aliquam. In molestie cursus est vel luctus. Aliquam ut vehicula augue, vitae venenatis ligula. Sed lobortis velit quis quam rutrum, ut pretium arcu semper. Proin a fermentum sem. Phasellus nec auctor elit. Nullam auctor quam ut ullamcorper mattis."),i.a.createElement("p",null,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Integer et enim congue, pulvinar elit facilisis, sollicitudin neque. Nulla interdum justo arcu, eu tincidunt arcu suscipit at. Vestibulum quis elementum ante. Mauris et odio in mi ornare tincidunt. Nulla mattis ex vitae magna hendrerit, non interdum dui lobortis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed pretium lorem a orci tempor convallis. Aliquam nec dapibus dolor. Nulla arcu lacus, posuere dictum risus sed, volutpat aliquet nibh. Cras tincidunt viverra finibus."),i.a.createElement("p",null,"Nam in scelerisque lectus, nec aliquam mauris. Ut id nisl sit amet lectus posuere placerat quis vel odio. Fusce ultrices ultricies lobortis. Proin sodales sit amet lorem vel viverra. Donec ac libero quis leo malesuada faucibus. Phasellus eu placerat purus. Suspendisse lectus dolor, consectetur sit amet pretium sed, luctus non nulla. In sed pulvinar est. Fusce vitae ligula quis quam tempus tincidunt. Ut congue faucibus mollis. Vestibulum ac diam id metus rhoncus bibendum non quis leo. Donec tempus non ligula sit amet vehicula. Phasellus id lectus ac neque maximus ullamcorper vel non massa."),i.a.createElement("p",null,"Donec augue lorem, bibendum vitae egestas sit amet, placerat eu elit. In sapien neque, volutpat sit amet sagittis quis, rutrum sit amet turpis. Quisque cursus ligula at mattis blandit. Donec erat arcu, pellentesque eu odio at, blandit viverra nisl. In sagittis felis nec enim facilisis, dapibus commodo enim feugiat. Proin volutpat elit id sem malesuada euismod. Morbi pulvinar tristique diam non luctus. Aliquam ligula enim, efficitur non nunc ac, vestibulum convallis diam. Quisque varius metus a dui ultricies sagittis."),i.a.createElement("p",null,"Quisque vitae convallis arcu, vel convallis leo. Sed in pellentesque tortor. Nulla tristique lacinia tempus. Pellentesque ut neque elementum, accumsan ante sit amet, malesuada nulla. Nam ac vulputate leo. Vestibulum leo mi, consectetur id odio eu, vulputate tincidunt quam. Maecenas finibus purus eget tincidunt vulputate. Etiam a semper felis, et varius lacus. Pellentesque condimentum sollicitudin magna et mollis. Nam sit amet elit rhoncus, pretium enim sed, fringilla sapien. Proin convallis sed velit quis imperdiet. Sed iaculis, velit in tempus mattis, ante neque aliquam augue, ac porttitor nulla tellus in mauris. In elementum lobortis turpis et imperdiet. Praesent auctor placerat ullamcorper. Donec eu facilisis justo.")))),i.a.createElement(Xs.a,{classes:{root:q.checkboxLabelControl,label:q.checkboxLabel},control:i.a.createElement(Mo.a,{tabIndex:-1,onClick:function(){return function(e){var t=n.indexOf(e),r=Object(f.a)(n);-1===t?r.push(e):r.splice(t,1),a(r)}(1)},checkedIcon:i.a.createElement("div",{className:q.checkedIcon},i.a.createElement(kt,{size:"16px"},"check")),icon:i.a.createElement("div",{className:q.uncheckedIcon},i.a.createElement(kt,{size:"16px",color:"red"},"remove")),classes:{checked:q.checked,root:q.checkRoot}}),label:i.a.createElement("span",null,lt("$__iAgreeToThe",1)," ",i.a.createElement("span",{onClick:function(){return R(!0)},style:{color:"blue"}},"terms and conditions"),".")}),i.a.createElement("div",{className:q.center},n.indexOf(1)>-1&&U&&i.a.createElement(Cr,{round:!0,color:"custom_color",onClick:function(){return K()}},"Get started"))))))),l&&i.a.createElement("div",{style:{position:"absolute",bottom:"0px",width:"100%"}},i.a.createElement(yf,null))))))},show:!0,auth:!1},{path:"/error-page",name:"Error Page",mini:"E",component:function(){var e=Cp();return i.a.createElement("div",{className:e.contentCenter},i.a.createElement(vo,null,i.a.createElement(xo,{md:12},i.a.createElement("h1",{className:e.title},"404"),i.a.createElement("h2",{className:e.subTitle},"Page not found :("),i.a.createElement("h4",{className:e.description},"Ooooups! Looks like you got lost."))))},show:!0,auth:!0},{path:"/maintenance-mode",name:"Maintenance Mode",mini:"E",component:function(){var e=Bp();return i.a.createElement("div",{className:e.contentCenter},i.a.createElement(vo,null,i.a.createElement(xo,{md:12},i.a.createElement("h1",{className:e.title},"\\o/"),i.a.createElement("h2",{className:e.subTitle},"Plataforma em atualiza\xe7\xe3o :)"),i.a.createElement("h4",{className:e.description,style:{color:"#FFFFFF"}},"Tente acessar novamente em alguns minutos. Estamos implementando melhorias para melhor produtividade no seu dia a dia."))))},show:!1,auth:!1},{path:"/offline-detect",name:"Offline detect",mini:"O",component:function(){var e=Yp();return i.a.createElement("div",{className:e.contentCenter},i.a.createElement(vo,null,i.a.createElement(xo,{md:12},i.a.createElement("h1",{className:e.title},'"/'),i.a.createElement("h2",{className:e.subTitle},"Parece que voc\xea est\xe1 OFF-LINE"),i.a.createElement("h4",{className:e.description,style:{color:"#FFFFFF"}},"Verifique a conex\xe3o de sua internet e tente novamente."),i.a.createElement("h4",{className:e.description,style:{color:"#FFFFFF"}},"Caso voc\xea esteja com conex\xe3o de internet ativa e ainda esteja visualizando esta p\xe1gina ap\xf3s algumas tentativas, favor entrar em contato com nosso suporte."),i.a.createElement("h4",{className:e.description,style:{color:"#FFFFFF"}},i.a.createElement("a",{href:"/login",target:"_self"},"Clique aqui para tentar novamente")))))},show:!1,auth:!1}]},{path:"/calendar",name:"Calendar",icon:"date_range",component:sp,show:!0,auth:!0,search:!0,subMenu:!0,permission:1,searchFields:["text","tags","users","priority","risk","complexity","impact","groups","status"]},{path:"/acc",name:"Account",icon:"business",alias:"account",component:Pm,show:!0,auth:!0,subMenu:!0,permission:1,AppAccess:["planAdmin"],tabs:[{path:"resume",name:"resume",alias:"resume",icon:"home",show:!0,auth:!0,AppAccess:["planAdmin"]},{path:"profile",name:"profile",alias:"profile",icon:"badge",show:!0,auth:!0,AppAccess:["masterAdmin"]},{path:"whiteLabel",name:"whiteLabel",alias:"whiteLabel",icon:"palette",show:!0,auth:!0,AppAccess:["masterAdmin"],accountHas:["whiteLabel"]}]},{path:"/library",name:"library",alias:"library",component:Fp,icon:"folder",show:!0,auth:!0,permission:1,hashId:!1,search:!0,subMenu:!0,searchFields:["text"]},{path:"/subscriptionUpgrade",name:"subscriptionUpgrade",alias:"subscriptionUpgrade",component:function(){var e=Dm();return i.a.createElement("div",{className:e.contentCenter},i.a.createElement(vo,null,i.a.createElement(xo,{md:12},i.a.createElement("h1",{className:e.title,style:{color:dt("color")}},"\\o/"),i.a.createElement("h2",{className:e.subTitle,style:{color:dt("menu")}},"Voc\xea j\xe1 utilizou o n\xfamero de usu\xe1rios contratados"),i.a.createElement("h4",{className:e.description,style:{color:dt("menu")}},"Entre em contato com nossos consultores para solicitar um upgrade do seu plano."))))},icon:"upgrade",show:!0,auth:!0,permission:1,hashId:!1},{path:"/deniedAccess",name:"deniedAccess",alias:"deniedAccess",component:function(){var e=Am();return i.a.createElement("div",{className:e.contentCenter},i.a.createElement(vo,null,i.a.createElement(xo,{md:12},i.a.createElement("h1",{className:e.title,style:{color:dt("color")}},"\\o/"),i.a.createElement("h2",{className:e.subTitle,style:{color:dt("menu")}},lt("$__accessDenied","*")),i.a.createElement("h4",{className:e.description,style:{color:dt("menu")}},lt("$__accessDeniedDescription","*")))))},icon:"upgrade",show:!0,auth:!0,permission:1,hashId:!1}],zm=function(e){return Object(h.a)(Object(h.a)({},rr),{},{menu:{position:"relative",borderRight:dt("color"),display:"flex",flexDirection:"column",alignItems:"center"},menuExpanded:{position:"relative",borderRight:dt("color"),display:"flex",flexDirection:"column",alignItems:"baseline"},button:{padding:"7px 0px",display:"flex",justifyContent:"center"},buttonExpanded:{padding:"7px 0px",display:"flex",justifyContent:"left",width:"100%"},buttonColor:{position:"relative",float:"left",width:"calc(100% + 20px)",padding:"20px 12px",marginLeft:"-12px",display:"flex",justifyContent:"center",backgroundColor:dt("color")},buttonColorExpanded:{position:"relative",float:"left",width:"calc(100% + 20px)",padding:"12px 12px 12px 20px",marginLeft:"-12px",display:"flex",backgroundColor:dt("color")},separator:{position:"relative",float:"left",width:"100%",padding:"7px",borderTop:"1px solid ".concat(dt("medium",.5)),marginTop:"15px",marginBottom:"0px",height:"1px"}})};function Mm(){Mm=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Bm=function(e){var t=De.getState().db,r=window.location.hash.split("/");r[0]=r[0].replace("#","");var n=xt(),a=r[0]&&36===r[0].length&&t.cards[r[0]]&&"plan"===t.cards[r[0]].type?ia(r[0]):null,o=r&&r.length>0&&36===r[0].length&&t.cards[r[0]]&&t.cards[r[0]].image?t.cards[r[0]].image:on.a,c=[];return t.cards[r[0]]&&t.cards[r[0]].client&&Object.keys(t.cards).filter((function(e){return!t.cards[e].deleted&&t.cards[e].client&&t.cards[e].client===t.cards[r[0]].client})).length>1&&Object.keys(t.cards).filter((function(e){return!t.cards[e].deleted&&t.cards[e].client===t.cards[r[0]].client&&"plan"===t.cards[e].type})).map((function(e){c.push(Object(h.a)(Object(h.a)({name:t.cards[e].name},t.cards[e].image?{avatar:t.cards[e].image}:{icon:"view_comfy"}),{},{onClick:function(){s.push("sp#".concat(t.cards[e]._id,"/dashboard"))}}))})),i.a.createElement(et,{title:i.a.createElement(i.a.Fragment,null,t.cards[r[0]].name)},i.a.createElement("div",{style:Object(h.a)({display:"flex",width:"100%",justifyContent:"left",alignItems:"center"},a&&parseInt(a)>3||n.owner||n.planAdmin||n.planEdit||n.planModerate?{cursor:"pointer"}:{}),id:"plan_identification",onClick:function(){(a&&parseInt(a)>3||n.owner||n.planAdmin||n.planEdit||n.planModerate)&&e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{db:"cards",id:r[0],module:"cardEdit",activeModule:"cardEdit",data:t.cards[r[0]]}))}},i.a.createElement("div",{style:{width:"30px",height:"30px",backgroundColor:"black",marginLeft:"7px",marginRight:"3px",borderRadius:"11px",backgroundImage:'url("'.concat(o,'")'),backgroundSize:"cover",backgroundPosition:"center center"}}),e.expanded&&i.a.createElement("div",{style:{width:"100%",zIndex:1}},t.cards[r[0]].client&&t.users[t.cards[r[0]].client]&&i.a.createElement("div",{style:{fontSize:"12px",fontWeight:"bold",marginLeft:"15px"}},t.users[t.cards[r[0]].client].name),i.a.createElement("div",{style:{fontSize:"12px",marginLeft:"7px",maxWidth:"calc(100% - 60px)",display:"flex",justifyContent:"space-between"},id:"client_plan_switch"},0===c.length?t.cards[r[0]].name:i.a.createElement(En,{text:t.cards[r[0]].name,icon:"change_circle",transparent:!0,maxWidth:"200px",options:c})))))},Ym=Object($e.b)((function(e,t){return Object(h.a)(Object(h.a)({},t),{},{store:{search:e.search,chat:e.chat}})}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.db,n=t.search,a=t.session,o=i.a.useState(!1),c=Object(Be.a)(o,2),l=c[0],u=c[1],d=i.a.useState(!1),p=Object(Be.a)(d,2),f=p[0],m=p[1],g=Object(Lt.a)(zm)(),v=window.location.pathname.split("/"),y="/".concat(v[1]),b=e.expanded;i.a.useEffect((function(){return n&&n.users&&n.users.selected&&Object.keys(n.users.selected).filter((function(e){return!0===n.users.selected[e]})).length>0||e.reduxFunction("ASYNC","SET_SESSION",Object(h.a)(Object(h.a)({},De.getState().session),{},{cards:Object(h.a)(Object(h.a)({},De.getState().session.cards),{},{adminViewLoader:!1,adminView:!1})})),function(){e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{viewList:!1}))}}),[n.users.selected]);var x=window.location.hash.split("/");x[0]=x[0].replace("#","");var _="".concat(y,"#").concat(x[0]?x[0]:"tab"),w=xt(),E=(x[0]&&36===x[0].length&&r.cards[x[0]]&&"plan"===r.cards[x[0]].type&&ia(x[0]),function(t){u(t);var r=De.getState().db.cards;Object.keys(r).map((function(e){t&&r[e]&&!r[e]._expanded&&(r[e]._expanded=t),!t&&r[e]&&r[e]._expanded&&(r[e]._expanded=t)})),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cardsExpanded:t,cards:r}))}),O=function(){var t=Object(Me.a)(Mm().mark((function t(r){var n;return Mm().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(m(!0),De.getState().session.cards.adminViewLoader){t.next=8;break}return t.next=4,Tn(e,null,!0);case 4:n=t.sent,(De.getState().session.cards.adminViewLoader||n)&&(m(!1),e.reduxFunction("ASYNC","SET_SESSION",Object(h.a)(Object(h.a)({},De.getState().session),{},{cards:Object(h.a)(Object(h.a)({},De.getState().session.cards),{},{adminViewLoader:!0,adminView:!De.getState().session.cards.adminView})}))),t.next=10;break;case 8:m(!1),e.reduxFunction("ASYNC","SET_SESSION",Object(h.a)(Object(h.a)({},De.getState().session),{},{cards:Object(h.a)(Object(h.a)({},De.getState().session.cards),{},{adminViewLoader:!0,adminView:!De.getState().session.cards.adminView})}));case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),j=function(e){s.push(e)};return i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:b?g.menuExpanded:g.menu},i.a.createElement("div",{className:b?g.buttonExpanded:g.button},i.a.createElement(rn,{icon:b?"menu_open":"read_more",text:b?lt("$__collapsingMenu",1):null,title:b?null:lt("$__expandingMenu",1),iconColor:dt("subMenuTextColor"),textColor:dt("subMenuTextColor"),onClick:function(){e.subMenuExpanded(!b)},size:"21px"})),$m.filter((function(e){return!(x[1]&&e.tabs&&e.tabs.filter((function(e){return e.path===x[1]})).length>0&&!1===e.tabs.filter((function(e){return e.path===x[1]}))[0].search)&&(e.path===y&&"true"===String(e.search)||void 0)})).length>0&&!e.chat&&i.a.createElement("div",{className:b?g.buttonExpanded:g.button,id:"sideBar_subMenu_filters"},i.a.createElement(rn,{icon:"filter_alt",text:b?lt("$__filters",1):null,title:b?null:lt("$__filters",1),iconColor:dt("subMenuTextColor"),textColor:dt("subMenuTextColor"),onClick:function(){e.subMenuExpanded(!b)},size:"21px"})),b&&i.a.createElement(i.a.Fragment,null,$m.filter((function(e){return!(x[1]&&e.tabs&&e.tabs.filter((function(e){return e.path===x[1]})).length>0&&!1===e.tabs.filter((function(e){return e.path===x[1]}))[0].search)&&(e.path===y&&"true"===String(e.search)||void 0)})).length>0&&!e.chat&&i.a.createElement("div",{style:{position:"relative",width:"100%",clear:"both"},id:"sideBar_subMenu_filters_options"},i.a.createElement(wh,null))),("/files"===window.location.pathname||"/t"===window.location.pathname||"/d"===window.location.pathname||"/sp"===window.location.pathname&&x[0]&&36===x[0].length)&&i.a.createElement(i.a.Fragment,null,l?i.a.createElement("div",{className:b?g.buttonExpanded:g.button,id:"sideBar_subMenu_options_collapseCards"},i.a.createElement(rn,{text:b?lt("$__collapseCards",1):null,textColor:dt("subMenuTextColor"),title:b?null:lt("$__collapseCards",1),icon:"close_fullscreen",iconColor:dt("subMenuTextColor"),onClick:function(){E(!1)},size:"21px"})):i.a.createElement("div",{className:b?g.buttonExpanded:g.button,id:"sideBar_subMenu_options_expandingCards"},i.a.createElement(rn,{text:b?lt("$__expandingCards",1):null,textColor:dt("subMenuTextColor"),title:b?null:lt("$__expandingCards",1),icon:"open_in_full",iconColor:dt("subMenuTextColor"),onClick:function(){E(!0)},size:"21px"}))),("/d"===y&&"dayTasks"===x[1]||"/t"===y&&n&&n.users&&n.users.selected&&Object.keys(n.users.selected).filter((function(e){return!0===n.users.selected[e]})).length>0||"/sp"===y&&!x[0])&&w&&(w.owner||w.plan&&(w.planAdmin||w.planModerate))&&i.a.createElement("div",{className:b?g.buttonExpanded:g.button,style:{display:"flex"}},f?i.a.createElement(Ct.a,{size:25,style:{margin:"auto",display:"flex"}}):i.a.createElement(rn,{text:b?lt("$__adminViewDescription",1):null,title:b?null:lt("$__adminViewDescription",1),textColor:De.getState().session.cards.adminView?dt("color"):dt("subMenuTextColor"),iconColor:De.getState().session.cards.adminView?dt("color"):dt("subMenuTextColor"),icon:"groups",id:"sideBar_subMenu_options_setAdminView",onClick:function(){O()},size:"21px"})),"/t"===window.location.pathname&&i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:b?g.buttonExpanded:g.button,id:"sideBar_subMenu_options_setAdminView"},i.a.createElement(rn,{text:b?lt("$__viewInColumns",1):null,textColor:r.viewList?dt("subMenuTextColor"):dt("color"),iconColor:r.viewList?dt("subMenuTextColor"):dt("color"),title:b?null:lt("$__viewInColumns",1),icon:"view_column",onClick:function(){e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{viewList:!1}))},size:"21px"})),i.a.createElement("div",{className:b?g.buttonExpanded:g.button,id:"sideBar_subMenu_options_viewInList"},i.a.createElement(rn,{text:b?lt("$__viewInList",1):null,title:b?null:lt("$__viewInList",1),icon:"list",iconColor:r.viewList?dt("color"):dt("subMenuTextColor"),textColor:r.viewList?dt("color"):dt("subMenuTextColor"),onClick:function(){e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{viewList:!0}))},size:"21px"}))),i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:g.separator}),x[0]&&36===x[0].length&&r.cards[x[0]]&&i.a.createElement("div",{style:{zIndex:1},id:"sideBar_subMenu_plan_infos"},i.a.createElement(Bm,Object.assign({expanded:b},e))),$m.filter((function(e){return e.path===y})).length>0&&$m.filter((function(e){return e.path===y}))[0].tabs&&$m.filter((function(e){return e.path===y}))[0].tabs.length>0&&($m.filter((function(e){return e.path===y}))[0].hashId&&x[0]&&36===x[0].length||!$m.filter((function(e){return e.path===y}))[0].hashId)&&i.a.createElement(i.a.Fragment,null,$m.filter((function(e){return e.path===y}))[0].tabs.filter((function(e){return!e.hashId&&(!x[0]||x[0]&&x[0].length<36)||e.hashId&&x[0]&&36===x[0].length})).map((function(e,t){var n=!1,o=x[0]&&36===x[0].length?r.cards[x[0]]:null;if(e&&e.AppAccess&&e.AppAccess.length>0?e.AppAccess.map((function(e){w[e]&&(n=!0)})):e&&!e.AppAccess&&(n=!0),o&&o.isTemplate&&!e.templates&&(n=!1),e&&e.AppAccess&&e.AppAccess.planAdmin&&!(w&&w.plan&&w.planAdmin)&&(n=!1),o&&o.planType&&"operational"===o.planType&&("matrix"===e.alias||"guidelines"===e.alias||"objectives"===e.alias||"goals"===e.alias)&&(n=!1),o&&"board"===e.alias&&(!o.planType||o.planType&&"operational"!==o.planType)&&(n=!1),e.accountHas&&0===e.accountHas.filter((function(e){return a[e]})).length&&(n=!1),(w.owner||w&&w.enabled&&n)&&e.show)return i.a.createElement("div",{className:b?g.buttonExpanded:g.button,key:t,id:"sideBar_subMenu_plan_".concat(e.alias)},i.a.createElement(rn,{text:b?"matrix"===e.alias?"MATRIX SWOT":lt("$__".concat(e.alias),1):null,title:b?null:"matrix"===e.alias?"MATRIX SWOT":lt("$__".concat(e.alias),1),icon:e.icon,iconColor:x[1]===e.path?dt("subMenuTextColorActive"):dt("subMenuTextColor"),textColor:x[1]===e.path?dt("subMenuTextColorActive"):dt("subMenuTextColor"),onClick:function(){j("".concat(_,"/").concat(e.path))},size:"21px"}))}))),x[0]&&36===x[0].length&&r.cards[x[0]]&&r.cards[x[0]].miroBoard&&i.a.createElement("div",{className:b?g.buttonExpanded:g.button,id:"sideBar_subMenu_plan_miroBoard"},i.a.createElement(rn,{text:b?lt("$__planningBoard",1):null,title:b?null:lt("$__planningBoard",1),icon:"developer_board",iconColor:"planningBoard"===x[1]?dt("color"):dt("subMenuTextColor"),textColor:"planningBoard"===x[1]?dt("color"):dt("subMenuTextColor"),onClick:function(){j("".concat(_,"/","planningBoard"))},size:"21px"})),"/t"===window.location.pathname&&i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:g.separator}),i.a.createElement("div",{className:b?g.buttonExpanded:g.button,id:"sideBar_subMenu_lastTasks"},i.a.createElement(rn,{text:b?lt("$__lateTasks",1):null,title:b?null:lt("$__lateTasks",1),icon:"event_busy",iconColor:"late"===x[1]?dt("color"):dt("subMenuTextColor"),textColor:"late"===x[1]?dt("color"):dt("subMenuTextColor"),onClick:function(){s.push("t#tab/lateTasks")},size:"21px"})),i.a.createElement("div",{className:b?g.buttonExpanded:g.button,id:"sideBar_subMenu_nextTasks"},i.a.createElement(rn,{text:b?lt("$__nextTasks",1):null,title:b?null:lt("$__nextTasks",1),icon:"date_range",iconColor:"nextTasks"===x[1]?dt("color"):dt("subMenuTextColor"),textColor:"nextTasks"===x[1]?dt("color"):dt("subMenuTextColor"),onClick:function(){s.push("t#tab/nextTasks")},size:"21px"}))))))}));function Gm(){Gm=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}r(168).config();var Rm=Object($e.b)((function(e){return{store:{chat:e.chat,session:e.session}}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(hf)((function(e){De.getState().chat;var t=e.classes,r=i.a.useState(!1),n=Object(Be.a)(r,2),a=n[0],o=n[1],c=i.a.useState(null),l=Object(Be.a)(c,2),u=l[0],d=l[1];i.a.useEffect((function(){}),[]);var p=window.location.hash.split("/");p[0]=p[0].replace("#",""),xt(),po();var f=function(){var t=Object(Me.a)(Gm().mark((function t(r,n){return Gm().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:console.log(n),"tags"===n?(console.log(58),o(e.subMenuExpanded),e.setSubMenuExpanded(!1)):e.setSubMenuExpanded(a),!r||window.location.pathname===r&&n!==u||s.push(r),"chat"===n?e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},De.getState().chat),{},{open:!0})):(d(n),e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},De.getState().chat),{},{open:!1})));case 4:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}();return i.a.createElement("div",{className:t.root},i.a.createElement("div",{className:t.bar,style:{background:dt("menuColor")},id:"sideBar"},i.a.createElement("div",{className:t.logoMini,id:"sideBar_logoMini",style:{width:"100%",justifyContent:"space-between",display:"flex",cursor:"pointer",color:dt("menuButtonColor"),alignItems:"center"}},i.a.createElement("img",{src:dt("customLogo"),alt:"logo",style:{width:"calc(100% - 70px)",marginLeft:"15px",minHeight:"min-content"},onClick:function(){f("/d#tab/resume","dashboard")}}),i.a.createElement("div",{style:{padding:"7px",marginRight:"7px",cursor:"pointer"},onClick:function(){e.menuExpand()},id:"sideBar_button_hideMenu"},i.a.createElement(kt,{icon:"menu",color:"parent",title:"$__hideMenu",size:"22px"}))),i.a.createElement("div",{style:{position:"absolute",top:"100px",bottom:"0px",overflowX:"auto",width:"100%"}},i.a.createElement("div",{className:t.item,id:"sideBar_button_dashboard"},i.a.createElement("div",{className:"/d"===window.location.pathname?t.itemButtomActive:t.itemButtom,onClick:function(){f("/d#tab/resume","dashboard")},style:{color:dt("menuButtonColor")}},i.a.createElement(kt,{icon:"dashboard",badgeColor:"primary",color:"parent",badgeVisible:!0,title:"$__dashboard",size:"21px",style:{marginBottom:"0px",marginRight:"7px"}}),lt("$__dashboard","*"))),i.a.createElement("div",{className:t.item,id:"sideBar_button_brightAndConnected"},i.a.createElement("div",{className:"/bright-and-connected"===window.location.pathname?t.itemButtomActive:t.itemButtom,onClick:function(){f("/bright-and-connected#tab/home","bright-and-connected")},style:{color:dt("menuButtonColor")}},i.a.createElement(kt,{icon:U.a,badgeColor:"primary",color:"parent",badgeVisible:!0,title:"BRIGHT & CONNECTED",size:"21px",style:{marginRight:"7px"}}),"BRIGHT & CONNECTED")),i.a.createElement("div",{className:t.item,id:"sideBar_button_StrategyAndPlans"},i.a.createElement("div",{className:"/sp"===window.location.pathname?t.itemButtomActive:t.itemButtom,onClick:function(){f("/sp#tab/home","StrategyAndPlans")},style:{color:dt("menuButtonColor")}},i.a.createElement(kt,{icon:"view_comfy",badgeColor:"primary",color:"parent",badgeVisible:!0,title:lt("$__StrategyAndPlans"),size:"21px",style:{marginBottom:"0px",marginRight:"7px"}}),lt("$__StrategyAndPlans","*"))),i.a.createElement("div",{className:t.item,id:"sideBar_button_myTasks"},i.a.createElement("div",{className:"/t"===window.location.pathname?t.itemButtomActive:t.itemButtom,onClick:function(){f("/t#tab/myTasks","myTasks")},style:{color:dt("menuButtonColor")}},i.a.createElement(kt,{icon:"task",badgeColor:"primary",color:"parent",badgeVisible:!0,title:lt("$__activities"),size:"21px",style:{marginBottom:"0px",marginRight:"7px"}}),lt("$__activities","*"))),i.a.createElement("div",{className:t.item,id:"sideBar_button_library"},i.a.createElement("div",{className:"/library"===window.location.pathname?t.itemButtomActive:t.itemButtom,onClick:function(){f("/library","library")},style:{color:dt("menuButtonColor")}},i.a.createElement(kt,{icon:"folder",badgeColor:"primary",color:"parent",badgeVisible:!0,title:lt("$__library"),size:"21px",style:{marginBottom:"0px",marginRight:"7px"}}),lt("$__library","*"))),i.a.createElement("div",{className:t.item,id:"sideBar_button_tags"},i.a.createElement("div",{className:"/tags"===window.location.pathname?t.itemButtomActive:t.itemButtom,onClick:function(){f("/tags","tags")},style:{color:dt("menuButtonColor")}},i.a.createElement(kt,{icon:"turned_in",badgeColor:"primary",color:"parent",badgeVisible:!0,title:lt("$__tags"),size:"21px",style:{marginBottom:"0px",marginRight:"7px"}}),lt("$__tags","*"))),i.a.createElement("div",{className:t.item,id:"sideBar_button_calendar"},i.a.createElement("div",{className:"/calendar"===window.location.pathname?t.itemButtomActive:t.itemButtom,onClick:function(){f("/calendar","calendar")},style:{color:dt("menuButtonColor")}},i.a.createElement(kt,{icon:"event",badgeColor:"primary",color:"parent",badgeVisible:!0,title:lt("$__calendar"),size:"21px",style:{marginBottom:"0px",marginRight:"7px"}}),lt("$__calendar","*"))),i.a.createElement("div",{className:t.separator}),i.a.createElement("div",{className:t.item,id:"sideBar_button_chat"},i.a.createElement("div",{className:De.getState().chat.open?t.itemButtomActive:t.itemButtom,onClick:function(){e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},De.getState().chat),{},{open:!De.getState().chat.open}))},style:{color:dt("menuButtonColor")}},i.a.createElement(Pu,null,i.a.createElement(kt,{icon:"chat",color:"parent",title:"$__chat",size:"21px",style:{marginBottom:"0px",marginRight:"7px"}})),lt("$__chat","*"))),i.a.createElement("div",{className:t.item,id:"sideBar_button_calendar"},i.a.createElement("div",{className:t.itemButtom,onClick:function(){window.open("https://support.machen.ai","_blank")},style:{color:dt("menuButtonColor")}},i.a.createElement(kt,{icon:"help_outline",badgeColor:"primary",color:"parent",badgeVisible:!0,title:lt("$__support"),size:"21px",style:{marginBottom:"0px",marginRight:"7px"}}),lt("$__support","*")))),"myDay"!==u&&"timer"!==u&&"chat"!==u&&("/t"===window.location.pathname||"/sp"===window.location.pathname||"/c"===window.location.pathname||"/d"===window.location.pathname||"/p"===window.location.pathname||"/acc"===window.location.pathname||"/bright-and-connected"===window.location.pathname||"/library"===window.location.pathname||"/notifications"===window.location.pathname||"/calendar"===window.location.pathname||"/masterAdmin"===window.location.pathname)&&i.a.createElement("div",{className:e.subMenuExpanded?t.moduleExpanded:t.module,id:"sideBar_subMenu",style:{background:dt("subMenuColor"),borderRight:"4px solid ".concat(dt("color"))}},i.a.createElement(Ym,{hashs:p,subMenuExpanded:function(t){e.setSubMenuExpanded(t)},expanded:e.subMenuExpanded})),"myDay"!==u&&"timer"!==u&&"chat"!==u&&"/tags"===window.location.pathname&&i.a.createElement("div",{className:t.moduleExpanded,id:"sideBar_session_tags"},i.a.createElement(Nu,{onLoad:function(){e.setSubMenuExpanded(!0)},onExit:function(){return e.setSubMenuExpanded(!1)}})),i.a.createElement("div",{style:{position:"absolute",bottom:0,left:15,color:"#c0b283",fontSize:"10px"}},"V:",V.version)))})));var Hm=Object($e.b)((function(e,t){return Object(h.a)(Object(h.a)({},t),{},{unreadeds:e.chats.unreadeds,chats:e.chats.timelines,chat:e.chat})}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState().chat;return e.unreadeds,i.a.createElement("div",{id:"chatNotificationsBt",style:{zIndex:"100 !important"}},i.a.createElement(Nt.a,{"aria-haspopup":"true",onClick:function(){e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},t),{},{open:!t.open}))}},i.a.createElement(Pu,null,i.a.createElement(kt,{icon:"chat_bubble_outline",color:"parent",title:"$__chat"}))))}));function Wm(){Wm=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Um=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.db,n=t.timeline,a=t.session,o=i.a.useState(!1),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.useState({}),d=Object(Be.a)(u,2),p=d[0],f=d[1],h=i.a.useState("users"),m=Object(Be.a)(h,2),g=m[0],v=m[1],y=i.a.useRef(null),b=Ve()().tz("America/Sao_Paulo").format("YYYY/MM/DD");xt(),i.a.useEffect((function(){x()}),[n]);var x=function(){var e=Object(Me.a)(Wm().mark((function e(){var t;return Wm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=po(),f(t),p.total>0&&0===p.users&&v("groups"),"groups"===g&&p.total>0&&0===p.groups&&v("users");case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),_=function(e){y.current&&y.current.contains(e.target)||s(!1)},w=Object.keys(r.cards).filter((function(e){return!r.cards[e].deleted&&!r.cards[e].checklist&&r.cards[e]._users&&r.cards[e]._users[a._id]&&r.cards[e]._users[a._id].myDay&&Ve()(new Date(1e3*r.cards[e]._users[a._id].myDay)).tz("America/Sao_Paulo").format("YYYY/MM/DD")===b})).map((function(e){return r.cards[e]}));return 0===w.length?i.a.createElement(i.a.Fragment,null):i.a.createElement("div",{id:"notificationsBt",style:{zIndex:"100 !important"}},i.a.createElement(Nt.a,{ref:y,"aria-controls":l?"menu-list-grow":void 0,"aria-haspopup":"true",onClick:function(){s((function(e){return!e}))}},i.a.createElement(Pt.a,{overlap:"rectangular",badgeContent:w.filter((function(e){return"completed"!==e.status})).length,color:"secondary"},i.a.createElement(kt,{icon:"hourglass_empty",color:"parent",title:"$__myDay"}))),w.length>0&&i.a.createElement(mn.a,{open:l,anchorEl:y.current,role:void 0,transition:!0,disablePortal:!0,style:{width:"400px"}},(function(e){var t=e.TransitionProps,r=e.placement;return i.a.createElement(fn.a,Object.assign({},t,{style:{transformOrigin:"bottom"===r?"center top":"center bottom"}}),i.a.createElement(hn.a,null,i.a.createElement(pn.a,{onClickAway:_},i.a.createElement("div",{style:{height:"auto",maxHeight:"calc(90vh - 80px)",width:"100%",overflowY:"auto"}},i.a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"7px"}},lt("$__myDay")),i.a.createElement(Si,{noChecklist:!0,noDelete:!0,showCard:!0,myDay:!0,db:"cards"})))))})))})),Vm=Object(Lt.a)((function(){return{unReaded:{padding:"7px",borderBottom:"solid 1px rgba(0,0,0,0.1)",width:"100%",maxWidth:"100%",opacity:1,borderLeft:"solid red 2px"},Readed:{padding:"7px",borderBottom:"solid 1px rgba(0,0,0,0.1)",width:"100%",opacity:.5,maxWidth:"100%"}}}));var qm=Object($e.b)((function(e){return{store:e}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=(t.chat,t.notifications,t.timeline),n=t.functions,a=t.session,o=n.socket,c=e.data,l=i.a.useState(!1),s=Object(Be.a)(l,2),u=(s[0],s[1],i.a.useState(!1)),d=Object(Be.a)(u,2),p=d[0],f=d[1],m=Vm();i.a.useEffect((function(){return function(){}}),[]);var g="cards";c&&c.cardId&&De.getState().db.users[c.cardId]&&(g="users");var v=function(){var t=ma(c.cardId);e.reduxFunction("ASYNC","SET_NOTIFICATIONS",Object(h.a)(Object(h.a)({},De.getState().notifications),{},{total:De.getState().notifications.total-t.total})),co(e,{readedBy:a._id,id:e.cardId,db:"cards",type:"all"}),o.emit("data",{module:"chat",method:"put",action:"read"},{readedBy:a._id,id:c.cardId,db:"cards",type:"all"},(function(){})),De.getState().db&&De.getState().db.cards&&De.getState().db.cards[c.cardId]&&e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},c.cardId,Object(h.a)(Object(h.a)({},De.getState().db.cards[c.cardId]),{},{_notifications:{comment:0,kpi:0,timer:0,log:0}})))})),e.onRead&&setTimeout((function(){e.onRead()}),1e3)},y=Object.keys(r[c.cardId]).filter((function(e){return a&&a._id&&r[c.cardId]&&r[c.cardId][e]&&r[c.cardId][e].user&&r[c.cardId][e].user._id&&r[c.cardId][e].user._id!==a._id&&(!r[c.cardId][e].readedBy||r[c.cardId][e].readedBy&&!r[c.cardId][e].readedBy[a._id])}));return i.a.createElement("div",{className:c.readed?m.Readed:m.unReaded,style:{width:369,overflow:"auto"}},c.cardId&&De.getState().db.cards[c.cardId]&&i.a.createElement("div",{style:De.getState().db.cards[c.cardId]&&"chatGroup"===De.getState().db.cards[c.cardId].type?{cursor:"pointer"}:{}},i.a.createElement(oc,{setPrivate:function(e){f(e)},db:"cards",data:De.getState().db.cards[c.cardId],onlyOption:!(!De.getState().db.cards[c.cardId]||"chatGroup"!==De.getState().db.cards[c.cardId].type)})),y.length>0&&(!De.getState().db.cards[c.cardId].private||De.getState().db.cards[c.cardId].private&&(De.getState().controls.lockPrivate||p))?i.a.createElement(i.a.Fragment,null,y.sort((function(e,t){return parseInt(r[c.cardId][e].created_at)>parseInt(r[c.cardId][t].created_at)?-1:parseInt(r[c.cardId][e].created_at)<parseInt(r[c.cardId][t].created_at)?1:0})).map((function(t,r){return i.a.createElement("div",{key:"".concat(t),style:{position:"relative",marginBottom:"33px",paddingBottom:15,display:"-webkit-box"}},i.a.createElement(Fc,{storie:Object(h.a)(Object(h.a)({},De.getState().timeline&&De.getState().timeline[c.cardId]&&De.getState().timeline[c.cardId][t]?De.getState().timeline[c.cardId][t]:{}),{},{idRel:t}),boxStyle:{width:"calc(100% - 10px) !important",maxWidth:"285px"},db:g,noReactions:!0,noReply:!0,openLightBox:function(r){e.reduxFunction("ASYNC","LIGHTBOX",{open:!0,files:De.getState().timeline[c.cardId][t].files?De.getState().timeline[c.cardId][t].files:[],file:r})}}),r+1===y.length?i.a.createElement("div",{style:{position:"absolute",height:"93px",left:0,bottom:"-33px",right:8,background:"linear-gradient(0deg, rgba(255,255,255,1) 34%, rgba(255,255,255,0) 100%)"}},i.a.createElement("div",{style:{position:"absolute",bottom:"0px",display:"flex",justifyContent:"space-between",width:"100%"}},i.a.createElement(At,{title:lt("$__open",1),text:lt("$__open",1),color:dt("color"),icon:"launch",onClick:function(){e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{db:"cards",id:c.cardId,module:"cardEdit",activeModule:"cardEdit",data:De.getState().db.cards[c.cardId]})),v()},size:"13px",textSize:"13px",style:{padding:"0px !important"}}),i.a.createElement(At,{title:lt("$__markAsRead",1),text:lt("$__markAsRead",1),color:dt("color"),icon:"mark_chat_read",onClick:function(){v()},size:"13px",textSize:"13px",style:{padding:"0px !important"}}))):i.a.createElement(i.a.Fragment,null))}))):i.a.createElement(i.a.Fragment,null))}));function Xm(){Xm=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Jm=Object($e.b)((function(e){return{store:{notifications:e.notifications,timeline:e.timeline,session:e.session,cards:e.db.cards}}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.notifications,n=t.session,a=t.timeline,o=t.functions.socket,c=i.a.useState(!1),l=Object(Be.a)(c,2),s=l[0],u=l[1],d=i.a.useState(!1),p=Object(Be.a)(d,2),f=p[0],m=p[1],g=i.a.useState(7),v=Object(Be.a)(g,2),y=v[0],b=v[1],x=i.a.useState(!1),_=Object(Be.a)(x,2),w=_[0],E=_[1],j=i.a.useRef();i.a.useEffect((function(){return s||(u(!0),S()),function(){u(!1)}}),[]),i.a.useEffect((function(){return S(0,0,!0),function(){}}),[e.store.timeline,e.store.notifications,e.store.cards]);var S=function(){var t=Object(Me.a)(Xm().mark((function t(){var r,n,a,o,i,c,l,s,u,d,p=arguments;return Xm().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=p.length>0&&void 0!==p[0]?p[0]:0,n=p.length>1&&void 0!==p[1]?p[1]:0,a=p.length>2&&void 0!==p[2]&&p[2],C<(o=r)&&(o=0),!a){t.next=9;break}t.t0={data:[]},t.next=12;break;case 9:return t.next=11,Sn.post("/M_UnReadedList",{skip:o,limit:n});case 11:t.t0=t.sent;case 12:if(i=t.t0,c=0,l=0,s=0,t.prev=16,!(a||i&&i.data&&i.data.length>0)){t.next=29;break}return u=Object(h.a)({},De.getState().timeline),d=[],t.next=22,new Promise((function(e,t){i.data.map((function(t,r){c=t.total,d.push(t.card),t.timeline&&t.timeline.length>0&&t.timeline.map((function(e){var t={},r={};e&&e.params&&e.params.readedBy&&e.params.readedBy.filter((function(e){return e._id})).length>0&&e.params.readedBy.map((function(e){t=Object(h.a)(Object(h.a)({},t),{},Object(O.a)({},e._id,e))})),e&&e.params&&e.params.reactions&&e.params.reactions.filter((function(e){return e._id})).length>0&&e.params.reactions.map((function(e){r=Object(h.a)(Object(h.a)({},r),{},Object(O.a)({},e.type,Object(h.a)(Object(h.a)({},r[e.type]),{},Object(O.a)({},e._id,e))))})),parseInt(l)<parseInt(e.data.created_at)&&(l=parseInt(e.data.created_at)),(0===s||s>parseInt(e.data.created_at))&&(s=parseInt(e.data.created_at)),u=Object(h.a)(Object(h.a)({},u),{},Object(O.a)({},e.nodeId,Object(h.a)(Object(h.a)({},u&&u[e.nodeId]?u[e.nodeId]:{}),{},Object(O.a)({},e.data._id,Object(h.a)(Object(h.a)(Object(h.a)({},e.data),e.params),{},{readedBy:t,_reactions:r})))))})),r+1===i.data.length&&e(!0)}))}));case 22:t.sent&&e.reduxFunction("ASYNC","SET_NOTIFICATIONS",{total:c>0?c:0,lastNotification:l,firstNotification:s}),e.reduxFunction("ASYNC","SET_TIMELINE",Object(h.a)(Object(h.a)({},De.getState().timeline),u)),Fn(e,d),m(!1),t.next=30;break;case 29:m(!1);case 30:t.next=35;break;case 32:t.prev=32,t.t1=t.catch(16),console.log(t.t1);case 35:m(!1);case 36:case"end":return t.stop()}}),t,null,[[16,32]])})));return function(){return t.apply(this,arguments)}}(),k=function(){var t=Object(Me.a)(Xm().mark((function t(){return Xm().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:ft({message:lt("$__confirmClearAllNotifications",1),variant:"warning",persist:!1,horizontal:"right",confirm:function(){E(!1);var t=Object(h.a)({},De.getState().timeline);Object.keys(t).map((function(e){t&&t[e]&&Object.keys(t[e]).filter((function(r){return De.getState().db.cards[e]&&"chatGroup"!==De.getState().db.cards[e].type&&(!t[e][r].readedBy||t[e][r].readedBy&&!t[e][r].readedBy[n._id])})).map((function(r){delete t[e][r]}))})),e.reduxFunction("ASYNC","SET_TIMELINE",{timeline:t}),e.reduxFunction("ASYNC","SET_NOTIFICATIONS",{total:0,lastNotification:0,firstNotification:0});try{o.emit("data",{module:"notifications",method:"put",action:"readedAll"},{})}catch(r){console.log(r)}}});case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),L=function(e){j.current&&j.current.contains(e.target)||E(!1)},C=0,I=0;return Object.keys(De.getState().db.cards).filter((function(e){var t=De.getState().db.cards[e];if("chatGroup"!==t.type&&t._users&&t._users[n._id]&&a[e]&&Object.keys(a[e]).filter((function(t){return n&&n._id&&a&&a[e]&&a[e][t]&&a[e][t].user&&a[e][t].user._id&&a[e][t].user._id!==n._id&&(!a[e][t].readedBy||a[e][t].readedBy&&!a[e][t].readedBy[n._id])})).length>0)return!0})).map((function(e,t){a[e]&&Object.keys(a[e]).filter((function(t){return n&&n._id&&a[e]&&a[e][t]&&a[e][t].user&&a[e][t].user._id&&a[e][t].user._id!==n._id&&(!a[e][t].readedBy||a[e][t].readedBy&&!a[e][t].readedBy[n._id])})).map((function(){t<=y&&(I+=1),C+=1}))})),r.total>C&&(C=r.total),0===C&&w&&E(!1),0===C?i.a.createElement(i.a.Fragment,null):i.a.createElement("div",{id:"notificationsBt",style:{zIndex:"100 !important"}},i.a.createElement(Nt.a,{ref:j,"aria-controls":w?"menu-list-grow":void 0,"aria-haspopup":"true",onClick:function(){E((function(e){return!e}))}},i.a.createElement(Pt.a,{overlap:"rectangular",badgeContent:C,color:"secondary"},i.a.createElement(kt,{icon:0===C?"notifications_none":"notifications_active",color:"parent",title:"$__notifications"}))),i.a.createElement(mn.a,{open:w,anchorEl:j.current,role:void 0,transition:!0,disablePortal:!0},(function(e){var t=e.TransitionProps,r=e.placement;return i.a.createElement(fn.a,Object.assign({},t,{style:{transformOrigin:"bottom"===r?"center top":"center bottom"}}),i.a.createElement(hn.a,null,i.a.createElement(pn.a,{onClickAway:L},i.a.createElement("div",{style:{height:"auto",maxHeight:"calc(90vh - 80px)",width:"369px",overflowY:"auto"}},i.a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"7px",width:"-webkit-fill-available"}},i.a.createElement("div",null,lt("$__notifications")),C>0?i.a.createElement(At,{title:lt("$__clearNotifications",1),text:lt("$__clearNotifications",1),color:dt("color"),icon:"clear_all",onClick:function(){k()},size:"21px",style:{padding:"0px !important"}}):i.a.createElement(i.a.Fragment,null)),Object.keys(De.getState().db.cards).filter((function(e){var t=De.getState().db.cards[e];if("chatGroup"!==t.type&&t._users&&t._users[n._id]&&a[e]&&Object.keys(a[e]).filter((function(t){return n&&n._id&&a&&a[e]&&a[e][t]&&a[e][t].user&&a[e][t].user._id&&a[e][t].user._id!==n._id&&(!a[e][t].readedBy||a[e][t].readedBy&&!a[e][t].readedBy[n._id])})).length>0)return!0})).sort((function(e,t){var r=0,o=0;return a[e]&&Object.keys(a[e]).filter((function(t){return n&&n._id&&a&&a[e]&&a[e][t]&&a[e][t].user&&a[e][t].user._id&&a[e][t].user._id!==n._id&&(!a[e][t].readedBy||a[e][t].readedBy&&!a[e][t].readedBy[n._id])})).map((function(t){parseInt(a[e][t].created_at)>r&&(r=parseInt(a[e][t].created_at))})),a[t]&&Object.keys(a[t]).filter((function(e){return a[t][e].user._id!==n._id&&(!a[t][e].readedBy||a[t][e].readedBy&&!a[t][e].readedBy[n._id])})).map((function(e){parseInt(a[t][e].created_at)>r&&(o=parseInt(a[t][e].created_at))})),r>o?-1:r<o?1:0})).map((function(e,t){return t<=y?i.a.createElement("div",{key:"".concat(e)},i.a.createElement(qm,{data:{cardId:e},onRead:function(){setTimeout((function(){S(0,8)}),2e3)},onClick:function(){E(!1)}})):i.a.createElement(i.a.Fragment,{key:"".concat(t).concat(e)})})),parseInt(De.getState().notifications.total)>I?i.a.createElement("div",{style:{width:"calc(100% - 14px)",display:"flex",justifyContent:"center",padding:7}},f?i.a.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},i.a.createElement("span",{style:{color:dt("menu"),fontSize:"12px",paddingRight:"15px",whiteSpace:"nowrap"}},lt("$__loadingNotifications")),i.a.createElement(Fo,null)):i.a.createElement(At,{title:lt("$__seeMoreNotifications",1),text:lt("$__seeMoreNotifications",1),color:dt("menu"),icon:"notifications_active",onClick:function(){S(y),b(y+7)},size:"21px",style:{padding:"0px !important"}})):i.a.createElement(i.a.Fragment,null)))))})))}));var Km=Object($e.b)((function(e){return{users:e.users}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=i.a.useState(!1),r=Object(Be.a)(t,2),n=r[0],a=r[1],o=i.a.useRef(null),c=De.getState().db,l=(c.users,xt(),window.location.hash.split("/"));l[0]=l[0].replace("#","");var s=null;36===l[0].length||l[2]&&36===l[2].length?36===l[0].length?s=l[0]:36===l[2].length&&(s=l[2]):s=null;var u=window.location.pathname.replace("/","").toLowerCase(),d=c.dataType.filter((function(e){if(("sp"===u||!e.hash&&!s||e.hash&&s)&&e.view&&Object.keys(e.view).filter((function(e){return e===u})).length>0&&(!e.view[u].pages||l[1]&&e.view[u].pages.indexOf(l[1])>-1||!l[1]&&e.view[u].pages.indexOf("none")>-1))return e})),p=function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Uh();console.log(n),e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{id:"new",activeModule:t.iniModule,db:t.db,data:Object(h.a)({type:t.name,_parent:l[0]&&c.cards[l[0]]?l[0]:null},"user"===t.data.type?{}:Object(h.a)({status:"notStarted"},r?{isTemplate:!0}:{}))}))},f=function(e){o.current&&o.current.contains(e.target)||a(!1)};function m(e){"Tab"===e.key&&(e.preventDefault(),a(!1))}return 0===d.length?i.a.createElement(i.a.Fragment,null):i.a.createElement("div",{id:"QuickAddBt"},i.a.createElement(Nt.a,{ref:o,"aria-controls":n?"menu-list-grow":void 0,"aria-haspopup":"true",onClick:function(){1===d.length?p(d[0],!(!l[1]||"template"!==l[1])):d.length>1&&a((function(e){return!e}))}},i.a.createElement(kt,{usePropagation:!0,size:"27px",color:dt("menu")},"add_box")),i.a.createElement(mn.a,{open:n,anchorEl:o.current,role:void 0,transition:!0,disablePortal:!0},(function(e){var t=e.TransitionProps,r=e.placement;return i.a.createElement(fn.a,Object.assign({},t,{style:{transformOrigin:"bottom"===r?"center top":"center bottom"}}),i.a.createElement(hn.a,null,i.a.createElement(pn.a,{onClickAway:f},i.a.createElement(_n.a,{autoFocusItem:n,id:"menu-list-grow",onKeyDown:m},d.sort((function(e,t){return e.name>t.name?-1:0})).map((function(e,t){return i.a.createElement(xn.a,{key:t,style:{color:dt("menu")},onClick:function(){a(!1),p(e)}},i.a.createElement(kt,{icon:e.icon,style:{margin:"none !important"},color:dt("menu")}),i.a.createElement("span",{style:{marginLeft:"7px"}},lt("$__".concat(e.name),1)))}))))))})))}));function Zm(){Zm=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Qm=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.db,n=t.timeline,a=t.session,o=(t.chat,i.a.useState(!1)),c=Object(Be.a)(o,2),l=(c[0],c[1]),s=i.a.useState(!1),u=Object(Be.a)(s,2),d=u[0],p=u[1],f=i.a.useState({}),h=Object(Be.a)(f,2),m=h[0],g=h[1],v=i.a.useState("users"),y=Object(Be.a)(v,2),b=y[0],x=y[1],_=i.a.useRef(null);Ve()().tz("America/Sao_Paulo").format("YYYY/MM/DD"),xt(),i.a.useEffect((function(){l(!0),w()}),[n]);var w=function(){var e=Object(Me.a)(Zm().mark((function e(){var t;return Zm().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=po(),g(t),m.total>0&&0===m.users&&x("groups"),"groups"===b&&m.total>0&&0===m.groups&&x("users");case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),E=function(e){_.current&&_.current.contains(e.target)||p(!1)},O=Object.keys(r.cards).filter((function(e){return r.cards[e]&&r.cards[e]._kpiTimer&&r.cards[e]&&r.cards[e]._users&&Object.keys(r.cards[e]._kpiTimer).filter((function(t){return r.cards[e]._kpiTimer&&r.cards[e]._kpiTimer[t]&&r.cards[e]._kpiTimer[t].userId&&a&&a._id&&r.cards[e]._kpiTimer[t].userId===a._id})).length>0&&Object.keys(r.cards[e]._users).filter((function(e){return a&&a._id&&e===a._id})).length>0})).map((function(e){return r.cards[e]}));return 0===O.length?i.a.createElement(i.a.Fragment,null):i.a.createElement("div",{id:"notificationsBt",style:{zIndex:"100 !important"}},i.a.createElement(Nt.a,{ref:_,"aria-controls":d?"menu-list-grow":void 0,"aria-haspopup":"true",onClick:function(){p((function(e){return!e}))}},i.a.createElement(Pt.a,{badgeContent:O.length,color:"secondary",overlap:"rectangular"},i.a.createElement(kt,{icon:"timer",color:"parent",title:"$__timersInProgress"}))),O.length>0&&i.a.createElement(mn.a,{open:d,anchorEl:_.current,role:void 0,transition:!0,disablePortal:!0,style:{width:"400px"}},(function(e){var t=e.TransitionProps,r=e.placement;return i.a.createElement(fn.a,Object.assign({},t,{style:{transformOrigin:"bottom"===r?"center top":"center bottom"}}),i.a.createElement(hn.a,null,i.a.createElement(pn.a,{onClickAway:E},i.a.createElement("div",{style:{height:"auto",maxHeight:"calc(90vh - 80px)",width:"100%",overflowY:"auto"}},i.a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"7px"}},lt("$__timersInProgress")),O.map((function(e,t){return i.a.createElement(oc,{db:"cards",key:t,data:e,notGlobalExpanded:!0,viewTimer:!0})}))))))})))}));function eg(){eg=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var tg=Object($e.b)((function(e,t){return{cards:e.db.cards}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Gc)((function(e){var t=i.a.useState(""),r=Object(Be.a)(t,2),n=r[0],a=r[1],o=i.a.useState(!1),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.useState([]),d=Object(Be.a)(u,2),p=d[0],f=d[1],m=i.a.useState(!1),g=Object(Be.a)(m,2),v=g[0],y=g[1],b=i.a.useState(!1),x=Object(Be.a)(b,2),_=x[0],w=x[1],E=i.a.useState("all"),O=Object(Be.a)(E,2),j=O[0],S=O[1],k=De.getState(),L=k.db,C=k.session,I=xt(),F=window.location.hash.split("/");F[0]=F[0].replace("#",""),i.a.useEffect((function(){return function(){}}),[]),i.a.useEffect((function(){var t=setTimeout((function(){}),15e3);return e.text.length>1&&e.text!==n&&(a(e.text),clearTimeout(t),t=setTimeout((function(){return T()}),500),s(!0)),function(){return clearTimeout(t)}}),[e.text]),i.a.useEffect((function(){var t=setTimeout((function(){}),15e3);return e.completed!==v&&e.text&&e.text.length>1&&(s(!0),y(!v),w(!0),t=setTimeout((function(){return T()}),500)),function(){return clearTimeout(t)}}),[e.completed]),i.a.useEffect((function(){var t=setTimeout((function(){}),15e3);return e.deleted!==_&&e.text&&e.text.length>1&&(s(!0),w(!_),y(!0),t=setTimeout((function(){return T()}),500)),function(){return clearTimeout(t)}}),[e.deleted]);var T=function(){var t=Object(Me.a)(eg().mark((function t(){var r;return eg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,In(e,{search:e.text,ignoreLoader:!0,deleted:e.deleted,completed:e.completed,cardLoad:"search"});case 2:(r=t.sent)&&setTimeout((function(){N(r)}),1e3);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),N=function(){var t=Object(Me.a)(eg().mark((function t(r){var n,a,o;return eg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=Object(h.a)(Object(h.a)({},De.getState().db.cards),r),a=new Promise((function(t,r){t(Object.keys(n).filter((function(t){return"chatGroup"!==n[t].type&&(!n[t].checklist||n[t].checklist&&n[t].showCard)&&(e.deleted&&n[t].deleted||!e.deleted&&!n[t].deleted&&(!e.completed&&n[t]&&"completed"!==n[t].status||e.completed&&n[t]&&"completed"===n[t].status))&&((I.owner||I.planAdmin)&&("plan"!==n[t].type||"plan"===n[t].type&&ga(t))||C._id&&n[t]._users&&n[t]._users[C._id])&&e.text&&(n[t].name&&e.text&&n[t]&&n[t].name&&n[t].name.toLowerCase().indexOf(e.text.toLowerCase())>-1||n[t]&&e.text&&n[t].description&&n[t].description.toLowerCase().indexOf(e.text.toLowerCase())>-1)&&(!n[t].private||n[t].private&&n[t]._users&&n[t]._users[C._id])})))})),t.next=4,a.then((function(e){return e}));case 4:(o=t.sent)&&(f(o),s(!1),e.onFinish&&e.onFinish(o.length));case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return i.a.createElement("div",{style:{width:"100%"}},i.a.createElement("div",{style:{positin:"relative",width:"100%",minHeight:"100px"}},l&&i.a.createElement(vo,null,i.a.createElement(xo,{xs:12,sm:12,md:12,lg:12,xl:12},i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},i.a.createElement(Fo,null)))),i.a.createElement("div",{style:{position:"relative",width:"100%",display:"flex"}},i.a.createElement("div",{style:{width:"177px",padding:7,display:"flex",flexDirection:"column",marginRight:"solid 1px lightgray"}},p.length>1?i.a.createElement("div",{style:{backgroundColor:"all"===j?"rgba(0,0,0,0.08)":"",padding:"0 3px"}},i.a.createElement(At,{title:lt("$__allResults","*"),text:lt("$__allResults","*"),color:"all"===j?dt("menu"):"lightGray",icon:"manage_search",onClick:function(){S("all")},size:"17px",style:{padding:"0px 3px !important"},transparent:!0})):i.a.createElement(i.a.Fragment,null),L.type.filter((function(e){return p.filter((function(t){return L.cards[t].type===e.value})).length>0})).map((function(e,t){return i.a.createElement("div",{key:"".concat(t,"-").concat(e),style:{backgroundColor:"asset"===j?"rgba(0,0,0,0.08)":"",padding:"0 3px",display:"flex",justifyContent:"space-between",alignItems:"center"}},i.a.createElement(At,{title:lt("".concat(e.label),"*"),text:lt("".concat(e.label),"*"),color:j===e.value?dt("menu"):"lightGray",icon:e.icon,onClick:function(){S(e.value)},size:"17px",style:{padding:"0px 3px !important"},transparent:!0}),i.a.createElement("div",{style:{backgroundColor:j===e.value?dt("menu",1):dt("menu",.5),fontSize:9,color:"#FFFFFF",borderRadius:11,width:22,height:22,display:"flex",alignItems:"center",justifyContent:"center"}},p.filter((function(t){return L.cards[t].type===e.value})).length))}))),i.a.createElement("div",{style:{width:"calc(100% - 177px)",padding:7,display:"flex",flexDirection:"column"}},i.a.createElement(vo,null,L.type.filter((function(e){return"all"!==j&&e.value===j||"all"===j&&p.filter((function(t){return L.cards[t].type===e.value})).length>0})).map((function(t,r){return i.a.createElement("div",{key:"".concat(t,"-").concat(r)},i.a.createElement(xo,{xs:12,sm:12,md:12,lg:12,xl:12},i.a.createElement(Io,{title:lt(t.label,1),icon:t.icon,color:dt("menu"),style:{padding:"7px"}}),p.filter((function(e){return L.cards[e].type===t.value})).sort((function(e,t){return L.cards[e].name<L.cards[t].name?-1:L.cards[e].name>L.cards[t].name?1:0})).map((function(t,r){return i.a.createElement(xo,{key:t,md:12,style:{minWidth:"300px"}},i.a.createElement(oc,{data:L.cards[t],db:"cards",showConnectedIn:!0,searchText:e.text,expanded:!1,onAction:function(){e.onAction()}}))}))))})))))))})));Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Gc)((function(e){return i.a.createElement(i.a.Fragment,null)})));function rg(){rg=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var ng=Object($e.b)((function(){return{}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t,r=De.getState(),n=r.timeline,a=r.functions.socket,o=De.getState().db,c=i.a.useState(!1),l=Object(Be.a)(c,2),s=l[0],u=l[1],d=i.a.useState(e.data),p=Object(Be.a)(d,2),f=p[0],m=p[1],g=f.name.split("."),v=g[g.length-1],y=i.a.useState(!1),b=Object(Be.a)(y,2),x=b[0],_=b[1],w=i.a.useState(g[0]),E=Object(Be.a)(w,2),j=E[0],S=E[1],k=i.a.useState(g[0]),L=Object(Be.a)(k,2),C=L[0],I=L[1];i.a.useEffect((function(){C||I(!0)}),[e.data]),"blob"===f.name&&(f.name="".concat(lt("$__coverImage","*"),".jpg"),v="jpg");var F="attachment";De.getState().db.fileExtensions.filter((function(e){return e.ext.indexOf(v.toLowerCase())>-1})).length>0&&(F=De.getState().db.fileExtensions.filter((function(e){return e.ext.indexOf(v.toLowerCase())>-1}))[0].icon||"https://machen.azureedge.net/".concat(f.file));var T=function(){var e=Object(Me.a)(rg().mark((function e(t){return rg().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{a.emit("data",{module:"node",method:"put",action:"update"},Object(h.a)({_id:f._id},t),Object(Me.a)(rg().mark((function e(){return rg().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:m(Object(h.a)(Object(h.a)({},f),t)),_(!1);case 2:case"end":return e.stop()}}),e)}))))}catch(r){console.log(r)}case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),N=Object(h.a)({},o.cards[f.cardId]&&n[f.cardId]&&n[f.cardId][f.timelineId]?n[f.cardId][f.timelineId]:f.message);return N&&!N.message&&(N=Object(h.a)(Object(h.a)({},N),{},{message:lt("$__onlyAttachment")})),i.a.createElement("div",{style:{width:"100%"}},i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",marginBottom:"5px",cursor:"pointer"}},e.resume?i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{position:"relative",width:"100%",display:"flex",alignItems:"center"},onClick:function(t){e.openLightBox&&e.openLightBox()}},i.a.createElement("div",{style:{position:"relative",float:"left",width:"33px",height:"33px",alignItems:"center",display:"flex",overflow:"hidden"}},"string"===typeof F&&-1===F.indexOf("https")&&-1===F.indexOf("svg")?i.a.createElement(kt,{icon:F,size:"33px"}):i.a.createElement("img",{src:F,width:"100%",style:{width:"auto",height:"auto",maxHeight:"77%"},onError:function(e){return e.target.src=F}})),i.a.createElement("div",{style:{marginLeft:"7px",width:"calc(100% - 80px)",maxWidth:"calc(100% - 80px)",minWidth:"150px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"}},yt(f.name,e.searchText)),o.users[f.createdBy]&&i.a.createElement("div",{style:{position:"absolute",right:"10px",top:"7px",zIndex:"10"}},i.a.createElement(Yo.a,{max:7},i.a.createElement(Qe.a,{title:o.users[f.createdBy].displayName?o.users[f.createdBy].displayName:o.users[f.createdBy].name},i.a.createElement(Na,{alt:o.users[f.createdBy].displayName?o.users[f.createdBy].displayName:o.users[f.createdBy].name,src:"".concat(o.users[f.createdBy].image),style:{width:"15px",height:"15px"}},o.users[f.createdBy].name.substr(0,1)))))),e.showParent&&(f.timelineId||f.message)&&(o.cards[f.cardId]&&n[f.cardId]&&n[f.cardId][f.timelineId]||f.message)&&i.a.createElement("div",{style:{width:"100%",marginBottom:"33px"}},i.a.createElement(Fc,{openLightBox:function(t){e.openLightBox&&e.openLightBox(t)},storie:N,db:"cards",nodeId:f.cardId}),i.a.createElement("div",{style:{clear:"both"}})),e.showParent&&f.cardId&&o.cards[f.cardId]&&i.a.createElement("div",{style:{width:"100%",top:"33px"}},i.a.createElement(oc,{db:"cards",data:o.cards[f.cardId],showConnectedIn:!0})),i.a.createElement("div",{style:{width:"100%",height:"1px",backgroundColor:"rgba(0,0,0,0.1)",marginTop:"15px"}})):i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",marginTop:"7px",padding:"15px",display:"flex",alignItems:"center",height:"70px"}},i.a.createElement("div",{style:{position:"absolute",top:"0px",width:"calc(100% - 30px)",borderBottom:"solid 1.5px ".concat(dt("color")),alignItems:"center",display:"flex",color:dt("color")}},i.a.createElement("div",{style:{width:"357px",textAlign:"center",alignItems:"center",justifyContent:"center",display:"flex",cursor:"pointer"},onClick:function(t){e.onClick&&e.onClick()},onDoubleClick:function(){_(!0)}},x?i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{position:"relative",float:"left",width:"100%",padding:"7px",display:"flex",alignItems:"center"}},i.a.createElement("div",{style:{width:"calc(100% - 50px)",display:"flex"}},i.a.createElement(La,{label:lt("$__taskTitle"),variant:dt("fieldVariant"),name:"name",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",onChange:function(e){S(e.target.value)},onBlur:function(e){""===e.target.value&&_(!x)},onKeyDown:function(e){13===e.keyCode&&j&&T({name:"".concat(j,".").concat(v)}),27===e.keyCode&&(_(!x),S())}},autoFocus:!0,value:j,placeholder:lt("$__taskTitlePlaceholder")})),i.a.createElement("div",{style:{display:"flex"}},i.a.createElement("div",{onClick:function(){return T({name:"".concat(j,".").concat(v)})}},i.a.createElement(kt,{color:"green",icon:"save",title:lt("$__save","*"),size:e.actionsSize||"25px"})),i.a.createElement("div",{onClick:function(){_(!x),S("")}},i.a.createElement(kt,{color:dt("medium"),icon:"cancel",title:lt("$__cancel","*"),size:e.actionsSize||"25px"}))))):i.a.createElement("div",{style:{width:"100%"}},f.in&&f.in.name&&i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},"User"===f.in.db?i.a.createElement(Qe.a,{title:f.in.name},i.a.createElement(Na,{alt:f.in.name,src:f.in.image,style:{width:"15px",height:"15px"}},f.in.name)):i.a.createElement(i.a.Fragment,null),i.a.createElement(Fa,{title:f.in.name,icon:"User"===f.in.db?null:f.in.type&&o&&o.dataType&&o.dataType.filter((function(e){return e.name===f.in.type}))[0]&&o.dataType.filter((function(e){return e.name===f.in.type}))[0].icon||"$__topic",color:dt("medium"),style:{padding:"7px",width:"calc(100% - 30px)",textAlign:"left"},textStyle:!0})),i.a.createElement("div",{style:{width:"100%",display:"flex",alignItems:"center",padding:"0 15px"}},i.a.createElement("div",{style:(t={position:"relative",float:"left",width:"33px",height:"33px",marginRight:"7px",alignItems:"center"},Object(O.a)(t,"height","50px"),Object(O.a)(t,"display","flex"),Object(O.a)(t,"justifyContent","center"),t)},"string"===typeof F&&-1===F.indexOf("https")&&-1===F.indexOf("svg")?i.a.createElement(kt,{icon:F,size:"33px"}):i.a.createElement("div",{style:{position:"absolute",width:"33px",height:"33px",margin:"7px",borderRadius:"50%",overflow:"hidden",backgroundImage:'url("'.concat(F,'")'),backgroundPosition:"center center",backgroundSize:"cover"}})),f.name),f.createdBy&&i.a.createElement("div",{style:{position:"relative",display:"flex",alignItems:"center",color:e.dark?"lightgray":"gray",fontSize:10,marginLeft:"42px",clear:"both"}},i.a.createElement(Na,{alt:f.createdBy.name,src:f.createdBy.image,style:{width:"15px",height:"15px"}},f.createdBy.name),i.a.createElement("span",{style:{marginLeft:3}},f.createdBy.name," - (",Ot(f.created_at),")")))),i.a.createElement("div",{style:{width:"130px",textAlign:"center",borderRight:"solid 1.5px ".concat(dt("color")),alignItems:"center",justifyContent:"center",display:"flex",fontSize:"12px"}},Ve()(new Date(1e3*f.created_at)).format("DD/MM/YYYY HH:mm")),i.a.createElement("div",{style:{width:"130px",borderRight:"solid 1.5px ".concat(dt("color")),alignItems:"center",justifyContent:"center",display:"flex",overflow:"visible"}},o.users[f.createdBy]&&i.a.createElement(Qe.a,{title:o.users[f.createdBy].name},i.a.createElement(i.a.Fragment,null,i.a.createElement(Na,{size:"sm",src:"".concat(o.users[f.createdBy].image)},o.users[f.createdBy].name.substr(0,1))))),i.a.createElement("div",{style:{width:"300px",textAlign:"left",borderRight:"solid 1.5px ".concat(dt("color")),paddingLeft:"15px",alignItems:"center",justifyContent:"center",display:"flex"}}),i.a.createElement("div",{style:{width:"130px",textAlign:"left",paddingLeft:"15px",alignItems:"center",justifyContent:"center",display:"flex"}},i.a.createElement(Qe.a,{title:lt("$__showFile")},i.a.createElement(kt,{onClick:e.openLightBox?function(){e.openLightBox()}:null},"pageview")),(f.timelineId||f.message)&&i.a.createElement(Qe.a,{title:lt("$__viewMessage")},i.a.createElement(kt,{size:"20px",onClick:function(){u(!s)}},"feedback")))))),(f.timelineId||f.message)&&s&&(o.cards[f.cardId]&&n[f.cardId]&&n[f.cardId][f.timelineId]||f.message)&&i.a.createElement("div",{style:{width:"100%"}},i.a.createElement(Fc,{openLightBox:function(t){e.openLightBox&&e.openLightBox(t)},storie:N,db:"cards",nodeId:f.cardId})))}));function ag(){ag=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var og=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Gc)((function(e){var t=i.a.useState(""),r=Object(Be.a)(t,2),n=r[0],a=r[1],o=i.a.useState(!1),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.useState([]),d=Object(Be.a)(u,2),p=d[0],f=d[1],h=De.getState(),m=h.db,g=h.functions,v=m.dataType,y=(g.socket,setTimeout((function(){}),1e3),[]),b=window.location.hash.split("/");b[0]=b[0].replace("#",""),i.a.useEffect((function(){if(e.text.length>1&&e.text!==n){a(e.text);var t=setTimeout((function(){return x()}),1e3);return s(!0),function(){return clearTimeout(t)}}}),[e.text]);var x=function(){var t=Object(Me.a)(ag().mark((function t(){var r;return ag().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Sn.get("/M_Files_Search/?text=".concat(e.text));case 2:(r=t.sent)&&r.data&&(e.onFinish&&e.onFinish(Object.keys(r.data).length),f(r.data),s(!1));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return i.a.createElement("div",{style:{width:"100%"}},i.a.createElement("div",{style:{positin:"relative",width:"100%"}},l&&i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},i.a.createElement(Fo,null)),i.a.createElement(vo,null,Object.keys(p).length>0&&i.a.createElement(xo,{xs:12,sm:12,md:12,lg:12,xl:12},i.a.createElement(Io,{title:lt("$__files",1),icon:v.filter((function(e){return"plan"===e.name}))[0].icon,color:dt("menu"),filterText:e.text,style:{padding:"7px"}}),Object.keys(p).map((function(t,r){return y.push(p[t]),i.a.createElement(xo,{key:t,md:12},i.a.createElement(ng,{data:p[t],searchText:e.text,resume:!0,showParent:!0,openLightBox:function(){var r;r=p[t]._id,e.reduxFunction("ASYNC","LIGHTBOX",{open:!0,files:y,file:r}),e.onAction&&e.onAction()}}))}))))))}))),ig=r(1007),cg=r.n(ig),lg=function(e){return{avatar:{width:"30px",height:"30px",backgroundSize:"cover",borderRadius:"50%"},component:{marginTop:"15px",marginRight:"8px",marginBottom:"15px",zIndex:"10",display:"flex",alignItems:"center",justifyContent:"center"},selectedName:{display:"inline-flex",cursor:"pointer"},selectedNameText:{textDecoration:"none",fontSize:"12px",fontFamily:"Soleto"}}};function sg(){sg=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var ug=Object($e.b)((function(e){return{users:e.db.users}}),(function(e){return Object(u.b)(n,e)}))(cg()(lg)((function(e){var t=De.getState(),r=t.db,n=t.session,a=De.getState().functions.socket,o=i.a.useState(!1),c=Object(Be.a)(o,2),l=c[0],s=c[1],u=i.a.useRef(null),d=function(e){u.current&&u.current.contains(e.target)||s(!1)};function p(e){"Tab"===e.key&&(e.preventDefault(),s(!1))}var f=i.a.useRef(l);i.a.useEffect((function(){!0===f.current&&!1===l&&u.current.focus(),f.current=l}),[l]);var m=function(){var e=Object(Me.a)(sg().mark((function e(){return sg().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.emit("data",{module:"user",method:"post",action:"logout"},{},(function(){})),localStorage.clear(),setTimeout((function(){window.location.href="/login"}),500);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),g=e.classes,v=r.users,y=v&&Object.keys(v).length>0?v[Object.keys(v).find((function(e){return n&&n._id&&v[e]&&v[e]._id&&v[e]._id.indexOf(n._id)>-1}))]:{};return y&&y.name?i.a.createElement("div",{className:g.component},i.a.createElement("div",{className:g.selectedName,onClick:function(e){s((function(e){return!e}))}},i.a.createElement("div",{ref:u,className:g.selectedNameText,style:{color:dt("light")||"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center"}},i.a.createElement(et,{title:i.a.createElement(i.a.Fragment,null,(y.name,y.name))},i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"33px",height:"33px",borderRadius:"50%",border:"solid 1px ".concat(dt("menu"))}},i.a.createElement("div",{style:{display:"flex",width:"90%",height:"90%",backgroundImage:'url("'.concat(y.image,'")'),backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center center",borderRadius:"50%"}})))))),i.a.createElement("div",{style:{zIndex:10}},i.a.createElement(mn.a,{open:l,anchorEl:u.current,role:void 0,transition:!0,disablePortal:!0},(function(t){var a=t.TransitionProps,o=t.placement;return i.a.createElement(fn.a,Object.assign({},a,{style:{transformOrigin:"bottom"===o?"center top":"center bottom"}}),i.a.createElement(hn.a,null,i.a.createElement(pn.a,{onClickAway:d},i.a.createElement(_n.a,{autoFocusItem:l,id:"menu-list-grow",onKeyDown:p},i.a.createElement(xn.a,{onClick:function(){e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},r.sideModule),{},{id:n._id,activeModule:"userEdit",db:"users",data:Object(h.a)({type:"user"},r.users[n._id])}))}},lt("$__myProfile",1)),i.a.createElement(xn.a,{onClick:function(){return m()}},lt("$__logout",1))))))})))):null})));var dg=Object($e.b)((function(e){return{controls:e.controls,chatNotifications:e.chat.notifications}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(Gc)((function(e){var t=De.getState(),r=t.db,n=t.session,a=t.chat,o=i.a.useState(""),c=Object(Be.a)(o,2),l=c[0],u=c[1],d=i.a.useState(0),p=Object(Be.a)(d,2),m=p[0],g=p[1],v=i.a.useState(0),y=Object(Be.a)(v,2),b=(y[0],y[1]),x=i.a.useState(0),_=Object(Be.a)(x,2),w=_[0],E=_[1],O=i.a.useState(!1),j=Object(Be.a)(O,2),S=j[0],k=j[1],L=i.a.useState(!1),C=Object(Be.a)(L,2),I=C[0],F=C[1],T=i.a.useState("asset"),N=Object(Be.a)(T,2),P=N[0],D=N[1],A=i.a.useState(!1),$=Object(Be.a)(A,2),z=$[0],M=($[1],xt()),B=i.a.useState({title:null,icon:null,sTitle:null,sIcon:null}),Y=Object(Be.a)(B,2),G=Y[0],R=Y[1],H=i.a.useRef(null),W=window.location.hash.split("/");W[0]=W[0].replace("#",""),i.a.useEffect((function(){return U(),function(){}}),[e]);var U=function(){var e={};$m.filter((function(e){return e.path===window.location.pathname})).length>0&&(e=$m.filter((function(e){return e.path===window.location.pathname}))[0]);var t=lt("$__".concat(e.alias),1),n=e.icon,a="";"plan"===e.alias&&W[0]&&r.cards[W[0]]&&(t="".concat(lt("$__".concat(e.alias),1),": ").concat(r.cards[W[0]].name)),e.tabs&&e.tabs.length>0&&e.tabs.filter((function(e){return e.path===W[1]})).length>0&&(a=lt("$__".concat(e.tabs.filter((function(e){return e.path===W[1]}))[0].alias),1),n=e.tabs.filter((function(e){return e.path===W[1]}))[0].icon),R({title:t,icon:n,sTitle:a,sIcon:null})};return i.a.createElement("div",{style:{position:"absolute",top:"-4px",right:0,left:0,display:"flex",alignItems:"center",zIndex:"10 !important"},id:"top_"},i.a.createElement(vo,null,i.a.createElement(xo,{xs:10,sm:4,md:4,lg:4,xl:4,style:{display:"flex",alignItems:"center"},id:"top_menuHideShow"},!e.expanded&&i.a.createElement(Nt.a,{style:{width:"50px"},onClick:function(){e.menuExpand()}},i.a.createElement(kt,{icon:"menu",title:"$__showMenu",size:"27px",color:dt("menu")})),i.a.createElement("div",{id:"top_pageTitle",style:{color:dt("menu"),marginLeft:"22px",fontSize:"12px",fontWeight:"bold"}},G.sTitle?"".concat(G.title," - ").concat("matrix"===G.sTitle.toLowerCase()?"MATRIX SWOT":G.sTitle):G.title)),i.a.createElement(Ut,null,i.a.createElement(xo,{xs:12,sm:4,md:4,lg:4,xl:4,style:{display:"flex",justifyContent:"flex-start",alignItems:"center",zIndex:"10 !important"},id:"top_search"},i.a.createElement("div",{style:{position:"relative",width:"calc(100% - 15px)",zIndex:"10 !important"}},i.a.createElement(La,{ref:H,label:lt("$__search",1),variant:dt("fieldVariant"),name:"name",InputLabelProps:{shrink:!0},InputProps:{autoComplete:"new-password",endAdornment:""!==l?i.a.createElement(To.a,{position:"end"},i.a.createElement(kt,{icon:"close",onClick:function(){u(""),k(!1),F(!1)}})):null,onChange:function(e){u(e.target.value),k(!0),F(!0)}},value:l,placeholder:lt("$__searchInMachen")}),""!==l&&l.length>1&&i.a.createElement(pn.a,{onClickAway:function(){u(""),k(!1),F(!1)}},i.a.createElement(mn.a,{open:!!l,anchorEl:H.current,role:void 0,transition:!0,disablePortal:!0,style:{position:"absolute",zIndex:10,bottom:0,left:"5px",right:"5px",minWidth:"500px"}},(function(e){var t=e.TransitionProps;e.placement;return i.a.createElement(fn.a,Object.assign({},t,{style:{transformOrigin:"center bottom",zIndex:"3",maxHeight:"calc(100vh - 177px)",overflowY:"auto"}}),i.a.createElement(hn.a,{style:{zIndex:"3",boxShadow:"0 7px 15px rgba(0,0,0,0.33) !important"}},i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{display:"flex",borderBottom:"solid 2px rgba(0,0,0,0.22)",backgroundColor:"#f1f1f1",justifyContent:"space-between"}},i.a.createElement("div",{style:{backgroundColor:"asset"===P?"rgba(0,0,0,0.08)":"",padding:"0 3px"}},i.a.createElement(At,{title:lt("$__asset","*"),text:lt("$__asset","*"),color:"asset"===P?dt("menu"):"lightGray",icon:"play_circle_outline",onClick:function(){D("asset"),k(!0),F(!0),g(0),b(0),E(0)},size:"17px",style:{padding:"0px 3px !important"},transparent:!0})),i.a.createElement("div",{style:{backgroundColor:"completed"===P?"rgba(0,0,0,0.08)":"",padding:"0 3px"}},i.a.createElement(At,{title:lt("$__completed","*"),text:lt("$__completed","*"),color:"completed"===P?dt("menu"):"lightGray",icon:"verified",onClick:function(){D("completed"),k(!0),F(!0),g(0),b(0),E(0)},size:"17px",style:{padding:"0px 3px !important"},transparent:!0})),i.a.createElement("div",{style:{backgroundColor:"deleted"===P?"rgba(0,0,0,0.08)":"",padding:"0 3px"}},i.a.createElement(At,{title:lt("$__deleted","*"),text:lt("$__deleted","*"),color:"deleted"===P?dt("menu"):"lightGray",icon:"delete_forever",onClick:function(){D("deleted"),k(!0),F(!0),g(0),b(0),E(0)},size:"17px",style:{padding:"0px 3px !important"},transparent:!0}))),"0"!==String(m)||"0"!==String(w)||S||I?i.a.createElement(i.a.Fragment,null):i.a.createElement("div",{style:{textAlign:"center",fontSize:"16px",color:"red",marginTop:33,marginBottom:33}},lt("$__noResultsFound")),l?i.a.createElement(i.a.Fragment,null,i.a.createElement(Ut,null,i.a.createElement(tg,{text:l||"",onFinish:function(e){g(e),k(!1)},onAction:function(){u(""),k(!1),g(0),b(0),E(0)},completed:"completed"===P,deleted:"deleted"===P,adminView:z})),i.a.createElement(Ut,null,i.a.createElement(og,{text:l||"",onFinish:function(e){E(e),F(!1)},onAction:function(){u(""),g(0),b(0),E(0)}}))):i.a.createElement(i.a.Fragment,null))))})))))),i.a.createElement(xo,{xs:5,sm:4,md:4,lg:4,xl:4,style:{display:"flex",justifyContent:"flex-end",alignItems:"center",zIndex:2001}},i.a.createElement("div",{id:"top_quickAdd"},i.a.createElement(Ut,null,i.a.createElement(Km,{hashs:W}))),i.a.createElement(Ut,null,i.a.createElement(Hm,null)),i.a.createElement("div",{id:"top_notifications"},i.a.createElement(Ut,null,i.a.createElement(Jm,{loader:!(!e.loaders||!e.loaders.notifications)}))),i.a.createElement("div",{id:"top_timers"},i.a.createElement(Ut,null,i.a.createElement(Qm,null))),i.a.createElement("div",{id:"top_myDay"},i.a.createElement(Ut,null,i.a.createElement(Um,null))),i.a.createElement("div",{id:"top_moreOptions"},i.a.createElement(Pt.a,{overlap:"rectangular",badgeContent:De.getState().controls.unlockedPrivates,color:"secondary"},i.a.createElement(En,{transparent:!0,count:50,size:"27px",icon:"settings",title:lt("$__settings"),btColor:"lightgray",options:[].concat(Object(f.a)(M&&M.user&&(M.userAdmin||M.userModerate)?[{name:"$__users",icon:"account_box",onClick:function(){s.push("c#tab/users"),e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},a),{},{open:!1}))}},{name:"$__units",icon:"business",onClick:function(){s.push("c#tab/units"),e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},a),{},{open:!1}))}}]:[]),[{name:"$__support",icon:"help_outline",onClick:function(){window.open("https://support.machen.ai","_blank")}},n&&(n._access&&n._access.master||n.isAdmin)&&{name:"$__APPSettings",icon:"engineering",onClick:function(){window.open("/masterAdmin#tab/languages","_self")},show:"hover"},n&&"701bbca1-e1e4-4ea0-ada8-30f74ae74894"===n._id&&{name:"DEV",icon:"code",onClick:function(){s.push("plataformAdministrator"),e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},a),{},{open:!1}))},show:"hover"}],Object(f.a)(De.getState().controls.hidePrivate?[]:[{name:lt(De.getState().controls.lockPrivate?"$__lockMyPrivateActivities":"$__unlockMyPrivateActivities",1),icon:De.getState().controls.lockPrivate?"private_connectivity":"lock_open",color:De.getState().controls.lockPrivate?"lightgray":null,onClick:function(){e.reduxFunction("ASYNC","SET_CONTROL",Object(h.a)(Object(h.a)({},De.getState().controls),{},{lockPrivate:!De.getState().controls.lockPrivate},De.getState().controls.lockPrivate?{}:{unlockedPrivates:0}))},show:"hover"}]),[{name:lt(De.getState().chat.notifications?"$__chatNotificationsActive":"$__chatNotificationsOff",1),icon:De.getState().chat.notifications?"notifications_active":"notifications_off",color:De.getState().chat.notifications?"green":"lightgray",count:De.getState().controls.unlockedPrivates,onClick:function(){e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},a),{},{notifications:!De.getState().chat.notifications}))},show:"hover"}],Object(f.a)(De.getState().controls.unlockedPrivates>0?[{name:lt("$__lockMyPrivateActivities",1),icon:"private_connectivity",color:"red",count:De.getState().controls.unlockedPrivates,onClick:function(){e.reduxFunction("ASYNC","SET_CONTROL",Object(h.a)(Object(h.a)({},De.getState().controls),{},{unlockedPrivates:0,lockPrivate:!1}))},show:"hover"}]:[]),Object(f.a)(De.getState().session&&De.getState().session._access&&De.getState().session._access.masterAdmin>0?[{name:lt("$__accountSettings",1),icon:"settings_applications",color:"lightgray",onClick:function(){s.push("acc#tab/resume")},show:"hover"}]:[]))}))),i.a.createElement("div",{style:{marginLeft:"15px"},id:"top_user"},i.a.createElement(ug,null)))))}))),pg=function(e){return{root:{position:"relative",width:"100%",cursor:"pointer"},user:{display:"flex",margin:"auto",height:"37px",alignItems:"center"},userExtended:{display:"flex",height:"37px",alignItems:"center"},userActive:{display:"inherit",height:"37px",alignItems:"center",justifyContent:"center",backgroundColor:dt("color",.33)},userActiveExtended:Object(O.a)({display:"inherit",height:"37px",alignItems:"center",justifyContent:"center",backgroundColor:dt("color",.33)},"justifyContent","left"),name:{position:"absolute",top:"5px",left:"36px",right:"0px",height:"30px",border:"1px solid ".concat(dt("color",.2)),backgroundColor:"#FFFFFF",borderRadius:"5px",display:"flex",alignItems:"center",paddingLeft:"22px",fontWeight:"bold",fontSize:"14px",color:dt("darkText"),boxShadow:"-5px 3px 7px 1px rgba(0,0,0,0.05)"},lastMessage:{position:"absolute",top:"30px",left:"36px",right:"15px",height:"30px",border:"1px solid ".concat(dt("color",.2)),backgroundColor:"#FFFFFF",borderRadius:"5px",display:"flex",alignItems:"center",paddingLeft:"22px",paddingTop:"3px",fontSize:"12px",color:dt("medium"),boxShadow:"-5px 3px 7px 1px rgba(0,0,0,0.05)",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},lastMessageUnReaded:{position:"absolute",top:"30px",left:"36px",right:"15px",height:"30px",border:"1px solid ".concat(dt("color",.2)),backgroundColor:"#FFFFFF",borderRadius:"5px",display:"flex",fontWeight:"bold",alignItems:"center",paddingLeft:"22px",paddingTop:"3px",fontSize:"12px",color:dt("medium"),boxShadow:"-5px 3px 7px 1px rgba(0,0,0,0.05)",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},access:{position:"absolute",top:"33px",left:"45px",right:"0px",height:"30px",border:"1px solid ".concat(dt("color",.2)),borderRadius:"0 0 5px 5px",display:"flex",alignItems:"center",paddingLeft:"16px",fontSize:"14px",color:dt("color"),boxShadow:"0px 3px 7px 1px rgba(0,0,0,0.05)"},accessEditing:{position:"absolute",top:"33px",left:"45px",right:"0px",height:"auto",minHeight:"290px",padding:"7px",border:"1px solid ".concat(dt("color",.2)),borderRadius:"0 0 5px 5px",display:"flex",alignItems:"center",paddingLeft:"16px",fontSize:"14px",fontWeight:"bold",color:dt("color"),backgroundColor:"#FFFFFF",boxShadow:"0px 3px 7px 1px rgba(0,0,0,0.05)","& ul":{fontSize:"12px"}}}};var fg=Object($e.b)((function(e,t){return{store:{chat:e.chat,timeline:e.timeline,cards:e.db.cards,users:e.db.users,adminView:e.db.adminView,session:e.session,usersStatus:e.usersStatus}}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(pg)((function(e){var t=e.classes,r=e.store,n=r.chat,a=r.session,o=r.timeline,c=(r.db,r.usersStatus),l=!!e.expanded,s=xt(),u=Object(h.a)({},De.getState().db.users),d={};u=(u=Object.keys(u).filter((function(e){return e!==a._id&&"user"===u[e].type})).map((function(t){return e.store.users[t]})).sort((function(e,t){return e.name<t.name?-1:e.name>t.name?1:0}))).map((function(t){t.unReadedCount=0;var r={};r=Object.keys(r).filter((function(e){return r[e]&&r[e].user&&r[e].user._id===t._id&&"comment"===r[e].type})).map((function(e){return r[e]}));var n=Object(h.a)({},e.store.users[t._id]&&o[t._id]?e.store.users[t._id]&&o[t._id]:{});n=Object.keys(n).filter((function(e){return n[e]&&"comment"===n[e].type})).map((function(e){return n[e]}));var i=[].concat(Object(f.a)(r),Object(f.a)(n));return i=i.sort((function(e,t){return Math.ceil(e.created_at)<Math.ceil(t.created_at)?-1:1})).map((function(e){return e})),"boolean"!==typeof t?(d=Object(h.a)(Object(h.a)({},d),{},Object(O.a)({},t._id,Object(h.a)(Object(h.a)({},e.store.users[t._id]),{},{type:"user",_lastMessage:i[i.length-1]?i[i.length-1]:null,unReadedCount:r.filter((function(e){return"comment"===e.type&&!e.deleted&&(!e.readedBy||e.readedBy&&!e.readedBy[a._id])})).length}))),t._lastMessage=i[i.length-1]?i[i.length-1]:null,t.unReadedCount=r.filter((function(e){return"comment"===e.type&&!e.deleted&&(!e.readedBy||e.readedBy&&!e.readedBy[a._id])})).length):(t._lastMessage=null,t.unReadedCount=0),t}));var p=Object.keys(De.getState().db.cards).filter((function(t){return"chatGroup"===De.getState().db.cards[t].type&&!De.getState().db.cards[t].deleted&&(De.getState().db.cards[t]._users&&De.getState().db.cards[t]._users[a._id]||!De.getState().db.cards[t].private&&e.store.adminView&&s&&(s.owner||s.admin))})).map((function(e){return De.getState().db.cards[e]}));p&&p.length>0&&p.filter((function(e){if(e._users&&e._users[a._id])return!0})).map((function(e){var t;o[e._id]&&Object.keys(o[e._id]).length>0&&(t=Object.keys(o[e._id]).filter((function(t){return o[e._id]&&o[e._id][t]&&"comment"===o[e._id][t].type})).sort((function(t,r){return o[e._id][t]&&o[e._id][r]&&String(o[e._id][t].created_at)&&String(o[e._id][r].created_at)&&parseInt(o[e._id][t].created_at)>parseInt(o[e._id][r].created_at)?-1:o[e._id][t]&&o[e._id][r]&&String(o[e._id][t].created_at)&&String(o[e._id][r].created_at)&&parseInt(o[e._id][t].created_at)<parseInt(o[e._id][r].created_at)?1:0}))),d=e&&e._id&&t&&t.length>0&&o[e._id]&&o[e._id][t[0]]&&o[e._id][t[0]].created_at?Object(h.a)(Object(h.a)({},d),{},Object(O.a)({},e._id,Object(h.a)(Object(h.a)({},De.getState().db.cards[e._id]),{},{type:"group",_lastMessage:o[e._id][t[0]]}))):Object(h.a)(Object(h.a)({},d),{},Object(O.a)({},e._id,Object(h.a)(Object(h.a)({},De.getState().db.cards[e._id]),{},{type:"group"})))}));var m=Object.keys(d).filter((function(t){return(!De.getState().db.cards[t]||De.getState().db.cards[t]&&!De.getState().db.cards[t].deleted)&&(!e.find||""===e.find||e.find&&(d[t].name.toLowerCase().indexOf(e.find.toLowerCase())>-1||d[t]._parent&&De.getState().db.users[d[t]._parent]&&De.getState().db.users[d[t]._parent].name&&De.getState().db.users[d[t]._parent].name.toLowerCase().indexOf(e.find.toLowerCase())>-1))&&(l||!l&&d[t]&&d[t]._lastMessage)&&(!e.onLine||e.onLine&&c.users&&c.users[t])})).sort((function(e,t){var r=d[e]._lastMessage&&String(d[e]._lastMessage.created_at)?Math.ceil(d[e]._lastMessage.created_at):0,n=d[t]._lastMessage&&String(d[t]._lastMessage.created_at)?Math.ceil(d[t]._lastMessage.created_at):0;return l?d[e].name.toLowerCase()<d[t].name.toLowerCase()?-1:d[e].name.toLowerCase()>d[t].name.toLowerCase()?1:0:r>n?-1:r<n?1:0})).map((function(e,t){var r=d[e],n=0;return o[r._id]&&(n+=Object.keys(o[r._id]).filter((function(e){return o[r._id]&&o[r._id][e]&&!o[r._id][e].deleted&&o[r._id][e].user&&o[r._id][e].user._id&&a&&a._id&&o[r._id][e].user._id!==a._id&&"comment"===o[r._id][e].type&&(!o[r._id][e].readedBy||!o[r._id][e].readedBy[a._id])})).length),o[a._id]&&(n+=Object.keys(o[a._id]).filter((function(e){return o[a._id]&&o[a._id][e]&&!o[a._id][e].deleted&&o[a._id][e].user&&o[a._id][e].user._id===r._id&&"comment"===o[a._id][e].type&&(!o[a._id][e].readedBy||!o[a._id][e].readedBy[a._id])})).length),{_id:e,name:r.name,image:r.image||null,countMessages:n,lastMessage:r.lastMessage||null,deleted:r.deleted||!1,_parent:r._parent||null}})),g=function(r){var a=r.index,o=r.style,c=m[a];return i.a.createElement("div",{style:o},i.a.createElement("div",{className:n&&n.nodeId===c._id?l?t.userActiveExtended:t.userActive:l?t.userExtended:t.user,style:Object(h.a)({height:55,display:"flex",justifyContent:"center",alignItems:"center",margin:"auto",cursor:"pointer"},n&&n.nodeId===c._id?{backgroundColor:"rgba(250,250,250,0.1)"}:{}),onClick:function(){e.openChat(c._id)}},i.a.createElement(et,{title:i.a.createElement(i.a.Fragment,null,c.name?c.name:c.name&&c.name.split(" ").lenth>0?c.name.split(" ")[0]:"",!c.name&&c.name&&c.name.split(" ").lenth>0?c.name.split(" ")[0]:"")},i.a.createElement("div",{style:{width:"100%"}},l?i.a.createElement("div",{style:{display:"flex",width:"100%",justifyContent:"left",alignItems:"center",marginTop:"10px"}},i.a.createElement(Pt.a,{overlap:"rectangular",badgeContent:c.countMessages,color:"secondary",style:{width:"37px",display:"flex",alignItems:"center"}},i.a.createElement(sc,{overlap:"circular",anchorOrigin:{vertical:"bottom",horizontal:"right"},userId:c._id},i.a.createElement(i.a.Fragment,null,i.a.createElement(nn.a,{alt:c.displayName?c.displayName:c.name,src:"".concat(c.image),style:{width:"29px",height:"29px",marginTop:"-10px"}}),c._parent&&e.store.users[c._parent]&&e.store.users[c._parent].image?i.a.createElement("div",{style:{position:"absolute",bottom:4,right:-7,width:15,height:15,borderRadius:"50%",backgroundImage:"url(".concat(e.store.users[c._parent].image,")"),backgroundSize:"cover",backgroundRepeat:"no-repeat"}}):i.a.createElement(i.a.Fragment,null)))),i.a.createElement("div",{style:{fontSize:"14px",maxWidth:"calc(100% - 30px)",paddingLeft:"7px",color:"gray",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"}},c.name?c.name:c.name&&c.name.split(" ").lenth>0?c.name.split(" ")[0]:"",!c.name&&c.name&&c.name.split(" ").lenth>0?c.name.split(" ")[0]:"",c._parent&&e.store.users[c._parent]?i.a.createElement("div",{style:{fontSize:10,color:"lightgray",marginTop:"-7px"}},e.store.users[c._parent].name):i.a.createElement(i.a.Fragment,null))):i.a.createElement(Pt.a,{overlap:"rectangular",badgeContent:c.countMessages,color:"secondary",style:{display:"flex",alignItems:"center",padding:0,width:"80%",marginTop:"16px"}},i.a.createElement(sc,{overlap:"circular",anchorOrigin:{vertical:"bottom",horizontal:"right"},userId:c._id},i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:Object(h.a)(Object(h.a)({width:33,height:33,marginTop:"-10px"},c.deleted?{border:"solid 2px red"}:{}),{},{borderRadius:"50%",backgroundColor:c.image?"none":"lightgray",backgroundImage:'url("'.concat(c.image,'")'),backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center center",display:"flex",justifyContent:"center",alignItems:"center"})},i.a.createElement("span",{style:{color:dt("menu"),fontWeight:"bold",letterSpacing:"-2px !important"}},c.image?"":"".concat(c.name.substr(0,1).toUpperCase()).concat(c.name.split(" ").length>1?" ".concat(c.name.split(" ")[1].substr(0,1).toUpperCase()):""))),c._parent&&e.store.users[c._parent]&&e.store.users[c._parent].image?i.a.createElement("div",{style:{position:"absolute",bottom:4,right:-7,width:15,height:15,borderRadius:"50%",backgroundImage:"url(".concat(e.store.users[c._parent].image,")"),backgroundSize:"cover",backgroundRepeat:"no-repeat"}}):i.a.createElement(i.a.Fragment,null))))))))};return i.a.createElement(zc.a,{style:{width:"100%",height:"100%"}},(function(e){var t=e.height;e.width;return i.a.createElement($c.a,{height:t,itemCount:m.length,itemSize:55,width:l?295:58,itemData:m,style:{height:"100%"}},g)}))}))),hg=function(e){return Object(h.a)(Object(h.a)({},rr),{},{menu:{position:"absolute",borderRight:dt("color"),background:dt("ColumnTitleColor"),top:0,left:0,right:0,bottom:0,overflowY:"auto",overflowX:"hidden",display:"flex",flexDirection:"column",alignItems:"center"},menuExpanded:{position:"absolute",borderRight:dt("color"),top:0,left:0,right:0,bottom:0,overflowY:"auto",overflowX:"hidden",display:"flex",flexDirection:"column",alignItems:"baseline",paddingLeft:"15px",paddingRight:"15px",boxShadow:"inset 4px 0px 3px 0px rgb(0 0 0 / 17%)"},button:{padding:"7px 0px",display:"flex",justifyContent:"center"},buttonColor:{padding:"12px",display:"flex",justifyContent:"center",backgroundColor:dt("color"),alignItems:"center",width:"-webkit-fill-available"},buttonColorExpanded:{position:"relative",float:"left",padding:"12px",display:"flex",backgroundColor:dt("color"),alignItems:"center",width:"100%"},separator:{position:"relative",float:"left",width:"100%",padding:"7px",borderTop:"1px solid ".concat(dt("medium",.5)),marginTop:"15px",marginBottom:"0px",height:"1px"}})};function mg(){mg=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var gg=Object($e.b)((function(){return{}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.chat,n=(t.session,i.a.useState("chats")),a=Object(Be.a)(n,2),o=a[0],c=a[1],l=i.a.useState(e.usersStatus),s=Object(Be.a)(l,2),u=(s[0],s[1],i.a.useState("")),d=Object(Be.a)(u,2),p=d[0],f=d[1],m=i.a.useState(!1),g=Object(Be.a)(m,2),v=g[0],y=g[1],b=Object(Lt.a)(hg)(),x=window.location.hash.split("/");x[0]=x[0].replace("#",""),i.a.useEffect((function(){c("chats"),y(e.expanded)}),[e.expanded]),xt();var _=function(){var t=Object(Me.a)(mg().mark((function t(n,a){var o;return mg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=De.getState().db.cards[n]?"cards":"users",f(""),De.getState().db[o]&&De.getState().db[o][n]&&!De.getState().db[o][n]._loadTimeline?e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},r),{},{db:a,nodeId:n,loading:"users"!==a})):e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},r),{},{db:a,nodeId:n,loading:!1})),e.subMenuExpanded(!1),c("chats");case 5:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}();return i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:v?b.menuExpanded:b.menu,style:{paddingTop:5}},v&&("internalGroups"===o||"externalGroups"===o)&&i.a.createElement("div",{className:v?b.buttonColorExpanded:b.buttonColor,style:{marginTop:"-15px"}},i.a.createElement(rn,{text:v?lt("$__newGroup","*"):null,title:v?null:lt("$__newGroup","*"),icon:"add_box",iconColor:"#FFFFFF",textColor:"#FFFFFF",onClick:function(){e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{id:"new",activeModule:"cardEdit",db:"cards",data:{type:"chatGroup",status:"inProgress"}}))}})),i.a.createElement("div",{className:b.button,style:{display:"flex",height:"46px",marginBottom:"7px",width:"100%"}},v?i.a.createElement("div",{className:b.textField,style:{width:"100%"}},i.a.createElement(La,{className:b.noLabelLight,label:lt("$__search","*"),variant:"standard",autoFocus:!0,value:p,InputProps:{endAdornment:i.a.createElement(To.a,{position:"start"},i.a.createElement(kt,{color:dt("colorText")},"search")),onChange:function(e){f(e.target.value)}}})):i.a.createElement(rn,{title:v?null:lt("$__search","*"),icon:"search",iconColor:dt("colorText"),textColor:dt("colorText"),onClick:function(){e.subMenuExpanded(!0)}})),i.a.createElement("div",{style:{position:"absolute",top:v?50:40,bottom:7,overflowY:"auto",overflowX:"hidden",left:v?7:0,paddingLeft:v?5:0,right:0,paddingTop:7}},i.a.createElement(fg,{expanded:v,openChat:function(e){return _(e,"cards")},find:p,onLine:e.onLine}))))}));var vg=Object($e.b)((function(e){return{}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState().session,r=i.a.useState({}),n=Object(Be.a)(r,2),a=n[0],o=n[1];return i.a.useEffect((function(){o(e.typing)}),[e.typing]),a&&e.nodeId&&e.nodeId!==t._id&&a.me&&a.me[e.nodeId]?i.a.createElement("div",{style:{marginLeft:15,fontSite:12,color:"lightgray",fontWeight:"normal"}},lt("$__typing"),"..."):e.nodeId&&a&&a[e.nodeId]&&Object.keys(a[e.nodeId]).filter((function(r){return t&&t._id&&r!==t._id&&a[e.nodeId][r]})).length>0?i.a.createElement("div",{style:{marginLeft:15,fontSite:12,color:"lightgray",fontWeight:"normal",display:"flex",alignItems:"center"}},Object.keys(a[e.nodeId]).filter((function(r){return r!==t._id&&a[e.nodeId][r]})).map((function(t,r){var n="";if(De.getState().db.cards[e.nodeId]._users[t].name)n=De.getState().db.cards[e.nodeId]._users[t].name;else if(De.getState().db.cards[e.nodeId]._users[t].name){var a=De.getState().db.cards[e.nodeId]._users[t].name.split(" ");n="".concat(a[0]).concat(a.length>1?" ".concat(a[a.length-1]):"")}return i.a.createElement(Qe.a,{title:n,key:t},i.a.createElement(nn.a,{style:{width:22,height:22,border:"none"},alt:n,src:De.getState().db.cards[e.nodeId]._users[t].image||null},n.substr(0,1)))})),i.a.createElement("span",{style:{marginLeft:7}},lt("$__typing"),"...")):i.a.createElement(i.a.Fragment,null)})),yg=function(e){return Object(h.a)(Object(h.a)({},rr),{},{menu:{position:"relative",borderRight:dt("color")},menuExpanded:{position:"relative",borderRight:dt("color")},button:{position:"relative",float:"left",width:"100%",padding:"7px"},avatarGroup:{"& .MuiAvatar-root":{width:"22px !important",height:"22px !important"}},buttonColor:{position:"relative",float:"left",width:"calc(100% + 20px)",padding:"20px 12px",marginLeft:"-12px",display:"flex",justifyContent:"center",backgroundColor:dt("color")},buttonColorExpanded:{position:"relative",float:"left",width:"calc(100% + 20px)",padding:"20px",marginLeft:"-12px",display:"flex",backgroundColor:dt("color")},separator:{position:"relative",float:"left",width:"100%",padding:"7px",borderTop:"1px solid ".concat(dt("medium",.5)),marginTop:"15px",marginBottom:"0px",height:"1px"}})};var bg=Object($e.b)((function(e){return{usersStatus:e.usersStatus&&e.usersStatus?e.usersStatus:{}}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState().session,r=i.a.useState(e.usersStatus),n=Object(Be.a)(r,2),a=n[0],o=n[1],c=i.a.useState(!1),l=Object(Be.a)(c,2),s=l[0],u=l[1];return i.a.useEffect((function(){return o(e.usersStatus),function(){}}),[e.usersStatus]),i.a.createElement(i.a.Fragment,null,i.a.createElement(At,{id:"chat_menu",title:"".concat(lt("$__showOnlyOnline","*")," ").concat(Object.keys(a.users).filter((function(e){return a.users[e]&&e!==t._id})).length>0?" (".concat(Object.keys(a.users).filter((function(e){return a.users[e]&&e!==t._id})).length,")"):""),text:"".concat(lt("$__showOnlyOnline","*")," ").concat(Object.keys(a.users).filter((function(e){return a.users[e]&&e!==t._id})).length>0?" (".concat(Object.keys(a.users).filter((function(e){return a.users[e]&&e!==t._id})).length,")"):""),color:dt("colorText"),icon:s?"toggle_on":"toggle_off",onClick:function(){u((function(e){return!e})),e.onClick&&e.onClick(!s)},size:"25px",textSize:"11px",transparent:!0}))}));var xg=Object($e.b)((function(e){return{chat:e.chat}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(yg)((function(e){var t=e.classes,r=i.a.useState(null),n=Object(Be.a)(r,2),a=n[0],o=n[1],c=i.a.useState(!1),l=Object(Be.a)(c,2),s=l[0],u=l[1],d=i.a.useState(!1),p=Object(Be.a)(d,2),f=p[0],m=p[1],g=i.a.useState(!1),v=Object(Be.a)(g,2),y=v[0],b=v[1],x=xt();if(i.a.useEffect((function(){var t=!0;return t&&JSON.stringify(e.chat)!==JSON.stringify(a)&&o(e.chat),function(){t=!1}}),[e.chat]),!a)return i.a.createElement(i.a.Fragment,null);var _=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t||!De.getState()||!(De.getState().lightBox&&De.getState().lightBox.open||De.getState().sideModule&&De.getState().sideModule.id)){var r=document.getElementsByClassName("Toastify__toast").length,n=document.getElementsByClassName("forwardMessage").length;console.log(n),0===r&&0===n&&e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},a),{},{open:!1}))}};if(a&&!a.open)return i.a.createElement(i.a.Fragment,null);var w=a&&a.nodeId&&De.getState().db.cards&&De.getState().db.cards[a.nodeId]?"cards":"users",E=De.getState().db[w][a.nodeId]?De.getState().db[w][a.nodeId]:null;return i.a.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:3e3,backgroundColor:"rgba(250,250,250,0.7)",backdropFilter:"blur(3px)"}},i.a.createElement(pn.a,{onClickAway:function(){_()}},i.a.createElement("div",{style:Object(h.a)(Object(h.a)(Object(h.a)({position:"fixed"},window.innerWidth>600?{top:77,left:77,right:77,bottom:77}:{top:50,left:7,right:7,bottom:7}),window.innerWidth>600?{zIndex:3}:{zIndex:6e3}),{},{boxShadow:"0px 0px 10px 3px rgba(0,0,0,0.2)",borderRadius:"15px",overflow:"hidden"})},i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{style:{position:"absolute",top:0,left:0,right:0,height:40,background:dt("ColumnTitleColor"),display:"flex",alignItems:"center"}},i.a.createElement("div",{style:{position:"absolute",left:13}},i.a.createElement(At,{id:"chat_menu",title:lt("$__menu","*"),color:dt("colorText"),icon:"menu",onClick:function(){u((function(e){return!e})),s&&b(!1)},size:"25px",transparent:!0})),s?i.a.createElement("div",{style:{position:"absolute",left:45,color:dt("colorText")}},i.a.createElement(At,{id:"addGroup",title:lt("$__createChatGroup","*"),icon:"add_circle_outline",onClick:function(){_(!0),e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{id:"new",activeModule:"cardEdit",db:"cards",data:{type:"chatGroup",status:"inProgress"}}))},size:"25px",transparent:!0,color:dt("colorText")})):i.a.createElement(i.a.Fragment,null),s?i.a.createElement("div",{style:{position:"absolute",left:80}},i.a.createElement(bg,{onClick:function(e){b(e)}})):i.a.createElement(i.a.Fragment,null),i.a.createElement("div",{style:{position:"absolute",left:s?320:53,right:80,color:dt("colorText"),fontSize:"12px",fontWeight:"bold"}},a&&a.nodeId&&E?i.a.createElement("div",{style:{display:"flex",alignItems:"center"}},i.a.createElement(sc,{overlap:"circular",anchorOrigin:{vertical:"bottom",horizontal:"right"},userId:a.nodeId},i.a.createElement(nn.a,{alt:E.displayName?E.displayName:E.name,src:E.image?"".concat(E.image):null,style:{width:"30px",height:"30px"}})),i.a.createElement("div",{style:{fontSize:"14px"}},E.name," ",i.a.createElement("span",{style:{fontSize:10,fontWeight:"normal"}},De.getState().usersStatus&&De.getState().usersStatus.users&&De.getState().usersStatus.users[a.nodeId]&&"away"===De.getState().usersStatus.users[a.nodeId].status&&De.getState().usersStatus.users[a.nodeId].updatedAt?"(".concat(lt("$__lastSeeTime"),": ").concat(Ot(De.getState().usersStatus.users[a.nodeId].updatedAt),")"):"")),a&&a.nodeId&&De.getState().db.cards[a.nodeId]&&"chatGroup"===De.getState().db.cards[a.nodeId].type&&De.getState().db.cards[a.nodeId]._users&&Object.keys(De.getState().db.cards[a.nodeId]._users).length>0&&i.a.createElement("div",{classes:t.avatarGroup,style:{marginLeft:15}},i.a.createElement(Yo.a,{max:150},Object.keys(De.getState().db.cards[a.nodeId]._users).length>0&&Object.keys(De.getState().db.cards[a.nodeId]._users).map((function(e,t){var r="";if(De.getState().db.cards[a.nodeId]._users[e].name)r=De.getState().db.cards[a.nodeId]._users[e].name;else if(De.getState().db.cards[a.nodeId]._users[e].name){var n=De.getState().db.cards[a.nodeId]._users[e].name.split(" ");r="".concat(n[0]).concat(n.length>1?" ".concat(n[n.length-1]):"")}if(t<17)return i.a.createElement(Qe.a,{title:r,key:t},i.a.createElement(nn.a,{style:{width:22,height:22,border:"none"},alt:r,src:De.getState().db.cards[a.nodeId]._users[e].image||null},r.substr(0,1)));if(17===t){var o=Object.keys(De.getState().db.cards[a.nodeId]._users).length-17;return i.a.createElement(Qe.a,{title:i.a.createElement("ul",{style:{listingStyle:"none",padding:0}},Object.keys(De.getState().db.cards[a.nodeId]._users).map((function(e,t){if(t>16&&De.getState().db.cards[a.nodeId]._users[e]&&De.getState().db.cards[a.nodeId]._users[e].name)return i.a.createElement("li",null,De.getState().db.cards[a.nodeId]._users[e].name)}))),key:t},i.a.createElement(nn.a,{style:{width:22,height:22,border:"none"},alt:"+".concat(o)},i.a.createElement("span",{style:{fontSize:10}},"+".concat(o))))}})))),i.a.createElement(vg,{nodeId:a.nodeId})):i.a.createElement("div",null,lt("$__chats",1))),i.a.createElement("div",{style:{position:"absolute",right:5,display:"flex"}},a&&a.nodeId?i.a.createElement(i.a.Fragment,null,i.a.createElement(At,{id:"chat_files",title:lt("$__files","*"),color:dt("colorText"),icon:"folder_special",onClick:function(){m((function(e){return!e}))},size:"25px",transparent:!0})):i.a.createElement(i.a.Fragment,null),i.a.createElement(At,{id:"chat_settings",title:lt(De.getState().chat.notifications?"$__chatNotificationsActive":"$__chatNotificationsOff",1),color:dt("colorText"),icon:De.getState().chat.notifications?"notifications_active":"notifications_off",onClick:function(){e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},a),{},{notifications:!De.getState().chat.notifications}))},size:"25px",transparent:!0}),a&&a.nodeId&&De.getState().db.cards[a.nodeId]&&"chatGroup"===De.getState().db.cards[a.nodeId].type&&De.getState().db.cards[a.nodeId]._users&&De.getState().db.cards[a.nodeId]._users[De.getState().session._id]&&(parseInt(De.getState().db.cards[a.nodeId]._users[De.getState().session._id].access)>4||x&&x.user&&x.plan&&x.userAdmin&&x.planAdmin)&&i.a.createElement(At,{id:"chat_settings",title:lt("$__preffers","*"),color:dt("colorText"),icon:"settings",onClick:function(){e.reduxFunction("ASYNC","SET_MODULE",Object(h.a)(Object(h.a)({},De.getState().sideModule),{},{id:a.nodeId,activeModule:"cardEdit",db:"cards",data:Object(h.a)({},De.getState().db.cards[a.nodeId]?De.getState().db.cards[a.nodeId]:{})})),_(!0)},size:"25px",transparent:!0}),i.a.createElement(At,{id:"chat_closeButton",title:lt("$__close","*"),color:dt("colorText"),icon:"close",onClick:function(){_(!0),b(!1)},size:"25px",transparent:!0}))),i.a.createElement("div",{style:Object(h.a)({position:"absolute",top:40,left:0,bottom:0,backgroundColor:"rgba(246,246,246,1)",borderRight:"solid 4px ".concat(dt("color")),padding:"7px"},s?{width:"311px"}:{width:"60px"})},i.a.createElement(gg,{closeButton:function(){e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},a),{},{open:!1})),b(!1)},chat:!0,subMenuExpanded:function(e){u(e),b(!1)},expanded:s,onLine:y})),i.a.createElement("div",{style:{position:"absolute",left:s?312:55,top:40,right:f&&a&&a.nodeId?333:0,bottom:0,backgroundColor:"white"}},a&&a.nodeId?i.a.createElement(Xc,{types:["comment"],nodeId:a.nodeId,db:De.getState().db.cards[a.nodeId]?"cards":"users",confirmRead:!0,loading:!!a.loading,hideCards:!0,chat:!0}):i.a.createElement(i.a.Fragment,null)),f&&a&&a.nodeId?i.a.createElement("div",{style:{position:"absolute",top:40,right:0,bottom:0,width:"333px",backgroundColor:"#f1f3f4",zIndex:100,boxShadow:"-4px 0px 7px 3px rgba(0,0,0,0.1)"}},i.a.createElement(ws,{nodeId:a.nodeId,dark:!1})):i.a.createElement(i.a.Fragment,null)))))}))),_g=function(e){var t,r;return{root:{position:"fixed",top:"0px",left:"0px",width:"100%",height:"100vh",zIndex:100},rootHide:{position:"fixed",top:"0px",left:"0px",width:"100%",height:"50px",display:"flex",alignItems:"center",zIndex:100},topLogo:{position:"fixed",top:"0px",left:"0px",width:"100%",height:"50px",display:"flex",alignItems:"center",zIndex:100,justifyContent:"space-between"},bar:{backgroundColor:dt("menu"),position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:100},item:{height:"66px",alignItems:"center",width:"100%",display:"flex"},itemButtom:(t={padding:"7px",color:dt("color",.8),"&:hover":{color:dt("color",1),backgroundColor:"rgba(255,255,255,0.1)",borderRadius:"7px"},display:"flex",alignItems:"center"},Object(O.a)(t,"alignItems","center"),Object(O.a)(t,"cursor","pointer"),t),itemButtomActive:{width:"100%",padding:"7px",color:dt("color",1),backgroundColor:"rgba(255,255,255,0.2)",borderRadius:"7px",display:"flex",alignItems:"center",cursor:"pointer"},themeExample:(r={},Object(O.a)(r,e.breakpoints.up("md"),{left:"auto !important",right:"0 !important"}),Object(O.a)(r,e.breakpoints.down("sm"),{left:"0 !important",right:"auto !important"}),r),module:{position:"fixed",top:"0px",left:"147px",width:"70px",height:"100vh",backgroundColor:"rgba(246,246,246,1)",borderRight:"solid 4px ".concat(dt("color")),padding:"7px"},moduleExpanded:{position:"fixed",top:"0",left:"147px",width:"311px",height:"100vh",backgroundColor:"rgba(246,246,246,1)",zIndex:"100 !important",borderRight:"solid 4px ".concat(dt("color")),padding:"7px",overflowX:"auto"},moduleTitle:{width:"100%",height:"30px",fontSize:"18px",color:dt("color"),fontWeight:"bold",paddingLeft:"7px",marginTop:"15px"},sidebarWrapperWithPerfectScrollbar:{},separator:{position:"relative",float:"left",width:"100%",padding:"7px",borderTop:"1px solid ".concat(dt("medium",.5)),marginTop:"15px",marginBottom:"0px",height:"1px"},mainButton:{width:"100%",justifyContent:"space-between",display:"flex",alignItems:"center"},logoImg:{width:111,marginLeft:"15px",justifyContent:"center"},user:{zIndex:"150 !important"}}};function wg(){wg=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}r(168).config();var Eg=Object($e.b)((function(e,t){return{store:e,ownProps:t}}),(function(e){return Object(u.b)(n,e)}))(Object(Ze.a)(_g)((function(e){var t=De.getState(),r=t.chat,n=t.notifications,a=e.classes,o=i.a.useState(!1),c=Object(Be.a)(o,2),l=c[0],u=c[1],d=i.a.useState(null),p=Object(Be.a)(d,2),f=p[0],m=p[1],g=window.location.hash.split("/");g[0]=g[0].replace("#",""),i.a.useEffect((function(){l||u(!0)}),[n]);var v=function(){var t=Object(Me.a)(wg().mark((function t(n,a,o){var i,c=arguments;return wg().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=c.length>3&&void 0!==c[3]?c[3]:"users",!n||window.location.pathname===n&&a!==f||s.push(n),"chat"===a?e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},r),{},{open:!0,db:i,nodeId:o})):(m(a),e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},r),{},{open:!1}))),e.menuExpand&&e.menuExpand();case 4:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}(),y=po();return e.expanded?i.a.createElement("div",{className:a.root},i.a.createElement("div",{className:a.bar},i.a.createElement("div",{className:a.topLogo,id:"sideBar_logoMini"},i.a.createElement("img",{src:se.a,alt:"logo",className:a.logoImg,style:{width:"111px",marginLeft:"15px"}}),i.a.createElement(At,{title:lt("$__hideMenu",1),color:dt("color"),icon:"menu",onClick:e.menuExpand?function(){e.menuExpand()}:null,transparent:!0})),i.a.createElement("div",{style:{position:"absolute",top:"120px",bottom:"0px",overflowX:"auto",width:"100%"}},i.a.createElement("div",{className:a.item,id:"sideBar_button_dashboard"},i.a.createElement("div",{className:"/d"===window.location.pathname?a.itemButtomActive:a.itemButtom,onClick:function(){v("/d","dashboard")}},i.a.createElement(kt,{icon:"dashboard",badgeColor:"primary",color:"parent",badgeVisible:!0,title:"$__dashboard",size:"27px",style:{marginBottom:"7px",marginRight:"15px"}}),lt("$__dashboard","*"))),i.a.createElement("div",{className:a.item,id:"sideBar_button_chat"},i.a.createElement("div",{className:r.open?a.itemButtomActive:a.itemButtom,onClick:function(){e.menuExpand&&e.menuExpand(),e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},r),{},{open:!r.open}))}},i.a.createElement(Pt.a,{overlap:"rectangular",badgeContent:y&&y.total?y.total:0,color:"secondary"},i.a.createElement(kt,{icon:"chat",color:"parent",title:"$__chat",size:"27px",style:{marginBottom:"7px",marginRight:"15px"}})),lt("$__chat","*"))),i.a.createElement("div",{className:a.separator}),i.a.createElement("div",{className:a.item,id:"sideBar_button_StrategyAndPlans"},i.a.createElement("div",{className:"/sp"===window.location.pathname?a.itemButtomActive:a.itemButtom,onClick:function(){v("/sp","StrategyAndPlans")}},i.a.createElement(kt,{icon:"view_comfy",badgeColor:"primary",color:"parent",badgeVisible:!0,title:lt("$__StrategyAndPlans"),size:"27px",style:{marginBottom:"7px",marginRight:"15px"}}),lt("$__StrategyAndPlans","*"))),i.a.createElement("div",{className:a.item,id:"sideBar_button_myTasks"},i.a.createElement("div",{className:"/t"===window.location.pathname?a.itemButtomActive:a.itemButtom,onClick:function(){v("/t","myTasks")}},i.a.createElement(kt,{icon:"task",badgeColor:"primary",color:"parent",badgeVisible:!0,title:lt("$__mytasks"),size:"27px",style:{marginBottom:"7px",marginRight:"15px"}}),lt("$__mytasks","*"))),i.a.createElement("div",{className:a.item,id:"sideBar_button_library"},i.a.createElement("div",{className:"/library"===window.location.pathname?a.itemButtomActive:a.itemButtom,onClick:function(){v("/library","library")}},i.a.createElement(kt,{icon:"folder",badgeColor:"primary",color:"parent",badgeVisible:!0,title:lt("$__library"),size:"27px",style:{marginBottom:"7px",marginRight:"15px"}}),lt("$__library","*"))),i.a.createElement("div",{className:a.item,id:"sideBar_button_brightandconnected"},i.a.createElement("div",{className:"/bright-and-connected"===window.location.pathname?a.itemButtomActive:a.itemButtom,onClick:function(){v("/bright-and-connected","bright-and-connected")}},i.a.createElement(kt,{icon:U.a,badgeColor:"primary",color:"parent",badgeVisible:!0,title:"BRIGHT & CONNECTED",size:"27px",style:{marginBottom:"7px",marginRight:"15px"}}),"BRIGHT & CONNECTED"))))):i.a.createElement("div",{className:a.rootHide},i.a.createElement("div",{className:a.mainButton,id:"sideBar_logoMini"},i.a.createElement("img",{src:se.a,alt:"logo",className:a.logoImg,style:{width:"111px",marginLeft:"15px"},onClick:function(){e.menuExpand()}}),i.a.createElement(At,{title:lt("$__showMenu",1),color:dt("menu"),icon:"menu",onClick:e.menuExpand?function(){e.menuExpand()}:null,transparent:!0})))})));var Og=Object($e.b)((function(e){return{card:e.card}}),(function(e){return Object(u.b)(n,e)}))((function(e){return console.log("AQUI PRECISA SER CRIADO O PAINEL DE MODELOS DE FLUXOS"),i.a.createElement(Ko.a,{fullWidth:!0,"aria-labelledby":"simple-dialog-title",open:!!e.card.action},i.a.createElement("div",{style:{position:"relative",marginLeft:"10px",marginTop:"5px",width:"calc(100% - 10px)"}},i.a.createElement(Fa,{title:lt("$__".concat(e.card.action),1),icon:"label",onCancel:function(){e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{history:"".concat(window.location.pathname).concat(window.location.hash)}))}})))})),jg=Object($e.b)((function(e){return{board:e.controls.board}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t=De.getState(),r=t.db,n=t.session;if(!e.board)return i.a.createElement(i.a.Fragment,null);var a=window.location.hash.split("/");a[0]=a[0].replace("#","");var o=r.cards[e.board],c=o._parent?r.cards[o._parent]:null,l=c&&c._parent!==a[0]&&r.cards[c._parent]&&r.cards[c._parent]._users&&r.cards[c._parent]._users[n._id]?r.cards[c._parent]:null;return i.a.createElement("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backdropFilter:"blur(3px)"}},i.a.createElement(pn.a,{onClickAway:function(){}},i.a.createElement("div",{style:{position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px",display:"flex",justifyContent:"center",alignItems:"center"},onClick:function(e){e.preventDefault(),e.stopPropagation()}},i.a.createElement("div",{style:{position:"relative",width:"calc(100% - 100px)",backgroundColor:"#FFFFFF",margin:"auto",boxShadow:"0px 0px 10px 3px rgba(0,0,0,0.2)"}},i.a.createElement("div",{style:{position:"relative",width:"100%",backgroundColor:"#FFFFFF",padding:"9px",height:"40px",margin:"auto",background:dt("ColumnTitleColor")}},i.a.createElement("div",{style:{fontSize:"14px",color:dt("color"),display:"flex",justifyContent:"flex-start",alignItems:"center"}},l&&l._id&&i.a.createElement("div",{style:{marginRight:15,display:"flex",justifyContent:"flex-start",alignItems:"center"}},i.a.createElement(Fa,{title:"".concat((null===l||void 0===l?void 0:l.name)||lt("$__undefinedName",1)," "),searchText:(null===e||void 0===e?void 0:e.searchText)||null,icon:(null===l||void 0===l?void 0:l.icon)||l.type&&r&&r.dataType&&r.dataType.filter((function(e){return e.name===l.type}))[0]&&r.dataType.filter((function(e){return e.name===l.type}))[0].icon||"$__topic",iconTitle:"$__".concat(l.type),color:dt("textColor"),backClick:function(t){e.reduxFunction("ASYNC","SET_CONTROL",Object(h.a)(Object(h.a)({},De.getState().control),{},{board:l._id}))}}),i.a.createElement("div",{style:{marginTop:-5}},i.a.createElement(kt,{icon:"navigate_next",color:dt("textColor")}))),i.a.createElement("div",null,i.a.createElement(Fa,{title:"".concat((null===o||void 0===o?void 0:o.name)||lt("$__undefinedName",1)," "),searchText:(null===e||void 0===e?void 0:e.searchText)||null,icon:(null===o||void 0===o?void 0:o.icon)||o.type&&r&&r.dataType&&r.dataType.filter((function(e){return e.name===o.type}))[0]&&r.dataType.filter((function(e){return e.name===o.type}))[0].icon||"$__topic",iconTitle:"$__".concat(o.type),color:dt("textColor")}))),i.a.createElement("div",{style:{position:"absolute",right:5,top:5}},i.a.createElement(At,{id:"close_kanban",title:lt("$__close","*"),color:dt("color"),icon:"close",onClick:function(){e.reduxFunction("ASYNC","SET_CONTROL",Object(h.a)(Object(h.a)({},De.getState().control),{},{board:null}))},size:"25px",transparent:!0}))),i.a.createElement("div",{style:{position:"relative",padding:"9px"}},i.a.createElement(Ut,null,i.a.createElement(Df,{nodeId:e.board,columProps:{style:{height:"calc(100vh - 277px)"}}})))))))}));function Sg(){Sg=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}r(168).config();var kg,Lg=function(){var e=Object(Me.a)(Sg().mark((function e(t,r){var n,a,o;return Sg().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=De.getState(),a=n.db,o="cards",a.cards[r._id]?o="cards":a.users[r._id]&&(o="users"),De.getState().db&&De.getState().db[o]&&De.getState().db[o][r._id]&&t.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},Object(O.a)({},o,Object(h.a)(Object(h.a)({},De.getState().db[o]),{},Object(O.a)({},r._id,Object(h.a)(Object(h.a)({},De.getState().db[o][r._id]),r))))));case 4:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),Cg=r(1013),Ig=function(e){return{backdrop:{zIndex:e.zIndex.drawer+1,backgroundColor:"rgba(0,0,0,0.66) !important"},wrapper:{position:"absolute",top:"70px",left:"0",right:"0",bottom:"0",height:"calc(100vh - 60px)"},mainPanel:{overflow:"auto",position:"absolute",top:"0",left:"0",right:"0",bottom:"0"},content:{marginTop:"0px",padding:"15px"},container:Object(h.a)({},er),map:{marginTop:"0px"},mainPanelSidebarMini:Object(O.a)({},e.breakpoints.up("md"),{width:"calc(100% - 0px)"})}},Fg=function(e){return{wrapper:{height:"auto",minHeight:"100vh",position:"relative",top:"0"},fullPage:{padding:"120px 0",position:"relative",minHeight:"100vh",display:"flex!important",margin:"0",border:"0",color:"#FFF",alignItems:"center",backgroundSize:"cover",backgroundPosition:"center center",height:"100%","& footer":{position:"absolute",bottom:"0",width:"100%",border:"none !important"},"&:before":{backgroundColor:"rgba("+Zt("#000")+", 0.22)"},"&:before,&:after":{display:"block",content:'""',position:"absolute",width:"100%",height:"100%",top:"0",left:"0",zIndex:"2"}}}},Tg=(r(1681),r(1009));function Ng(){Ng=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,r){return e[t]=r}}function s(e,t,r,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:_(e,r,c)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}e.wrap=s;var d={};function p(){}function f(){}function h(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&r.call(v,o)&&(m=v);var y=h.prototype=p.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=u(e[a],e,o);if("throw"!==l.type){var s=l.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(d).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function _(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=h,n(y,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:f,configurable:!0}),f.displayName=l(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}var Pg=new Audio(r.n(Tg).a);r(168).config();var Dg="true"===String("true")?"https://ws.machen.ai":"http://localhost:3001";var Ag=Object(Xe.default)(qe.a)(kg||(kg=Object(ze.a)(["\n&&&.Toastify__toast-container {\n min-width:407px !important;\n z-index:33333;\n}\n.Toastify__toast {\n z - index:33333;\n }\n.Toastify__toast-body {\n z - index:33333;\n }\n.Toastify__progress-bar { }\n"]))),$g=Object($e.b)((function(){return{}}),(function(e){return Object(u.b)(n,e)}))((function(e){var t,r=Object.assign({},(Object(Ye.a)(e),e)),n=De.getState(),a=n.session,o=n.chat,c=i.a.useState({}),l=Object(Be.a)(c,2),u=l[0],d=l[1],p=i.a.useState(!1),m=Object(Be.a)(p,2),g=m[0],v=m[1],y=i.a.useState(!1),b=Object(Be.a)(y,2),x=b[0],_=b[1],w=i.a.useState(!0),E=Object(Be.a)(w,2),j=E[0],S=E[1],k=i.a.useState(!1),L=Object(Be.a)(k,2),C=L[0],I=(L[1],i.a.useState(!1)),F=Object(Be.a)(I,2),T=F[0],N=F[1],P=i.a.useState(!0),D=Object(Be.a)(P,2),A=D[0],$=D[1],z=i.a.useState(!1),M=Object(Be.a)(z,2),B=M[0],Y=M[1],G=i.a.useState(null),R=Object(Be.a)(G,2),H=R[0],W=R[1],U=Object(Lt.a)(g?Ig:Fg)(),V=i.a.createRef(),q=U.mainPanel+" "+We()((t={},Object(O.a)(t,U.mainPanelSidebarMini,!0),Object(O.a)(t,U.mainPanelWithPerfectScrollbar,navigator.platform.indexOf("Win")>-1),t)),X=i.a.createRef(),J=i.a.createRef();i.a.useEffect((function(){J.current={offline:!1};var t=function(){var t=Object(Me.a)(Ng().mark((function t(r){var n;return Ng().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Sn.post("/WhiteLabel",{url:r});case 2:(n=t.sent)&&((null===n||void 0===n?void 0:n.data)&&(d(n.data),e.reduxFunction("ASYNC","SET_SESSION",Object(h.a)(Object(h.a)({},a),{},{custom:Object(h.a)(Object(h.a)({},a.custom),n.data)}))),ee());case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),r=(localStorage.getItem("TOKEN"),window.location.hostname);(r=r.replace(".machen.ai",""))&&-1===r.indexOf("software")&&-1===r.indexOf("hom2022")&&-1===r.indexOf("localhost")?t(r):ee(),W(se($m))}),[]),i.a.useEffect((function(){var t=window.location.hash.split("/");t[0]=t[0].replace("#",""),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{history:"".concat(window.location.pathname).concat(window.location.hash)})),ae(t)})),i.a.useEffect((function(){var e=window.location.hash.split("/");e[0]=e[0].replace("#",""),g&&(ae(e),ne(),K(!0),W(se($m)))}),[g]);var K=function(){var e=Object(Me.a)(Ng().mark((function e(t){var r,n,a,o;return Ng().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:J.current={offline:!1},window.addEventListener("dragover",(function(e){e.preventDefault()}),!1),window.addEventListener("drop",(function(e){e.preventDefault()}),!1),0,n=setInterval((function(){1}),1e3),a=setTimeout((function(){}),5e4),o=setInterval((function(){ee(!0)}),36e4),window.addEventListener("blur",(function(){clearInterval(n),clearInterval(o),n=0,r=Ve()().tz("America/Sao_Paulo").unix("X"),a=setTimeout((function(){Q("away")}),6e4)})),window.addEventListener("focus",function(){var e=Object(Me.a)(Ng().mark((function e(t){var i;return Ng().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(null===J||void 0===J||null===(i=J.current)||void 0===i?void 0:i.offline)||(ee(!0),clearInterval(o),o=setInterval((function(){ee(!0)}),36e4),clearTimeout(a),n||(n=setInterval((function(){1}),1e3)),Q("online"),r&&Ve()().tz("America/Sao_Paulo").unix("X")-r>30&&Z());case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Z=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;uo(Object(h.a)(Object(h.a)({},e),{},{fnIdentification:"Layouts/Index/loadData()-Users"}),{ids:[De.getState().session._id],db:"users",type:"comment",newUpdates:!0,lastDate:t})},Q=function(){var e=Object(Me.a)(Ng().mark((function e(t){return Ng().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:("online"===t&&De.getState().usersStatus.users&&De.getState().usersStatus.users[a._id]&&"online"!==De.getState().usersStatus.users[a._id].status||"away"===t&&De.getState().usersStatus.users&&De.getState().usersStatus.users[a._id]&&"away"!==De.getState().usersStatus.users[a._id].status)&&De.getState().functions.socket.emit("socketStatus",{socketStatus:t});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ee=function(){var t=Object(Me.a)(Ng().mark((function t(r){var n,o,i,c,l,d,p,f,m,y,b,x,_,w,E,k,L,C,I,F,T,P,D,A,$,z=arguments;return Ng().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=z.length>1&&void 0!==z[1]?z[1]:0,!J.current||J.current.offline){t.next=75;break}if(r){t.next=50;break}return t.prev=3,t.next=6,Sn.post("/verifysession");case 6:return o=t.sent,i=o&&o.data&&o.data.user&&o.data.user.language?{locale:o.data.user.language}:{all:!0},"#tab/languages"===window.location.hash&&(i={all:!0}),t.next=11,Sn.post("/M_Languages_V3",i);case 11:if(!(c=t.sent)){t.next=42;break}return t.next=15,new Promise((function(e,t){var r={};c.data.map((function(t,n){r=Object(h.a)(Object(h.a)({},r),{},Object(O.a)({},t.alias.name.toLowerCase(),{alias:t.alias.name.toLowerCase(),locales:t.locales})),n+1===c.data.length&&e(r)}))}));case 15:if(l=t.sent,!(o&&o.data&&o.data.token)){t.next=40;break}if(localStorage.setItem("TOKEN",o.data.token),e.reduxFunction("ASYNC","SET_SESSION",Object(h.a)(Object(h.a)({},o.data.user),(null===o||void 0===o||null===(d=o.data)||void 0===d||null===(p=d.user)||void 0===p||null===(f=p.GlobalData)||void 0===f?void 0:f.custom)?{custom:Object(h.a)(Object(h.a)(Object(h.a)({},a.custom),JSON.parse(null===o||void 0===o||null===(m=o.data)||void 0===m||null===(y=m.user)||void 0===y||null===(b=y.GlobalData)||void 0===b?void 0:b.custom)),{},{custom:null===o||void 0===o||null===(x=o.data)||void 0===x||null===(_=x.user)||void 0===_||null===(w=_.GlobalData)||void 0===w?void 0:w.custom},u)}:{})),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{users:Object(h.a)({},o.data.users?o.data.users:{})})),!l||!o){t.next=36;break}if(e.reduxFunction("ASYNC","SET_LANGUAGE",Object(h.a)({},l)),(!g||g&&JSON.stringify(g)!==JSON.stringify(o.data.user))&&JSON.stringify(g)!=JSON.stringify(o.data.user)&&v(Object(h.a)({},o.data.user)),"Notification"in window){t.next=27;break}console.log("Esse browser n\xe3o suporta notifica\xe7\xf5es desktop"),t.next=30;break;case 27:if("denied"===Notification.permission){t.next=30;break}return t.next=30,Notification.requestPermission();case 30:return"/"!==window.location.pathname&&0!==$m.filter((function(e){return e.auth&&e.path===window.location.pathname})).length||s.push("/d#tab/resume"),ce(),te(),t.abrupt("return",!0);case 36:e.reduxFunction("ASYNC","SET_LANGUAGE",Object(h.a)({},l)),v(!1);case 38:t.next=42;break;case 40:e.reduxFunction("ASYNC","SET_LANGUAGE",Object(h.a)({},l)),j&&S(!1);case 42:t.next=48;break;case 44:t.prev=44,t.t0=t.catch(3),console.log(t.t0),5===n?(N(!0),g&&v(!1),j&&S(!1),setTimeout((function(){window.open("/login","_self")}),6e4)):ee(r,n+1);case 48:t.next=73;break;case 50:return t.prev=50,t.next=53,Sn.post("/VerifySession",{ignoreUsers:!0});case 53:if(E=t.sent,k=De.getState().session,!(E&&E.data&&E.data.token)){t.next=65;break}if(localStorage.setItem("TOKEN",E.data.token),e.reduxFunction("ASYNC","SET_SESSION",Object(h.a)(Object(h.a)({},E.data.user),(null===E||void 0===E||null===(L=E.data)||void 0===L||null===(C=L.user)||void 0===C||null===(I=C.GlobalData)||void 0===I?void 0:I.custom)?{custom:Object(h.a)(Object(h.a)(Object(h.a)({},a.custom),JSON.parse(null===E||void 0===E||null===(F=E.data)||void 0===F||null===(T=F.user)||void 0===T||null===(P=T.GlobalData)||void 0===P?void 0:P.custom)),{},{custom:null===E||void 0===E||null===(D=E.data)||void 0===D||null===(A=D.user)||void 0===A||null===($=A.GlobalData)||void 0===$?void 0:$.custom},u)}:{})),De.getState().functions.socket.emit("socketStatus",{socketStatus:"online"}),!(E.data&&k&&k._id&&E.data.user&&k._id!==E.data.user._id)){t.next=63;break}return window.location.reload(),t.abrupt("return");case 63:t.next=68;break;case 65:localStorage.setItem("TOKEN",null),e.reduxFunction("ASYNC","CLEAR_SESSION"),"/login"!==window.location.pathname&&setTimeout((function(){window.open("/login","_self")}),300);case 68:t.next=73;break;case 70:t.prev=70,t.t1=t.catch(50),n>5?(localStorage.setItem("TOKEN",null),e.reduxFunction("ASYNC","CLEAR_SESSION"),"/login"!==window.location.pathname&&setTimeout((function(){window.open("/login","_self")}),300)):setTimeout((function(){ee(r,n+1)}),3e3);case 73:t.next=76;break;case 75:console.log("OFFLINE");case 76:case"end":return t.stop()}}),t,null,[[3,44],[50,70]])})));return function(e){return t.apply(this,arguments)}}(),te=function(){var t=Object(Me.a)(Ng().mark((function t(){var r,n;return Ng().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return re(),t.prev=1,t.next=4,Sn.get("/Tags_List");case 4:(r=t.sent)&&r.data&&(r.data.map((function(e){e._count=parseInt(e._count),e._countOthers=parseInt(e._countOthers)})),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{tag:r.data?r.data:[]}))),t.next=13;break;case 8:t.prev=8,t.t0=t.catch(1),console.group("Layout-ReqTags::ERR::"),console.log(t.t0),console.groupEnd();case 13:return t.prev=13,t.next=16,Sn.get("/M_User_Group_List");case 16:(n=t.sent)&&n.data&&e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{userGroup:n.data?n.data:[]})),t.next=25;break;case 20:t.prev=20,t.t1=t.catch(13),console.group("Layout-ReqGrpups::ERR::"),console.log(t.t1),console.groupEnd();case 25:case"end":return t.stop()}}),t,null,[[1,8],[13,20]])})));return function(){return t.apply(this,arguments)}}(),re=function(){var t=Object(Me.a)(Ng().mark((function t(r){var n,a;return Ng().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Sn.post("/M_User_List_V3",{id:r});case 3:if(!(n=t.sent)||!n.data){t.next=9;break}return a={},n.data.map(function(){var e=Object(Me.a)(Ng().mark((function e(t,r){return Ng().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=Object(h.a)(Object(h.a)({},a),{},Object(O.a)({},t.data._id,Object(h.a)(Object(h.a)(Object(h.a)(Object(h.a)(Object(h.a)(Object(h.a)(Object(h.a)(Object(h.a)({},De.getState().db.users&&De.getState().db.users[t.data._id]?De.getState().db.users[t.data._id]:{}),t.data),t.access?{_access:JSON.parse(t.access)}:{}),t._safety?{_safety:t._safety}:{}),t._token?{_token:{_id:t._token}}:{}),t.groups&&t.groups.filter((function(e){return e.value})).length>0?{groups:t.groups}:{}),t.tags&&t.tags.filter((function(e){return e.value})).length>0?{tags:t.tags}:{}),t._parent&&t._parent!==De.getState().session.account?{_parent:t._parent}:{})));case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{users:Object(h.a)(Object(h.a)({},De.getState().db.users),a)})),t.abrupt("return",!0);case 9:t.next=16;break;case 11:t.prev=11,t.t0=t.catch(0),console.group("Layout-ReqUsers::ERR::"),console.log(t.t0),console.groupEnd();case 16:case"end":return t.stop()}}),t,null,[[0,11]])})));return function(e){return t.apply(this,arguments)}}(),ne=function(){var t=Object(Me.a)(Ng().mark((function t(){return Ng().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,In(e,{cardLoad:"chat"});case 2:return t.next=4,uo(Object(h.a)(Object(h.a)({},e),{},{fnIdentification:"Layouts/Index/loadData()-Users"}),{ids:[De.getState().session._id],db:"users",type:"comment",ini:!0,limit:1});case 4:return t.next=6,uo(Object(h.a)(Object(h.a)({},e),{},{fnIdentification:"Layouts/Index/loadData()-Users"}),{ids:[De.getState().session._id],db:"users",type:"comment",ini:!0});case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ae=function(){var t=Object(Me.a)(Ng().mark((function t(r){var n=arguments;return Ng().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.length>1&&void 0!==n[1]&&n[1],!(g&&"/"!==window.location.pathname&&"/login"!==window.location.pathname&&e&&e.reduxFunction)){t.next=16;break}return t.next=4,In(e,{cardLoad:"myDay"});case 4:return t.next=6,In(Object(h.a)({},e),{cardLoad:"plans"});case 6:return t.next=8,In(Object(h.a)({},e),{cardLoad:"chat",ignoreLoader:!0});case 8:return t.next=10,Nn(e);case 10:if(!t.sent){t.next=14;break}return S(!1),t.abrupt("return",!0);case 14:t.next=17;break;case 16:return t.abrupt("return",!0);case 17:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),oe=function(){},ie=function(){var t=Object(Me.a)(Ng().mark((function t(r,n){return Ng().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.reduxFunction("ASYNC","SET_CHAT",Object(h.a)(Object(h.a)({},o),{},{open:!0,db:n,nodeId:r,loading:!1}));case 1:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),ce=function(){var t=Object(Me.a)(Ng().mark((function t(){var r;return Ng().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(Cg.a)(Dg,{transports:["websocket","polling"],query:{token:localStorage.getItem("TOKEN")}});case 2:return(r=t.sent)&&(de(r),e.reduxFunction("ASYNC","SET_FUNCTIONS",{socket:r})),t.abrupt("return",!0);case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),le=function(){var e=Object(Me.a)(Ng().mark((function e(t){return Ng().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"login"===t.fn?(localStorage.setItem("TOKEN",t.token),setTimeout((function(){window.open("/d#tab/resume","_self")}),1e3)):"alert"===t.fn&&ft(Object(h.a)({},t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),se=function t(r){var n=g;return r.map((function(r,a){if(r.auth&&(!r.AppAccess||r&&r.AppAccess&&n&&n._access)){var o;o=r.component;var c=!r.access&&!r.AppAccess;if(r.access&&r.access.map((function(e){n&&n[e]&&(c=!0)})),r.AppAccess&&r.AppAccess.map((function(e){n&&n._access&&n._access[e]&&(c=!0)})),c)return r.views&&r.views.length>0&&t(r.views),i.a.createElement(Ae.b,{path:r.path,component:function(){return i.a.createElement(o,null)},key:a,expanded:A,subMenu:!!e.subMenu})}}))},ue=function(){var t=Object(Me.a)(Ng().mark((function t(r){return Ng().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:localStorage.setItem("TOKEN",null),e.reduxFunction("ASYNC","CLEAR_SESSION"),setTimeout((function(){window.open("/login","_self")}),300);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),de=function(t){t.on("global",(function(e){"version"===e.fn&&ft({message:lt("$__appNewVersionAvaiable",1),hideiconvariant:!0,variant:"info",persist:!0,horizontal:"right",confirm:function(){window.location.reload()}}),"logout"===e.fn&&ue(),"reload"===e.fn&&window.location.reload()})),t.on("SWOT.UPD",(function(t){!function(e,t){De.getState().db.cards[t._id]&&!De.getState().db.cards[t._id]._selected&&t&&t._selected&&delete t._selected,e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},t._id,Object(h.a)(Object(h.a)({},De.getState().db.cards[t._id]),{},{_aspects:t.aspects})))})),e.reduxFunction("ASYNC","preLoader",Object(h.a)(Object(h.a)({},De.getState().preLoader),{},{autoSave:!0}))}(Object(h.a)(Object(h.a)({},e),{},{store:De.getState(),_sessionId:a._id}),t)})),t.on("copy.LOAD",(function(t){console.log("copy.LOAD",t),In(Object(h.a)(Object(h.a)({},e),{},{ignoreLoader:!0}),{cardLoad:"childrens",idRel:t._id})})),t.on("card.ADD",(function(t){t._id&&In(Object(h.a)(Object(h.a)({},e),{},{ignoreLoader:!0}),{cardLoad:"card",idRel:t._id})})),t.on("card.UPD",(function(t){Vn(e,t)})),t.on("card.MYDAY",(function(t){Kn(e,t)})),t.on("card.TIMER",(function(t){!function(e,t){var r=De.getState().db.cards[t.cardId]||null;r&&e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},t.cardId,Object(h.a)(Object(h.a)({},r),{},{_kpiTimer:t._kpiTimer})))}))}(e,t)})),t.on("card.UPDATE",(function(t){qn(e,t)})),t.on("card.ACCESS_UPD",function(){var t=Object(Me.a)(Ng().mark((function t(r){return Ng().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:ta(e,r);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),t.on("card.ACCESS_DELETE",(function(t){!function(e,t){if(!De.getState().db.cards[t.cardId])return!0;var r=Object(h.a)({},De.getState().db.cards[t.cardId]);r._users[t.userId]&&delete r._users[t.userId],e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},t.cardId,Object(h.a)({},r)))}))}(e,t)})),t.on("card.ACCESS_REMOVE",(function(t){!function(e,t){if(!De.getState().db.cards[t.cardId])return!0;var r=Object(h.a)({},De.getState().db.cards[t.cardId]);t.userIds&&t.userIds.length>0&&t.userIds.map((function(e){r._users[e]&&delete r._users[e]})),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},t.cardId,Object(h.a)({},r)))}))}(e,t)})),t.on("card.REORDER",(function(t){!function(e,t){var r=De.getState().db.cards,n=t.cards;n&&n.length>0&&(n.map((function(e,t){r=Object(h.a)(Object(h.a)({},r),{},Object(O.a)({},e,Object(h.a)(Object(h.a)({},r[e]),{},{order:"".concat(t+1)})))})),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),r)})))}(e,t)})),t.on("card.DELETE",(function(t){Wn(e,t,!0)})),t.on("card.unlinkChildrens",(function(t){na(e,t)})),t.on("unlinkChildrens",(function(t){na(e,t)})),t.on("card.changePlanId",(function(t){var r=window.location.hash.split("/");r[0]=r[0].replace("#","");var n=De.getState().sessionLoads.cards.load,a=Re()("".concat(JSON.stringify({idRel:r[0],cardLoad:"plan"}))).toString();r[0]===t.planId||Object.keys(n).length>0&&n[a]?In(Object(h.a)(Object(h.a)({},e),{},{ignoreLoader:!0}),{cardLoad:"plan",idRel:t.cardId,force:!0}):ea(e,t)})),t.on("node.UPDATE",(function(t){Lg(e,t)})),t.on("column.UPD",(function(t){!function(e,t){if(De.getState().db.cards[t._cardColumn]){var r=Object(h.a)(Object(h.a)({},De.getState().db.cards[t._cardColumn].boards[t._board].columns[t._columnId]),t._columnData),n=Object(f.a)(De.getState().db.cards[t._cardColumn].boards[t._board].columnOrder);t._columnsOrder&&(n=t._columnsOrder),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},t._cardColumn,Object(h.a)(Object(h.a)({},De.getState().db.cards[t._cardColumn]),{},{boards:Object(h.a)(Object(h.a)({},De.getState().db.cards[t._cardColumn].boards),{},Object(O.a)({},t._board,Object(h.a)(Object(h.a)({},De.getState().db.cards[t._cardColumn].boards[t._board]),{},{columnOrder:n,columns:Object(h.a)(Object(h.a)({},De.getState().db.cards[t._cardColumn].boards[t._board].columns),{},Object(O.a)({},t._columnId,r))})))})))}))}Xn(e)}(e,t)})),t.on("column.DELETE",(function(t){!function(e,t){if(De.getState().db.cards[t._parent]){var r=Object(f.a)(De.getState().db.cards[t._parent].boards[t._board].columnOrder),n=Object(h.a)({},De.getState().db.cards[t._parent].boards[t._board].columns);delete n[t._deleted],r.splice(r.indexOf(t._deleted),1),e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},t._parent,Object(h.a)(Object(h.a)({},De.getState().db.cards[t._parent]),{},{boards:Object(h.a)(Object(h.a)({},De.getState().db.cards[t._parent].boards),{},Object(O.a)({},t._board,Object(h.a)(Object(h.a)({},De.getState().db.cards[t._parent].boards[t._board]),{},{columnOrder:r,columns:n})))})))}))}}(e,t)})),t.on("column.REORDER",(function(t){!function(e,t){if(De.getState().db.cards[t._parent]){var r=t._order;e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{cards:Object(h.a)(Object(h.a)({},De.getState().db.cards),{},Object(O.a)({},t._parent,Object(h.a)(Object(h.a)({},De.getState().db.cards[t._parent]),{},{boards:Object(h.a)(Object(h.a)({},De.getState().db.cards[t._parent].boards),{},Object(O.a)({},t._board,Object(h.a)(Object(h.a)({},De.getState().db.cards[t._parent].boards[t._board]),{},{columnOrder:r})))})))}))}}(e,t)})),t.on("column.CARDS",(function(t){!function(e,t){var r=De.getState().db,n=Object(O.a)({},t.cardId,Object(h.a)(Object(h.a)({},r.cards[t.cardId]),{},{boards:Object(h.a)(Object(h.a)({},r.cards[t.cardId].boards),{},Object(O.a)({},t.boardId,Object(h.a)(Object(h.a)({},r.cards[t.cardId].boards[t.boardId]),{},{columns:t.columns})))}));e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},r),{},{cards:Object(h.a)(Object(h.a)({},r.cards),n)}))}(e,t)}));var r={};t.on("timeline.TYPING",(function(e){r[e.typingUser]&&clearTimeout(r[e.typingUser]),r=Object(h.a)(Object(h.a)({},r),{},Object(O.a)({},e.typingUser,setTimeout((function(){}),3e3)))})),t.on("timeline.COMMENT",function(){var t=Object(Me.a)(Ng().mark((function t(r){var n,a,o,c,l;return Ng().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:"users"===r.db&&r.idRel===De.getState().session._id&&r.comment&&r.comment.user&&r.comment.user._id&&!De.getState().db.users[r.comment.user._id]&&re(r.comment.user._id),("users"===r.db||"users"!==r.db&&De.getState().db.cards[r.idRel]&&"chatGroup"===De.getState().db.cards[r.idRel].type)&&(n=null,r.filesCount&&r.files&&r.files.length===r.filesCount&&(n=parseInt(r.comment.created_at)-30),r.comment.user._id!==De.getState().session._id&&Z(n)),so(e,r),De.getState().chat.notifications&&(r.idRel===De.getState().session._id||De.getState().db.users[r.idRel]||De.getState().db.cards[r.idRel]&&"chatGroup"===De.getState().db.cards[r.idRel].type)&&De.getState().db.users[r.comment.user._id]&&((null===r||void 0===r||null===(a=r.comment)||void 0===a||null===(o=a.user)||void 0===o?void 0:o._id)!==De.getState().session._id&&Pg.play(),r.comment.nodeId=r.nodeId,c=Object(h.a)(Object(h.a)({},r.comment),{},{nodeId:r.comment._parent,idRel:r.nodeId}),r._parent===De.getState().session._id&&((l=new Notification("".concat(r.comment.user.name," ").concat(lt("$__sendedANewMessage",1)),{body:r.comment.message?r.comment.message:lt("$__".concat(r.comment.type),1)})).onclick=function(e){e.preventDefault(),window.focus(),l.close()},ft({message:lt("$__newMessage",1),content:i.a.createElement("div",{style:{display:"flex",cursor:"pointer",backgroundColor:"#none"},onClick:function(e){ie(c.user._id,"users"),e.stopPropagation()}},i.a.createElement(Fc,{storie:c,noReactions:!0,inverted:!0})),hideiconvariant:!0,variant:"info",persist:!1,horizontal:"right",confirm:null})));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),t.on("timeline.DEL",(function(t){var r=De.getState(),n=(r.timeline,r.session),a=De.getState().timeline[t.idRel]&&De.getState().timeline[t.idRel][t.id]?t.idRel:n._id;De.getState().timeline&&De.getState().timeline[a]&&De.getState().timeline[a][t.id]&&e.reduxFunction("ASYNC","SET_TIMELINE",Object(h.a)(Object(h.a)({},De.getState().timeline),{},Object(O.a)({},a,Object(h.a)(Object(h.a)({},De.getState().timeline[a]),{},Object(O.a)({},t.id,Object(h.a)(Object(h.a)({},De.getState().timeline[a][t.id]),{},{deleted:!0},t.deletedReason?{deletedReason:t.deletedReason}:{}))))))})),t.on("user.UPD",(function(t){Xa(e,t)})),t.on("user.CONNECT",(function(t){e.reduxFunction("ASYNC","SET_USERS_STATUS",{users:Object(h.a)(Object(h.a)({},De.getState().usersStatus.users),{},Object(O.a)({},t.user,{status:t.status,updatedAt:t.updatedAt}))})})),t.on("user.DISCONNECT",(function(t){e.reduxFunction("ASYNC","SET_USERS_STATUS",{users:Object(h.a)(Object(h.a)({},De.getState().usersStatus.users),{},Object(O.a)({},t.user,null))})})),t.on("users.STATUS",(function(t){e.reduxFunction("ASYNC","SET_USERS_STATUS",Object(h.a)(Object(h.a)({},De.getState().usersStatus),{},{users:Object(h.a)({},t.users)}))})),t.on("user.ACCESS",(function(t){Xa(e,t)})),t.on("userGroup.UPD",(function(t){Su(e,t,!0)})),t.on("feed.ADD",(function(t){!function(e,t){var r=Object(O.a)({},t._id,Object(h.a)(Object(h.a)(Object(h.a)({},De.getState().db.feeds&&De.getState().db.feeds[t._id]&&De.getState().db.feeds[t._id].feed?{feed:De.getState().db.feeds[t._id].feed}:{}),t.data),{},{_parent:Object(h.a)(Object(h.a)({},De.getState().db.feeds&&De.getState().db.feeds[t._id]&&De.getState().db.feeds[t._id]._parent?De.getState().db.feeds[t._id]._parent:{}),{},Object(O.a)({},t._parent,Object(h.a)({},t.rel)))}));e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{feeds:Object(h.a)(Object(h.a)({},De.getState().db.feeds),r)}))}(e,t)})),t.on("language.UPD",(function(t){!function(e,t){var r=De.getState().languages[t.alias]&&De.getState().languages[t.alias].locales?Array.from(De.getState().languages[t.alias].locales):[];r.flatMap((function(e){if(e.locale===t.locale)return[e.name=t.text]})),0===r.filter((function(e){return e.locale===t.locale})).length&&r.push({_id:t._id,locale:t.locale,name:t.text}),e.reduxFunction("ASYNC","SET_LANGUAGE",Object(h.a)(Object(h.a)({},De.getState().languages),{},Object(O.a)({},t.alias,Object(h.a)(Object(h.a)({},De.getState().languages[t.alias]&&De.getState().languages[t.alias]),{},{locales:r}))))}(e,t)})),t.on("tag.UPD",(function(t){Su(e,t,!0)})),t.on("tag.DEL",(function(t){Lu(e,t,!0)})),t.on("tag.UNLINK",(function(t){Iu(e,t,!0)})),t.on("logout",(function(e){e.user===De.getState().session._id&&ue()})),t.on("notifications.ADD",function(){var t=Object(Me.a)(Ng().mark((function t(r){return Ng().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:De.getState().session._id===r.userId&&r.notify&&e.reduxFunction("ASYNC","SET_NOTIFICATIONS",Object(h.a)(Object(h.a)({},De.getState().notifications),{},Object(O.a)({},r.notify._id,r.notify)));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),t.on("chat.STATUS",(function(t){e.reduxFunction("ASYNC","SET_DB",Object(h.a)(Object(h.a)({},De.getState().db),{},{users:Object(h.a)(Object(h.a)({},De.getState().db.users),{},Object(O.a)({},t.user,Object(h.a)(Object(h.a)({},De.getState().db.users[t.user]),{},{chatStatus:t.status})))}))})),t.on("chat.READED",(function(t){(De.getState().db.cards[t.id]||De.getState().db.users[t.id]||De.getState().db.users[t.readedBy])&&co(e,t)})),t.on("chat.INTERACT",(function(t){lo(e,t),De.getState().db.cards[t.id]||De.getState().db.users[t.id]||De.getState().db.users[t.readedBy]}));var n=setTimeout((function(){}),5e3);t.on("disconnect",(function(){J.current={offline:!0},n=setTimeout((function(){_(!0)}),5e3)})),t.on("connect",(function(){var e;setTimeout((function(){t.emit("data",{module:"user",method:"post",action:"logout"},{notThis:!0})}),2e3),(null===J||void 0===J||null===(e=J.current)||void 0===e?void 0:e.offline)&&(J.current={offline:!1},Z()),ee(!0),clearTimeout(n),_(!1)}))};return j||!H?i.a.createElement("div",{style:{position:"fixed",top:"0px",bottom:"0px",left:"0px",right:"0px"}},i.a.createElement(Jr,null)):(T&&"/offline-detect"!==window.location.pathname&&s.push("offline-detect"),C&&"/maintenance-mode"!==window.location.pathname&&s.push("maintenance-mode"),C||T||"/maintenance-mode"!==window.location.pathname&&"/offline-detect"!==window.location.pathname||s.push("login"),i.a.createElement("div",{style:{position:"fixed",top:"0px",bottom:"0px",left:g&&A?"calc(198px + ".concat(B?"264px":"0px",")"):"0px",right:"0px"},onContextMenu:function(){}},g?i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:U.wrapper},i.a.createElement(Vt.a,{xsDown:!0},A&&i.a.createElement(Rm,Object.assign({routes:$m,handleDrawerToggle:oe,menuExpand:function(){$((function(e){return!e}))},setSubMenuExpanded:function(e){Y(e)},subMenuExpanded:B},r))),i.a.createElement(Vt.a,{smUp:!0},i.a.createElement(Eg,Object.assign({routes:$m,handleDrawerToggle:oe,menuExpand:function(){$((function(e){return!e}))},setSubMenuExpanded:function(e){Y(e)},subMenuExpanded:B,expanded:A},r))),i.a.createElement("div",{className:q,ref:X,id:"mainPannel"},i.a.createElement("div",{className:U.content},i.a.createElement("div",{className:U.container},i.a.createElement(Ae.d,null,H,i.a.createElement(Ae.a,{from:"/",to:"/d#tab/resume"}))))),i.a.createElement(Ut,null,i.a.createElement(jg,null)),i.a.createElement(Ut,null,i.a.createElement(_u,null))),i.a.createElement(Vt.a,{smDown:!0},i.a.createElement(dg,{menuExpand:function(){$((function(e){return!e}))},expanded:A})),i.a.createElement(Ut,null,i.a.createElement(Ur,null)),i.a.createElement(Tc,null),i.a.createElement(Ut,null,i.a.createElement(Yt,null)),i.a.createElement(Ut,null,i.a.createElement(Je.a,{open:x,className:U.backdrop,style:{backdropFilter:"blur(7px) sepia(90%)"}},i.a.createElement("div",{style:{position:"absolute",left:"0px",right:"0px",top:"0px",bottom:"0px",display:"flex",alignItems:"center",justifyContent:"center",color:"#FFFFFF",fontSize:"33px",flexDirection:"column"}},i.a.createElement("div",{style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center"}},i.a.createElement(kt,{color:"ColumnTitleColor",size:"77px"},"cloud_off")),i.a.createElement("div",{style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",marginTop:"15px"}},lt("$__noInternetConnection","*"))))),i.a.createElement("div",null),i.a.createElement(Ut,null,i.a.createElement(xg,{expanded:A,subMenuExpanded:B})),i.a.createElement(Ut,null,i.a.createElement(Og,null)),i.a.createElement(Ut,null,i.a.createElement(zt,null))):i.a.createElement("div",null,!C&&i.a.createElement(Tr,r),i.a.createElement("div",{className:U.wrapper,ref:V},i.a.createElement("div",{className:U.fullPage,style:{backgroundImage:'url("'.concat((null===u||void 0===u?void 0:u.loginBackground)?u.loginBackground:dt("loginBackground"),'")')}},i.a.createElement(Ae.d,null,function e(t){return t.map((function(t,r){return t.views?e(t.views):(n=t.component,!t.auth&&n?i.a.createElement(Ae.b,{path:t.path,component:function(){return i.a.createElement(n,{callback:function(e){le(e)}})},key:r}):void 0);var n}))}($m),i.a.createElement(Ae.a,{from:"*",to:T?"/offline-detect":C?"/maintenance-mode":"/login"})),i.a.createElement(Dr,{white:!0})))),i.a.createElement(Ut,null,i.a.createElement(Ag,{pauseOnFocusLoss:!0}))))})),zg=(r(1683),function(e){var t=e.store,r=e.history;return i.a.createElement($e.a,{store:t},i.a.createElement(Ae.c,{history:r},i.a.createElement(Ae.b,{exact:!0,patch:"/:params",component:$g})))});r(168).config(),-1===window.location.hostname.indexOf("192.168")&&-1===window.location.hostname.indexOf("localhost")&&-1===window.location.hostname.indexOf("hom2022.machen")&&-1===window.location.hostname.indexOf("a1b2c3d4.machen")&&-1===window.location.hostname.indexOf("sonne.machen")&&(console.log=function(){}),Object(c.render)(i.a.createElement(zg,{store:De,history:s}),document.getElementById("root"))},278:function(e,t,r){var n=r(51);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(0)),o=(0,n(r(100)).default)(a.default.createElement(a.default.Fragment,null,a.default.createElement("path",{fill:"none",d:"M20.45,5.43,19,4l-1.79,1.8,1.41,1.41ZM13,1.52H11v3h2Zm7,12h3v-2H20ZM9,17.67v4.81h6V17.67a6,6,0,1,0-6,0ZM4,13.48v-2H1v2ZM6.76,5.82,5,4,3.56,5.43l1.8,1.79Z"}),a.default.createElement("path",{d:"M20.45,5.43,19,4l-1.79,1.8,1.41,1.41ZM13,1.52H11v3h2Zm7,12h3v-2H20ZM9,17.67v4.81h6V17.67a6,6,0,1,0-6,0ZM4,13.48v-2H1v2ZM6.76,5.82,5,4,3.56,5.43l1.8,1.79Z"})),"Ideas");t.default=o},328:function(e,t,r){e.exports=r.p+"static/media/logoMachen.c1ab9af8.svg"},330:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAABN2lDQ1BBZG9iZSBSR0IgKDE5OTgpAAAokZWPv0rDUBSHvxtFxaFWCOLgcCdRUGzVwYxJW4ogWKtDkq1JQ5ViEm6uf/oQjm4dXNx9AidHwUHxCXwDxamDQ4QMBYvf9J3fORzOAaNi152GUYbzWKt205Gu58vZF2aYAoBOmKV2q3UAECdxxBjf7wiA10277jTG+38yH6ZKAyNguxtlIYgK0L/SqQYxBMygn2oQD4CpTto1EE9AqZf7G1AKcv8ASsr1fBBfgNlzPR+MOcAMcl8BTB1da4Bakg7UWe9Uy6plWdLuJkEkjweZjs4zuR+HiUoT1dFRF8jvA2AxH2w3HblWtay99X/+PRHX82Vun0cIQCw9F1lBeKEuf1UYO5PrYsdwGQ7vYXpUZLs3cLcBC7dFtlqF8hY8Dn8AwMZP/fNTP8gAAAAJcEhZcwAACxMAAAsTAQCanBgAAATuaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA2LjAtYzAwMiAxMTYuMTY0NzY2LCAyMDIxLzAyLzE5LTIzOjEwOjA3ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjEuMiAoV2luZG93cykiIHhtcDpDcmVhdGVEYXRlPSIyMDIxLTA4LTE2VDEwOjAwOjU2LTAzOjAwIiB4bXA6TW9kaWZ5RGF0ZT0iMjAyMS0wOC0xNlQxMDowMjoyNC0wMzowMCIgeG1wOk1ldGFkYXRhRGF0ZT0iMjAyMS0wOC0xNlQxMDowMjoyNC0wMzowMCIgZGM6Zm9ybWF0PSJpbWFnZS9wbmciIHBob3Rvc2hvcDpDb2xvck1vZGU9IjMiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NGNkYzhjZTMtOTEyYS1lODQwLWJjYjQtOWVkMTMxMGFiYjU4IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjRjZGM4Y2UzLTkxMmEtZTg0MC1iY2I0LTllZDEzMTBhYmI1OCIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjRjZGM4Y2UzLTkxMmEtZTg0MC1iY2I0LTllZDEzMTBhYmI1OCI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6NGNkYzhjZTMtOTEyYS1lODQwLWJjYjQtOWVkMTMxMGFiYjU4IiBzdEV2dDp3aGVuPSIyMDIxLTA4LTE2VDEwOjAwOjU2LTAzOjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjEuMiAoV2luZG93cykiLz4gPC9yZGY6U2VxPiA8L3htcE1NOkhpc3Rvcnk+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+rzal5gAAFXlJREFUeJztnXlsZMd95z9V9a6+SDY5Q3JIzn1oNIpjO97YcrwxAluyN16ttcF617tAEGSxyALZwEBOLBIgCRDAuf5IYCAIknWAIItgs96VkhiyFcmSV5JzOFnJSizbkuYezXA4nINXs493VVX+eM1ucsjh2d1DyfwC/IPdXfWq6vvqd796wlrLZnHrrWmAI8CfA+8FaoDZdAe7FEKIotb6TlSP/72U8qWtrMkKWLG6bwkHHzy06S6cLV4yAL5ARgZAYYvtdyeEQCD3R434Rc93P+a4znPG3J/7TG7x9/8JeH83BnLfISxYS1gLv6K1/piUW12azmCrVz3WlVHsEgghAEFUi5/VWv/Q/SBlq1e8P7dNDyEkWGsIa+ELWutP9JqUrV7tba/AN4QFIQVYCGvhl1OdfLyXpLzj7/jtYomUqBo/k6bJJ3tFyh4h60BIAQKievxFrfWHe0HKHiEbIFP0ENWjl7TWj3ablD1CNgEhBNb0xiTeI2STWKbon9Wp7ppO2SNkC2iRUg+/qLV+rBuk7BGyRSzbKU91w0/ZI2QbWO6naK076qfsEbJNLCPlGa31I50iZY+QHWAZKc9prT8u1c6Xc4+QHULIzE8Ja+EzOt25SbxHSAew5DyG9cazWuuP7ISUPUI6BCGasa96+FWt9Q9LKWEbicc9QjoIIQXWWsJ642mt9ceEWp3S3QhbTeG+o6FTjdEWscPb1BpLvVJ/1st7j7ie89WttN0jBMBahBDkB3JYY1s6YUddGosQ8nnXcx8DvrzZdnuEAEtVJoVSsdMdY6z9EO9EQpRSHelHa33v79K0I9e4C1ti+W1DSJIkHennPhQubMnW2vWESCkxxnDpyjRRGOM429spaaoJAo/jx8Zafe5G7HpCltRrmqYkSYK121vINNUoR67oczeio4RYa1FK4XkuG5VjCiGI4wSt9bpWzVIvjlQopXAchzTVJEmyoTVkrcV1XRxHYW3Wx/I+12vnOArX7dw8NouOEqKUIo4S5mYrG8pqYyzFYg7Xc7YkPtJUE+R89g0NoDdop6SkWm8QNqJN9w/gKEUYxszObGYehkIhh++7G45nU9fecQ/L4LkO83NVzl68hue59xQN1lqSVHPm1BEKhYAwijd9jThJGB4uc+L4OGG4frtc4HPh4nUqlSqus/mpep7D7TsLnL90jcD31v1tFCc8cOIQxVIOvcF4NoPOiiwsUgo8z8Nzs66tWbblRbNgwIIQaevuW2+rCyFWfC+EwGhDHMUk8fqWlxICY8yq9nf3ucZVm6LXw3XdbB7WtmWdaI/Z2qblts2C+bvRFaUuaCtOi2VJDAvaExGAlAKpBFLee3Gy78SqSn/LJnTBXb+xIutPyeUjXPuaUmT116152LYDefc8lq7VCXTNyrLWYozl4PgwhYKPEJLKYp3JqVsoKXEcxeSN29y8NYtZR3EKkS2GTjVKSdJ1HLv1oJREp5qLl6Zafd4LUgriOMX1nPY8xoYpFnNYDLVaxLWpW8gOKPG70UVCMlIKhRzlchGEQGuDMRYls21erzXQ2mzKOnFdt5UM2g6EFBhjWViobmLsmbXoupnBYaylUMwxUM6cbiFqWGOxOxjPvdADP8S2RJi4S0ysKXYsuG5m4q4yOXciF2y22zzPbX0khEBrTZykK26KtS9jWfGLLjkzXSNEiOyuXFxsYIxFIKhUay19oY2hr1jAdRXG2OyudBS+57JQqdEII1SXwxxpqsnlfEaGh4iiuLlbs90bxQmNRpT9LwSVxTqmaaDU6iFSCLogsbpJSKY8J6dutfwMqTLdYU3meY8d2MfgUB9hGBH4LtYKpqdn0WllRV9JkqKUQu2kiEBkvo9ONa7bnnaqNfmcz5HDI1gLURyTy/ncmJptmb3KEVyfut2eR1MHdgPdFVk2U6YrFnKZxaW1IUlSPNelVo+4dPkGs3MVfM/FcTMnUxtDeaBEkmriaPsBRmMsvusiA5+FhSpKSXzPJYlT3jz/FjfvzHHsyBi5IPtMLzeX15pHl9BRQoTIFGcYxRhr13cMkzTzcnM+t24tcO7CVcIoppAP0FpTrTXoKxU4eGCYUl+Ocxcm0UY3Fa7MHLYNdErgeygpsdZmoY3A58TxcaqLDSZv3KZSqZELPPK5gNnZCvV6yKnjE4yMDKK13pTDGkUJxhg6pd87SkiSpOTzASePTawbcrBkDuPAQJHpm3O8cfYKFsgXAqIwRkjJ4YOjjI6UyecCavWQVGsEAs91qVTrXLh4Ha03CJ0oSaVax2vGpJZyISMjZUqlHNM357gxfYdUmyxiEMa8fvYKCNi/rx/b3BnrQRtDIZ8jTjqTS+koIWmq8XyH8dK+DYNyhVzA1PQM337jMq6r8F2Xej0in/c5cXSC/r48UZxQqzUw1iKb+81xFI16xMJCdVPBRa8ZXEySFEnmuddqDaSSHDk8wkB/kQuXJqnXQ/K5gDhO+NZ3LvG9Z05w6sQ41Xq4rkG1FFxM010YXBTNUEUjvHcwz1pLPhcwfXuWN869hes6eK5DrR5SLpc4eXwc13WoNUIgCxBiLanWpGnbKdxsbGpJPKapbjmVQojs/1TT15fnzINHuHDxOguVKvlcADG8fvYyiCOUSnnqjXDDxe4EGdDjfIi1Ft/3CKOY8xcmAVpkDJb7OH3qIEDT3GzGippt/WaQz9lmKjfVutXH8r1bb4QEvseDpw9z9tw1ZucqFPIBjSjm3IVrfM+Zo/i+RxTFHVv09dBTQpRSCODS5Rs0wphCIaBRDykPlHjg1EGMtcTxyjzHkql59Mhox8axPNwvhCCMYjzP5YFTB3nz7FXmF6rk8z71WsjFyzd44NRBlFI9yTL2LMFsrSUXeExPzzIzu0AhnynwXD7g1IkJBKwiYzmUlB35WwtLekAAp05OkM/5RGFMPh8wM7vA9PQsge9tqBc7gZ4R4nkui9U6U9MzWTJHayxw/OgYrusQbiAStDEd+bsXlnaK6zgcPTyKbV7T91ymb85Qb0Qrwi7dQs8IcR2HG9OzNMII13GI4oSD48P09xVohFFP5PNGEELQCCMGB/sYG91HoxHheg6NMGb65sy29ddW0BNCPNdhfr7K7GyFXM4njhP6igVGRwaJ4q7UQu0IUZxw4MAg/aUCcZQQ+B63b8+zuFhvJd66hZ4Q4jiKmdkKcZKgpCRJNSPDZVzXIe1OcdqOkCQpge8xMjJE0szDxEnK7Nxi12JYS+g6IUopqrUGC5UqvucRxwn9/UUGyqUN9cb9Qia6YsrlIgP9ReI4wfccZmYXqNYaHauiXAtdJ8RzFbVaRL0RoZxsd+wr9xE0FftuhdaawHMZLPdlu8RRhFFMrRbhuW9jQqyFarWBEGC0xfddisX8qqTQboMQgjhJKRXz+L6L0ZnJu1itr5v+3Sm6SohSkkYjZqFZhpMkCeX+EoViQNKhYFw3kaQphWLAQH+JJElwHYdKpUa9EXYtFN9lQrKCszhOkEpiLeTzQVeKA7oFKQT5XIBplvvEcUIUpl3TI10lRApBmqZZVYnNMoaeu7VKxfsNYwy+56DUUh2WJU11126qruuQOEmx1mKtwXVUx0ouewVtDH7gNnMqWQVK3KFHI9ZCVwmx1hI1qwuNsbie26zl7X5MqFMwxjRTBC66Oe4oSroW1+oaIUKAaW5vIQSmWVG+lFJ9u8DaLLCZ6cDs+cNU66ySpgtiq4s7JDv0a6m0hmaO/W2kz9fEUnLLbPM5lY3QNUKWihEcR9FoxNTDCNd11i6A29XI5iGloNGIsuCo62SBxi7Mo6uRMm0MY6NDLQJGhsvbrs29X7A2m8f4gf1Z5aWAsdEhtDEdK7Bejq4SkiQpvu9y8sQ4INCpJtnlHvpaSJKUINechwCdmq7No6uELCnAJTN3SSm+3bCkN7To/jx6klN/e+mMe+MdlcLdw+awR8guwx4huwx7hOwybEmpF0alUb7o3BOO3wWwW3RXtkTI1Wesnyzu/ICv7xZYC8pHPfSpzbfZEiGvflYXZ79pkd7bPybVdVgwBnIjwusaIX5Z2GAYhEvHHlB5p8JasAZyQ6J7IktIrFQg1N4O2QjCNl9ruMVM75422GXYI2SX4b4cYCYVJA1oTGviyGDInspVCJy8IDcscQMBUpBUDNUbGtFMPxTHFE5eYNeoIpKuIJzV1G9pEOAWJKUxhTaZCLl7DGkI9ZuauNG2TZUQ+GVJfl92r/Y6DNdzQpQnmL+UIgQc/tcB+9/tURxVxDVD5ZJm5s2E2mSKTiBpGMonHQ5/PEdUMWDhzmsxOgR518itgHjekN+vOPxoDmNANyy3X4szv0m2fyeVYO5cgvIFBz8aMHTGpXRIoWPL/HnN9D9EXH81orRPkR9WmKR3rPSUEOkKZs8l9B9x+DdP7Gff9679vMXLv13hb39pHicQ+P2SR/9osPXdcz8xy3f+uEr/sZVDl8DsVMrDvzbEu/5LdibJ5acbPPXvGhTHmifJicwYuf1GzKEPBXz0DwfZ99DaY3j9f9b4x99bpDapcYu9s2B6qkPCGU1p3OFHnh5eQUZtWlO53JZBV58PcYuC/Iji6vMh1/+m/RDpwEmHRNtVI49rlvIRlyMfz7U+m/q7iCQ0iKaloxTMnU059XieT//NSIsMa2DubMLiZDubeebHCjzwH/PUb+qeRiZ6ukOqNzUf+Vw/Ayeyyy5cTHnx5+a4/Y2YNIHxD3l4fZKb34gpHlAYC4264frXQsb/pQ/A2Ad9cgWJTWgtNEA0ZzjwQZ/SRPZhGloufykkP5T9LwRUJzUj3+/x2Bf2tdqdf7LOK79VYe5iiuMLJn7I59E/GuKtZxu88psVSgdVT0/N7BkhJrUE/ZKR728fmff0j97hzb9vMH7AQ3lw5a9CjLb0HXWwBrAQBILpV9onKox90Gfoe1zmzqfkhprbREJYN4z+i3bft16JmT2bUBxviisLcdXy/v/eh/KzFb74lw2e+NQtfCHpO6SwCbz+ZzVuvhITVwxCgrqHAdEt9O6hzwT8kiS/P1ugylTKzMWEg2MeblHgBILihKLvsAOmbd0UDjhcez7k5ssZKcKBvqMO8UK7DMfElnxJcuzxtri6+kJIEpqWY9aYyQg79lj7N3/9i/PkHcngaQflCZyCYP9pl2jBID1BUJY9JQN6SIj0BOGcoTqVyem+MYfh0x5TUzFW33sk0oP6ouH637X1yIEP+Cv0SLRgGTjtMvr+TKzZFC78RZ1cWbXM3WjWMPZhv7U7Lj3VYO5sku3GZYtuNPj9EicQmPtQINMzQoSCpGa59kLY+uyxJ/bxnh8pMnMpYf5citWZf7ACBlwluP1PbbF17BMBfWMOad0iRKY/yiecVtvpVyLmzqYE5ZXT6z/altDX/zYitauNg/uNng6ndETx8q8vcPEvGgDkhxWf/PP9fPq5EQ59NGDuUsLCWxrprtSihTHFlWcazF/IbuWBUy6DJx2ihcypNNZy9F+1RdHkixFx3azUkAL8vvZ067c0jhRgMnM8DS23zyfcOZ8w0/y7eT6memP1eLqJnlpZbiDwBiRPffo2P/gbZd73cyUADj0ScOiRgMmvRTz3X2eYfT1h8IzbcsicvODO2ZRrL4QMnMh8jPIpl6svhfhFSfm4y6FHAyDTPeefrBP0y7Z3bgEBKrdsYXXbSgtnNP0nXR7+5X50YjMRaiE3KLnxDzFn/08tI7MHvPSUEKMhGJJIV/CVn5/h4l/W+cCv9nP4kWwxJz7s86PfOMCTj97izmsxhQlFtgXAQXD7m22xdejRgNc+v0g4bzhwxqdwIFvdmy/HzL6RkB9ZJvuaC7nc47aSln8RzRlKE4p3/cTqN0vkhhWvfX4RryR7EuHu/bsbUvAKgtHTHtOvxPzvR6d54pFb3PlW9tiCWxB89PfLSF9gwvYC5kcVV54JM0cNOPSRgMEHPSp1zfiH/NbvJl8KiWpm9a1mIK60+wv6JDq1WJHdJJUrKS//ZoUXf3qON/9Xrd0stT11DO+LSrMW0NB3SDF80uPSVxv86ftuMPtGRsr+93gc/VhAdbpt5vh9gtmLCVe/mhkFwZCkNKGwWA59pE3IuSfr+H1yVTDRYLOgYxNDD7loMofRLyuq1zUv/uIcX/rcDN/50xr3C/fVxljyNUbOeNQSw9d/rX34ZfmMSxq1V3UpIry0kwAGH3BxkZRPZyGQW/8YM/d60nYYl8HLS6b/f9t0PvqJHP2jinjBoFOLEwj2nXSZUB59Y90/QuNe6Ckh0hXUbmjmL6Yk9eax3c3HpTUWv9QW0rrRPkUOsvB5blDx1lca6DhrO/x9Lsc+HJAfzhZw8msRjUWDWMMqKowqJl+IuPH3GSnFCcXRT+S4OZ0gaWdArQW98zP1t42eKXUrMmvm+ON5nJzgyrMN5s6npBg0MHHM5/2/1AdAUre89VxIsG/l/RIMSGbOptx6NebAwz7jPxisiPqe/791guJqcQVZHUAaWV77gyoHHs5E3CN/MEhtSvPtZ+oUkSBh2iScXvYsjnTEOzOWZSOLTuB9P1ti+Ps8alOaq8+HzF9JKYwoTv2HfMuR+84fV5l+JWLwlLsiQZQ5l4apr2eEDBx3WoTc+WbCnW/Hq0hswUD/EYdv/kmV0Q94vPsnS0hX8G+fHubI7y1y7f+FODnBD5xxeeg/t62txcmUTNl0a2VWoneEaHByoh2jGlM8+GOFVb/71uer/PUvzNM3sfbQgpLkwpN13vczpeZrI7LPr30tJFqw5IfXWTkF5YMOL3xmjsYdw8O/3I8Q8N7PlHjvZ0qrxvuN36nw8m9XKIypnhV19IwQJy+Ia5YvPn6bh368wNgP+HglifLBJBDOGV7/kyqvP1FnYNzBKa0dZc3tV8yeTTj7Z3VGP+ATLRiUC+e+UMfvy15rcc/CG5OZ3GJC8dKvzHH5qQbv/qkS/cccvD6BNZlPMn8h5bU/rHL11ZChcRen0LuIb+92iAWvTxJXDF//7AJKCty8yHLlOguNO75g3yk3e53EPRZAuOAPSJ7/bzNY0zQKEkswoChOOBumW40GxxeMnPaZOZfw5R+/g5+TOH72HlsdQhQZCgOKA6f97Fz6HkZ8t0SIjjLDZ7u716YWNy8YOuliTZapW6pfyo82xc9Gb2ppkhCUZRambw5GuWLTue/MD7IUhhWF/dlZ9NkLAyRCQql5bIbV9z6de0M0Xwlh0611sbVCOQeZVMEfInMMdgAhadUIb2fS0umQUBeZsaC28WbndbsVoBNIo61Nb0t+yLt+Sv6T8qB+Y6stv8sgIV6EcAaOf0pMb6XplnbIkcfl/6hdx3n1s/pzNsEIyRb5/+6ATXAxBA/9pPzd9/yC+tWttP1naNHfLnAaa+QAAAAASUVORK5CYII="},506:function(e){e.exports=JSON.parse('{"name":"machen","version":"3.1.88","private":true,"dependencies":{"@date-io/date-fns":"1.3.13","@emotion/react":"^11.9.0","@emotion/styled":"^11.8.1","@fortawesome/react-fontawesome":"^0.1.14","@material-ui/core":"^4.11.0","@material-ui/icons":"^4.5.1","@material-ui/lab":"^4.0.0-alpha.56","@material-ui/pickers":"^3.2.10","@mui/material":"^5.8.1","@nivo/bar":"^0.70.1","@nivo/bullet":"^0.79.1","@nivo/circle-packing":"^0.70.1","@nivo/core":"^0.70.1","@nivo/pie":"^0.70.1","@nivo/sankey":"^0.70.1","@reactour/mask":"^1.0.4","@reactour/popover":"^1.0.5","@reactour/tour":"^2.13.0","@reactour/utils":"^0.4.7","axios":"^0.21.1","base-64":"^1.0.0","bcryptjs":"^2.4.3","browser-image-compression":"^1.0.14","chartist":"^0.10.1","chartist-plugin-tooltip":"0.0.11","chartist-plugin-tooltips":"0.0.17","chartist-plugin-tooltips-updated":"^0.1.3","compress":"^0.99.0","cpf-cnpj-validator":"^1.0.3","crypto-js":"^4.0.0","date-fns":"^2.16.1","dotenv":"^6.2.0","draft-js":"^0.11.7","draftjs-to-html":"^0.9.1","emoji-picker-react":"^3.4.7","fg-loadcss":"^3.1.0","file-saver":"^1.3.3","history":"4.9.0","html-to-draftjs":"^1.5.0","import":"0.0.6","install":"^0.13.0","jquery":"^3.5.1","jwt-decode":"^3.1.2","material-table":"^1.69.0","memoize-one":"^6.0.0","moment":"2.24.0","moment-timezone":"^0.5.31","node-sass":"^4.13.1","nouislider":"14.0.2","npm":"^7.6.0","pdf-lib":"^1.16.0","perfect-scrollbar":"1.4.0","react":"^18.2.0","react-aspect-ratio":"^1.1.2","react-audio-player":"^0.17.0","react-beautiful-dnd":"^13.1.1","react-big-calendar":"^1.5.0","react-bootstrap-sweetalert":"4.4.1","react-chartist":"0.13.3","react-color":"^2.19.3","react-contextmenu":"^2.14.0","react-cookie":"^4.1.1","react-credit-cards":"^0.8.3","react-cropper":"^1.3.0","react-custom-scroll":"^4.2.1","react-data-export":"^0.6.0","react-datepicker":"^4.8.0","react-datetime":"2.16.3","react-doc-viewer":"^0.1.5","react-dom":"^16.9.0","react-draft-wysiwyg":"^1.15.0","react-easy-swipe":"0.0.18","react-export-excel":"^0.5.3","react-fetch-preloader":"0.0.3","react-file-drop":"^3.0.7","react-file-viewer":"^1.2.1","react-google-login":"^5.2.2","react-image-file-resizer":"^0.4.7","react-jvectormap":"0.0.12","react-keyed-file-browser":"^1.10.0","react-loading-skeleton":"^3.0.1","react-mentions":"^4.1.1","react-nestable":"^2.0.0","react-number-format":"^4.4.1","react-popper":"^2.2.4","react-render-html":"^0.6.0","react-responsive-carousel":"^3.2.23","react-router-dom":"5.0.1","react-router-redux":"^4.0.8","react-scripts":"^3.4.3","react-select":"^3.1.0","react-sound":"^1.2.0","react-swipeable-views":"0.13.3","react-table":"6.10.0","react-tagsinput":"3.19.0","react-textarea-autosize":"^8.4.0","react-toastify":"9.0.0","react-virtualized":"^9.22.3","react-virtuoso":"^3.1.5","react-window-infinite-loader":"^1.0.8","reactjs-pdf-reader":"^1.0.12","reactour":"^1.18.7","redux-saga":"^1.1.3","socket.io-client":"^4.4.1","styled-components":"^5.2.0","utf-8-validate":"^5.0.9","utf8":"^3.0.0","uuid":"^8.3.2"},"scripts":{"start":"react-scripts start","build":"react-scripts build && gulp licenses","test":"react-scripts test --env=jsdom","eject":"react-scripts eject","deploy":"npm run build","lint:check":"eslint . --ext=js,jsx; exit 0","lint:fix":"eslint . --ext=js,jsx --fix; exit 0","install:clean":"rm -rf node_modules/ && rm -rf package-lock.json && npm install && npm start","compile-sass":"node-sass src/assets/scss/material-dashboard-pro-react.scss src/assets/css/material-dashboard-pro-react.css","minify-sass":"node-sass src/assets/scss/material-dashboard-pro-react.scss src/assets/css/material-dashboard-pro-react.min.css --output-style compressed","map-sass":"node-sass src/assets/scss/material-dashboard-pro-react.scss src/assets/css/material-dashboard-pro-react.css --source-map true"},"optionalDependencies":{"@types/googlemaps":"3.37.3","@types/markerclustererplus":"2.1.33","ajv":"6.10.2","typescript":"3.5.3"},"devDependencies":{"envify":"^4.1.0","eslint-config-prettier":"6.0.0","eslint-plugin-prettier":"3.1.0","gulp":"^4.0.2","gulp-append-prepend":"1.0.8","prettier":"1.18.2","terser":"^5.14.1","terser-brunch":"^4.1.0","uglifyify":"^5.0.2"},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":[]}}')},525:function(e,t,r){var n=r(277),a={data:{},options:{lineSmooth:n.Interpolation.cardinal({tension:0}),low:0,high:100,chartPadding:{top:0,right:0,bottom:0,left:0}}},o={data:{labels:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],series:[[542,443,320,780,553,453,326,434,568,610,756,895],[150,133,440,199,799,100,499,657,50,352,117,400],[900,700,800,600,100,200,700,400,410,333,355,499]]},options:{axisX:{showGrid:!1},low:0,high:1e3,chartPadding:{top:0,right:5,bottom:0,left:0}},responsiveOptions:[["screen and (max-width: 640px)",{seriesBarDistance:5,axisX:{labelInterpolationFnc:function(e){return e[0]}}}]],animation:{draw:function(e){"bar"===e.type&&e.element.animate({opacity:{begin:80*(e.index+1),dur:500,from:0,to:1,easing:"ease"}})}}},i={data:{labels:["12am","3pm","6pm","9pm","12pm","3am","6am","9am"],series:[[230,750,450,300,280,240,200,190]]},options:{lineSmooth:n.Interpolation.cardinal({tension:0}),low:0,high:1e3,chartPadding:{top:0,right:0,bottom:0,left:0}},animation:{draw:function(e){"line"===e.type||"area"===e.type?e.element.animate({d:{begin:600,dur:700,from:e.path.clone().scale(1,0).translate(0,e.chartRect.height()).stringify(),to:e.path.clone().stringify(),easing:n.Svg.Easing.easeOutQuint}}):"point"===e.type&&e.element.animate({opacity:{begin:80*(e.index+1),dur:500,from:0,to:1,easing:"ease"}})}}},c={data:{labels:["M","T","W","T","F","S","S"],series:[[12,17,7,17,23,18,38]]},options:{lineSmooth:n.Interpolation.cardinal({tension:10}),axisX:{showGrid:!1},low:0,high:50,chartPadding:{top:0,right:0,bottom:0,left:0},showPoint:!1},animation:{draw:function(e){"line"===e.type||"area"===e.type?e.element.animate({d:{begin:600,dur:700,from:e.path.clone().scale(1,0).translate(0,e.chartRect.height()).stringify(),to:e.path.clone().stringify(),easing:n.Svg.Easing.easeOutQuint}}):"point"===e.type&&e.element.animate({opacity:{begin:80*(e.index+1),dur:500,from:0,to:1,easing:"ease"}})}}},l={data:{labels:["'07","'08","'09","'10","'11","'12","'13","'14","'15"],series:[[10,16,8,13,20,15,20,34,30]]},options:{lineSmooth:n.Interpolation.cardinal({tension:0}),low:0,high:50,chartPadding:{top:0,right:0,bottom:0,left:0},classNames:{point:"ct-point ct-white",line:"ct-line ct-white"}},animation:{draw:function(e){"line"===e.type||"area"===e.type?e.element.animate({d:{begin:600,dur:700,from:e.path.clone().scale(1,0).translate(0,e.chartRect.height()).stringify(),to:e.path.clone().stringify(),easing:n.Svg.Easing.easeOutQuint}}):"point"===e.type&&e.element.animate({opacity:{begin:80*(e.index+1),dur:500,from:0,to:1,easing:"ease"}})}}},s={data:{labels:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],series:[[542,443,320,780,553,453,326,434,568,610,756,895]]},options:{seriesBarDistance:10,axisX:{showGrid:!1}},responsiveOptions:[["screen and (max-width: 640px)",{seriesBarDistance:5,axisX:{labelInterpolationFnc:function(e){return e[0]}}}]],animation:{draw:function(e){"bar"===e.type&&e.element.animate({opacity:{begin:80*(e.index+1),dur:500,from:0,to:1,easing:"ease"}})}}},u={data:{labels:["'06","'07","'08","'09","'10","'11","'12","'13","'14","'15"],series:[[287,480,290,554,690,690,500,752,650,900,944]]},options:{lineSmooth:n.Interpolation.cardinal({tension:10}),axisY:{showGrid:!0,offset:40},axisX:{showGrid:!1},low:0,high:1e3,showPoint:!0,height:"300px"},animation:{draw:function(e){"line"===e.type||"area"===e.type?e.element.animate({d:{begin:600,dur:700,from:e.path.clone().scale(1,0).translate(0,e.chartRect.height()).stringify(),to:e.path.clone().stringify(),easing:n.Svg.Easing.easeOutQuint}}):"point"===e.type&&e.element.animate({opacity:{begin:80*(e.index+1),dur:500,from:0,to:1,easing:"ease"}})}}},d={data:{labels:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],series:[[542,443,320,780,553,453,326,434,568,610,756,895],[412,243,280,580,453,353,300,364,368,410,636,695]]},options:{seriesBarDistance:10,axisX:{showGrid:!1},height:"300px"},responsiveOptions:[["screen and (max-width: 640px)",{seriesBarDistance:5,axisX:{labelInterpolationFnc:function(e){return e[0]}}}]],animation:{draw:function(e){"bar"===e.type&&e.element.animate({opacity:{begin:80*(e.index+1),dur:500,from:0,to:1,easing:"ease"}})}}},p={data:{labels:["'06","'07","'08","'09","'10","'11","'12","'13","'14","'15"],series:[[287,385,490,554,586,698,695,752,788,846,944],[67,152,143,287,335,435,437,539,542,544,647],[23,113,67,190,239,307,308,439,410,410,509]]},options:{lineSmooth:n.Interpolation.cardinal({tension:10}),axisY:{showGrid:!0,offset:40},axisX:{showGrid:!1},low:0,high:1e3,showPoint:!0,height:"300px"},animation:{draw:function(e){"line"===e.type||"area"===e.type?e.element.animate({d:{begin:600,dur:700,from:e.path.clone().scale(1,0).translate(0,e.chartRect.height()).stringify(),to:e.path.clone().stringify(),easing:n.Svg.Easing.easeOutQuint}}):"point"===e.type&&e.element.animate({opacity:{begin:80*(e.index+1),dur:500,from:0,to:1,easing:"ease"}})}}};e.exports={model:a,emailsSubscriptionChart:o,completedTasksChart:i,roundedLineChart:c,straightLinesChart:l,simpleBarChart:s,colouredLineChart:u,multipleBarsChart:d,colouredLinesChart:p,pieChart:{data:{labels:["62%","32%","6%"],series:[62,32,6]},options:{height:"230px"}}}},552:function(e,t,r){e.exports=r.p+"static/media/strategy-pt.625a0c5b.png"},574:function(e,t,r){e.exports=r.p+"static/media/userCover.49044f68.jpg"},617:function(e,t,r){},685:function(e,t,r){e.exports=r.p+"static/media/fundoLogin.a16e608c.jpg"},700:function(e,t,r){var n=r(51);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(0)),o=(0,n(r(100)).default)(a.default.createElement(a.default.Fragment,null,a.default.createElement("path",{fill:"none",d:"M.2,11.6H0V17H.2c0,.1,0,.1.1.1H1L18,.4H16.4L1.1,15.7V12.2L12.9.4H11.3L.2,11.6Z"}),a.default.createElement("path",{d:"M.2,11.6H0V17H.2c0,.1,0,.1.1.1H1L18,.4H16.4L1.1,15.7V12.2L12.9.4H11.3L.2,11.6Z"}),a.default.createElement("path",{d:"M0,1V7.1H0c.1,0,.1,0,.1.1H.4a.1.1,0,0,0,.1.1H1L7.1,1.4h0l1-1H.6A.6.6,0,0,0,0,1Z"})),"GuidelineC");t.default=o},701:function(e,t,r){var n=r(51);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(0)),o=(0,n(r(100)).default)(a.default.createElement(a.default.Fragment,null,a.default.createElement("path",{fill:"none",d:"M17.8,6.4H18V1H17L0,17.6H1.6L16.9,2.3V5.8L5.1,17.6H6.7L17.8,6.4Z"}),a.default.createElement("path",{d:"M17.8,6.4H18V1H17L0,17.6H1.6L16.9,2.3V5.8L5.1,17.6H6.7L17.8,6.4Z"}),a.default.createElement("path",{d:"M18,17V10.9H17l-6.1,6.1h0l-1,1h7.5A.6.6,0,0,0,18,17Z"})),"GuidelineD");t.default=o},702:function(e,t,r){var n=r(51);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(0)),o=(0,n(r(100)).default)(a.default.createElement(a.default.Fragment,null,a.default.createElement("path",{fill:"none",d:"M6.4.2H.6l17,17V16.4L2.3,1.1H5.8L17.6,12.9V11.3L6.4.2Z"}),a.default.createElement("path",{d:"M6.4.2H.6l17,17V16.4L2.3,1.1H5.8L17.6,12.9V11.3L6.4.2Z"}),a.default.createElement("path",{d:"M17,0H10.5l6.1,6.1h0l1,1V.6A.6.6,0,0,0,17,0Z"})),"GuidelineE");t.default=o},703:function(e,t,r){var n=r(51);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(0)),o=(0,n(r(100)).default)(a.default.createElement(a.default.Fragment,null,a.default.createElement("path",{fill:"none",d:"M11.6,17.8h5.8c.1,0,.1,0,.1-.1h-.1L.4,0V1.6L15.7,16.9H12.2L.4,5.1V6.7L11.6,17.8Z"}),a.default.createElement("path",{d:"M11.6,17.8h5.8c.1,0,.1,0,.1-.1h-.1L.4,0V1.6L15.7,16.9H12.2L.4,5.1V6.7L11.6,17.8Z"}),a.default.createElement("path",{d:"M1,18H7.3c0-.1,0-.1.1-.1h.1a.1.1,0,0,0,.1-.1h0a.1.1,0,0,0,.1-.1H7.6a.1.1,0,0,1-.1-.1h0L1.4,10.9h0l-1-1v7.5A.6.6,0,0,0,1,18Z"})),"GuidelineR");t.default=o},704:function(e,t,r){e.exports=r.p+"static/media/machen.b9c661d3.svg"},801:function(e,t,r){},83:function(e,t,r){e.exports=r.p+"static/media/fundo-sonne.6de93583.png"},965:function(e,t,r){e.exports=r.p+"static/media/microsoftWord.113ac212.svg"},966:function(e,t,r){e.exports=r.p+"static/media/microsoftExcel.c59164de.svg"},967:function(e,t,r){e.exports=r.p+"static/media/microsoftPowerpoint.0e97c564.svg"},968:function(e,t,r){var n=r(51);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(0)),o=(0,n(r(100)).default)(a.default.createElement(a.default.Fragment,null,a.default.createElement("path",{fill:"none",d:"M0 5.22H6.6V6.32H0z"}),a.default.createElement("path",{d:"M8.8 5.22H15.4V6.32H8.8z"}),a.default.createElement("path",{d:"M17.6 5.22H24.200000000000003V6.32H17.6z"}),a.default.createElement("path",{d:"M26.4 5.22H33V6.32H26.4z"}),a.default.createElement("path",{d:"M0 0H6.6V3.03H0z"}),a.default.createElement("path",{d:"M8.8 0H15.4V3.03H8.8z"}),a.default.createElement("path",{d:"M17.6 0H24.200000000000003V3.03H17.6z"}),a.default.createElement("path",{d:"M26.4 0H33V3.03H26.4z"}),a.default.createElement("path",{d:"M0 7.58H6.6V8.68H0z"}),a.default.createElement("path",{d:"M8.8 7.58H15.4V8.68H8.8z"}),a.default.createElement("path",{d:"M17.6 7.58H24.200000000000003V8.68H17.6z"}),a.default.createElement("path",{d:"M26.4 7.58H33V8.68H26.4z"}),a.default.createElement("path",{d:"M0 9.94H6.6V11.04H0z"}),a.default.createElement("path",{d:"M8.8 9.94H15.4V11.04H8.8z"}),a.default.createElement("path",{d:"M17.6 9.94H24.200000000000003V11.04H17.6z"}),a.default.createElement("path",{d:"M26.4 9.94H33V11.04H26.4z"}),a.default.createElement("path",{d:"M0 12.3H6.6V13.4H0z"}),a.default.createElement("path",{d:"M8.8 12.3H15.4V13.4H8.8z"}),a.default.createElement("path",{d:"M26.4 12.3H33V13.4H26.4z"}),a.default.createElement("path",{d:"M0 14.65H6.6V15.75H0z"}),a.default.createElement("path",{d:"M8.8 14.65H15.4V15.75H8.8z"}),a.default.createElement("path",{d:"M26.4 14.65H33V15.75H26.4z"}),a.default.createElement("path",{d:"M0 17.01H6.6V18.110000000000003H0z"}),a.default.createElement("path",{d:"M8.8 17.01H15.4V18.110000000000003H8.8z"}),a.default.createElement("path",{d:"M26.4 17.01H33V18.110000000000003H26.4z"}),a.default.createElement("path",{d:"M0 19.37H6.6V20.470000000000002H0z"}),a.default.createElement("path",{d:"M26.4 19.37H33V20.470000000000002H26.4z"})),"SWOT");t.default=o},969:function(e,t,r){e.exports=r.p+"static/media/pdf.3d17c449.svg"},97:function(e,t,r){var n=r(51);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(0)),o=(0,n(r(100)).default)(a.default.createElement(a.default.Fragment,null,a.default.createElement("path",{fill:"none",d:"M3,19.77a1,1,0,0,1,.29-.7l2.43-2.43a1,1,0,0,1,1.41,0,1,1,0,0,1,0,1.42L4.65,20.48a1,1,0,0,1-1.41,0A1,1,0,0,1,3,19.77Z"}),a.default.createElement("path",{d:"M3,19.77a1,1,0,0,1,.29-.7l2.43-2.43a1,1,0,0,1,1.41,0,1,1,0,0,1,0,1.42L4.65,20.48a1,1,0,0,1-1.41,0A1,1,0,0,1,3,19.77Z"}),a.default.createElement("g",null,a.default.createElement("path",{d:"M3.15,4.67A1,1,0,0,1,4.86,4L7.28,6.38a1,1,0,0,1,0,1.42,1,1,0,0,1-1.41,0L3.44,5.37A1,1,0,0,1,3.15,4.67Z"}),a.default.createElement("path",{d:"M15.67,17.18a1,1,0,0,1,.29-.7,1,1,0,0,1,1.41,0L19.8,18.9a1,1,0,0,1-1.42,1.42L16,17.89A1,1,0,0,1,15.67,17.18Z"}),a.default.createElement("path",{d:"M15.67,7.09A1,1,0,0,1,16,6.38L18.38,4A1,1,0,0,1,19.8,4a1,1,0,0,1,0,1.41L17.37,7.8A1,1,0,0,1,16,7.8,1,1,0,0,1,15.67,7.09Z"}),a.default.createElement("path",{d:"M.73,12a1,1,0,0,1,1-1H6.58a5.26,5.26,0,0,1,4.13-4.13V1.44a1,1,0,1,1,2,0V7.78a1,1,0,0,1-1,1A3.23,3.23,0,0,0,8.48,12a1,1,0,0,1-1,1H1.73A1,1,0,0,1,.73,12Z"}),a.default.createElement("path",{d:"M10.71,22.56V16.22a1,1,0,0,1,1-1A3.22,3.22,0,0,0,14.93,12a1,1,0,0,1,1-1h6.34a1,1,0,0,1,0,2H16.83a5.23,5.23,0,0,1-4.12,4.13v5.43a1,1,0,0,1-2,0Z"}))),"Brigth");t.default=o},986:function(e,t,r){e.exports=r.p+"static/media/googlePlay-ptBR.6583181e.png"},987:function(e,t,r){e.exports=r.p+"static/media/appleStore-ptBR.2049e321.png"},993:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAMAAACahl6sAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAG2YAABzjgAA+swAAIT6AAB5gQAA/RMAADBtAAASKQ0eJk4AAAMAUExURevr7Jydn5manJucnuPj5JiZm9vb3PT09MvLzMLCw5GSlPr6+qeoqdXV1tHR0rW1trW2uKusrbi4urO0tLq6vKiqq7e4uLW2tqGipLm6ury8vr6+vr+/wLu8vM7OztDQ0cjJytjY2dTU1aipqqqrrMXGxqanqKmqq6Wmp9LT062usKSlprS0ta2trra2t6ytrqWmqK2ur66vsK6ur7CwsbOztK+vsK+wsbKys7GxsqOkpqOkpZ6foampq6qqrJ2eoKenqaysraKjpZqbnbi4uaKjpKSlp5eYmqioqqurrKChory8vKGio6amqKCho7Gys7CxsrGysrKzs5+gop+gobS1tbq6u7e3uLCxsbKztLi4uJWWmJaXmba3t7i5ub29vZWXmZSWmLq6upOVl5SVl7m5up6foLq7u7u7vJqcnZOUlpeZm5aYmpKUlry8vZKTlpGTlZCRlJCRk6ytr9bX197e3q+vsb2+v8DAweDh4bOztebm5ujp6e/v756eoP///4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///zfARREAAAeqSURBVHja7N3xVxJZFMBxQAQVilzPSTslBxcDdwdtBQRBDQUFBYNMDTcoNLAMM7QD23JozvvX94cJZBhQZ+bdO2/26F/Q59wv8K48JwP5n/wY7iH3kHvIPYT6D89bLBazfiF8Y+T09PT09MOHzc3Nd+8yeoTwb99+/PjkSbfj8eN83qYPSCOTOTs7O3veEP69UkcegEIdMpPJCI6zz5/f9p9HPp9//97KMsTwLZO5o2Nh4RmrkHrpmxzHwsICzyLEWSq1IXd1TE6aWYNYSqVSqSRzHpOTDsdDliC2ksBQ4HA4zOxA6iURRJ7DccizAbE9fVpyNXhlXTkcjsNDHxMQKyGEWBV35Tg89Pl8rKTVUtHVoc/n89mYgPBK3686Dt8EIcQwMzOjKUTF+1XHMbG0tLT095s3y8vL77WCqHq/Ehy+Lsdybm9aC4irRKGrLkcut7cXiUTQIS1588jfPo/cXiQSibxGhtTpdyU4kCElyq/zXMdx9AwT0qI+j1zbEQwiQmyUX+fXXR0Fg0EXGsQK1dXRUTAYDIbRIJBdBYNhNIgFsqtgOBx2IkFguwqHQyEcSAu2q3AICwLcVSjEh1oYEPCuQgbix4A4obsK+QmPAwHtKhTy+3+gvEacsF2F/H5/wIAIAevK7/cHAhgQgPNuzzwCgcAiFgSoK3/bgQWhuUdJuwosYkGgu1pcnDdgQCju5wPmMY8CAeyqPY/5+To8BKErPAjY50fb8QIHAnIu6Z7HCxwI0Lmk24ECge8KB4LQ1YuNDYS3X4SuNjbGESAIXW2M40DAuxofH0c4ayF0hQNB6AoJAt8VDgShq/GdHQwIYFfteezMIkCgzrsiBwZkhPp+LulqFgXyB/X9XDoPFEgTviscCE99P+/+/PjlwIAQ6vu5dB4vX2JAALvaaTu8OBCoc0m7q5deHAjYuaQzD68fAwJ3Luk4vC4MyAh4V17vAwxIE7orr9fLY0AIdFde7xpBg8B09cuBCAHtyrvmxoLAdrXm/h0DUgfvas3tdvPQEBdCV2632+3eHgWFwL9ftR12+yYg5CfIfi7pyu3ettvtdkAI2B4lnYfdbndBQiD28wGO9XUwiAFmP5e8zu0CxGOFgrgQu1pf93hcUJA84HlX/DoXIDkoCNB+3r8rj8fjgYIA7ef9u4KGoHXl8XheAUKAzyXdXXlezcFBwM8lXV29moODoHY1BwfB7QoSgtoVIARuj+rXFTAEtCvxPJKPoCBm1K6SyZ9gx3jorrodc0kObh/B7CrJzQJCELviZA1EJsQAtp9LuwKFENA9SjwPbhoSYgbbzwVGl0PeQGT/gg5sP+/tipuFhRCkruQORD5kFPa8qzAsJb/Ehj3v/uqKM8NDSANmPxd11cD5fgS8K5Q/3yOE2L7l9vYWALpKPuI4jsP7M3DhB+JcovyBbmoeJ0K/K45oASG0u0py09pAND7v0oM0qe7nSU4zCKG7R2kJofw5yGsFcVLcz1UOROXztah2pSWE6vkqatUO0qS2n3McFyXaQYiP2h6l0qH6qYCU9nMuGmUBon6P4qLRh9pCrJS6UjsQ9Q+cXKKwR3HRaPQfrSGESlfRFaI5pK7284OKg8aDiyl0tcIEpKV4j6LooPIoaYParlZ4NiBE2X5+7fiXMAIh6rpaIcxAeDVdUXHQem78A/n7ecfRYAlCphXsURTnQfG/JJC/RwkO9iCy9yjBEWcNoqyrlTiTEPldxZmEKOgqHt9iDyL782MlHo9vsQeRtZ9fO5iDyNyjOg72IIq62tqaYg0ib4+6drAJkd3VFJMQBV1NTe2yC5HTFZOQO+9R3fPYZQ4iu6spwcEq5PY9StTV7m6WLYjtVFlXu9nsCDMQi9+ruKtsNptOp9N/WTWHmJ/I2s8l88im0+n0/v7+Qc6mHcSiZI8a4Dg4OFhdVXGnRjHks9I9StpVx7G6uvrpU8yJCHmudD+/cR6CIxaLxR5gQJT/3ufOjljMaDQ6ASHN18q+P5fRVcdhNBqNQ9tWAEhL+ffnCuZhNBqNQ0NDQ0N+qpCmyu85lTu+fEkkEnYLDcio6u/PFXbVcSQSiYTJ5FQFeU7le0518xAcJpPJNKMMUqL0/Tk1h2l4eHh4RB6kPkHlHvKA827HsS/bMXx+nvqtdUcItfvt9OcxfH6eSqVSqa8/boU06d2/AnR8LRaLN0Pq9O6339aVckfqa7FYLB7fBKF0DxlhHsXj42PjQEgIqqspCEehUBgA8dG5347S1fFxoVAo2PpCWrrqqlAoFE5OWn0gBr11VTg5Oan0gdC63w45j1Svo2KVQujdQ8bq6qRSqVQkkAlq95DxuqpUKmUJhNb9dsyuKpVyeVQC0WNX5XK52gOx6LKrcrlabYghE5Tut+N2VS5Xq3YxhNo9ZNyuqtXqhQhipXS/HburavVCDKkzvUcN7qp60QPZ1GtXFxc1EYTV/fwaMmgetV4Iu/v5jV3VarW6CML2fj64q1qt9mc3hPX9fPA8ape9ED3sUX3mcXl5KYboY4/q5xgTQdjfz/t31QvRb1djYz0QvXYlhbC/n/ftqgeinz1KMo8eiG72KKlDBNHPHtXbVT+ILrsaG7vqgei0q6ur770QfXZ19V2A/DcAHpmC7NcZ4/wAAAAASUVORK5CYII="},998:function(e,t,r){e.exports=r.p+"static/media/Mockup_App_WEB.0ed158a4.png"},999:function(e,t,r){e.exports=r.p+"static/media/supportMockup.ec51b4aa.png"}},[[1060,1,2]]]);
//# sourceMappingURL=main.b89854e0.chunk.js.map