(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8005],{23354:function(e,t,n){"use strict";n.d(t,{JL:function(){return a},Pz:function(){return l},MC:function(){return s},DK:function(){return c}});var r=n(9669),i=n.n(r),o=n(46835);function a(){return i()("".concat("https://www.linquip.com/api-java","/location/region"))}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.regionId;return i()({url:"".concat("https://www.linquip.com/api-java","/location/region/").concat(t,"/states")})}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.stateId;return i()({url:"".concat("https://www.linquip.com/api-java","/location/state/").concat(t,"/cities")})}var c=function(){return(0,o.Z)({url:"".concat("https://www.linquip.com/api-java","/location/suggest")})}},48204:function(e,t,n){"use strict";var r=n(94184),i=n.n(r),o=(n(67294),n(5152)),a=n(23937),l=n.n(a),s=n(85893),c=(0,o.default)((function(){return n.e(885).then(n.bind(n,40885))}),{loadableGenerated:{webpack:function(){return[40885]},modules:["../components/basic/CPureTruncate/index.tsx -> ./CFeatureRichTruncate"]}});t.Z=function(e){var t=e.As,n=void 0===t?"div":t,r=e.lines,o=void 0===r?1:r,a=e.style,u=void 0===a?{}:a,d=e.className,f=void 0===d?"":d,p=e.noTooltip,m=void 0!==p&&p,v=e.interactive,h=void 0!==v&&v,g=e.ellipsisClassName,x=void 0===g?"":g,b=e.children;if(h)return(0,s.jsx)(c,{As:n,lines:o,style:u,className:f,noTooltip:m,ellipsisClassName:x,children:b});return(0,s.jsx)(n,{style:u,className:i()("inline-block",f,l().ellipsis,l()[{1:"ellipsis-1",2:"ellipsis-2",3:"ellipsis-3",4:"ellipsis-4",5:"ellipsis-5",6:"ellipsis-6",7:"ellipsis-7",8:"ellipsis-8",9:"ellipsis-9",10:"ellipsis-10"}[o]]),title:!m&&o<=3&&"string"===typeof b?b:void 0,children:b})}},59537:function(e,t,n){"use strict";n.d(t,{I:function(){return h}});var r=n(92809),i=n(91164),o=n(7648),a=n(67294),l=n(88733),s=n(85893),c=["size"];function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t=0}},t))}},81433:function(e,t,n){"use strict";var r,i,o,a,l,s=n(92809),c=n(91164),u=n(52209),d=n(67294),f=n(59016),p=n(53662),m=n.n(p),v=n(65411),h=n(85893),g=["error","label","style","className","disabled","hideAutoComplete","onChange","delay"];function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.id_a,n=void 0===t?(0,o.generate)():t,r=e.id_b,s=void 0===r?(0,o.generate)():r,u=e.width,d=void 0===u?160:u,f=e.height,p=void 0===f?160:f,m=e.fill,v=void 0===m?"#bdbdbd":m,h=e.background,g=void 0===h?"none":h,x=(0,i.Z)(e,l);return(0,a.jsxs)("svg",c(c({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 120 120",width:d,height:p},x),{},{children:[(0,a.jsx)("defs",{children:(0,a.jsx)("circle",{id:n,cx:"60",cy:"60",r:"60"})}),(0,a.jsxs)("g",{fill:g,fillRule:"evenodd",children:[(0,a.jsx)("mask",{id:s,fill:"#fff",children:(0,a.jsx)("use",{xlinkHref:"#".concat(n)})}),(0,a.jsxs)("g",{mask:"url(#".concat(s,")"),children:[(0,a.jsx)("path",{fill:"#E0E0E0",d:"M0 0h120v120H0z"}),(0,a.jsx)("path",{fill:v,d:"M11 120c-.044-9.422 1.676-15.727 5.162-18.914 5.23-4.781 7.352-3.826 13.383-3.826l.555-.008c6.101-.188 16.045-3.555 15.185-19.526l-.201-.18c-1.675-1.566-5.593-6.804-7.31-13.378-2.532-.923-5.349-8.575-1.509-13.22l-.005-.269C36.072 45.85 31.22 16.882 60.086 17c28.866.12 23.649 29.98 23.649 33.948 3.84 4.645 1.023 12.297-1.508 13.22-1.79 6.853-5.974 12.255-7.512 13.558-.878 16.3 9.498 19.471 15.558 19.533l.837-.002c5.538-.06 7.693-.775 12.728 3.829 3.418 3.125 5.138 9.246 5.162 18.363V120H11z"})]})]})]}))}},37237:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return xe}});var r=n(67294),i=n(59016),o=n(18453),a=n(30266),l=n(49711),s=n(809),c=n.n(s),u=n(3569),d=n(90407),f=n(19492),p=n(8097),m=n(73164),v=n(92311),h=n(59537),g=n(92809),x=n(56012),b=n(16383),y=n(90251),j=n(85893);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function w(e){for(var t=1;t-1)||"You have already invited this person"}}),label:"Your Teammate Email",placeholder:"Your Teammate Email",error:null===E||void 0===E||null===(t=E.email)||void 0===t?void 0:t.message}),(0,j.jsx)(f.Z,{rounded:!0,outlined:!0,className:"flex-none ml-2 cursor-pointer text-2 md:mb-0",children:"Send Invitation"})]})]}),!(null===b||void 0===b||!b.length)&&(0,j.jsx)("ul",{className:"px-4 pt-3 md:p-0",children:b.map((function(e,t){return(0,j.jsxs)("div",{className:"flex justify-between w-full pb-4 mb-4 border-b text-primary border-gray last:border-b-0",children:[(0,j.jsx)("div",{children:e.fullname}),(0,j.jsx)("div",{onClick:function(){var t;(t=e).invite?(w(!0),x([])):n({invited:a,existed:[].concat((0,C.Z)(c),[t])})},className:"text-right cursor-pointer text-2 text-secondary",children:e.invite?"Invite to Linquip":"Add"})]},t)}))}),!(null===c||void 0===c||!c.length)&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("p",{className:"text-black heading-5",style:{paddingBottom:8},children:"Your Team:"}),(0,j.jsx)("div",{className:"flex flex-wrap",children:c.map((function(e){return(0,j.jsx)($,{teammate:e,onRemove:T},e.id)}))})]}),!(null===a||void 0===a||!a.length)&&(0,j.jsx)("div",{className:"pt-4 mt-4 border-t border-gray",children:a.map((function(e,t){return(0,j.jsxs)("p",{className:"flex items-center pb-2 text-2 text-primary",children:[(0,j.jsx)("i",{onClick:function(){return function(e){n({existed:c,invited:a.filter((function(t){return t.email!==e.email}))})}(e)},className:"mr-1 text-2xl cursor-pointer icon lfi-delete text-primary-light"}),d?"".concat(e.fullname," (").concat(e.email,") has been invited to Linquip. After registration, he will be added to this project."):"".concat(e.fullname," (").concat(e.email,") will be invited to Linquip after creating the project.")]},t)}))})]})}function ee(e){var t=e.editMode;return(0,j.jsx)(d.Z.Item,{name:"teammates",children:(0,j.jsx)(Q,{editMode:t})})}var te=n(30381),ne=n.n(te);function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ie(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:[];return e.map((function(e){return{count:e.count,equipment:e.equipment}}))},se=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.region_id,n=e.state_id,r=e.city_id,i=e.name,o=e.contractor,a=e.owner,l=e.description,s=e.role,c=e.finished_at,u=e.started_at;return{name:i,contractor:o,owner:a,description:l,location:oe({regionId:t,stateId:n,cityId:r}),duration:ae({startDate:u?1e3*u:null,endDate:c?1e3*c:c,currentlyWorking:u&&null===c}),role:s}},ce=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.projectEquipment,n=void 0===t?[]:t;return{devices:le(n)}},ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{teammates:{existed:e.teammates,invited:[]}}},de=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e){case 1:return se(t);case 2:return ce(t);case 3:return ue(t)}},fe=function(e){return Object.keys(de(e))},pe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,C.Z)(Array(3).keys()).reduce((function(t,n){return n>3?t:ie(ie({},t),de(n+1,e))}),{});return t},me=function(e){var t=e.name,n=e.contractor,r=e.owner,i=e.description,o=e.role,a=e.location,l=e.duration,s=e.devices,c=e.teammates,u=l.startDate,d=l.endDate;return{name:t,contractor:n,owner:r,description:i,role:o,region_id:a.regionId,state_id:a.stateId,city_id:a.cityId,started_at:u.unix(),finished_at:d?null===d||void 0===d?void 0:d.unix():"",devices:s?s.map((function(e){return{id:e.equipment.id,count:e.count}})):[],existTeammates:c.existed?c.existed.map((function(e){return e.id})):[],invitedTeammates:c.invited?c.invited.map((function(e){return{fullname:e.fullname,email:e.email}})):[]}},ve=n(3624),he=(0,r.forwardRef)((function(e,t){var n=e.initialStep,i=void 0===n?1:n,o=e.isEditing,s=e.itemToEdit,v=e.onClose,h=e.onSubmit,g=void 0===h?function(){}:h,x=e.onApply,b=void 0===x?function(){}:x,y=(0,r.useState)(i),O=y[0],w=y[1],Z=(0,r.useState)(0),C=Z[0],N=Z[1],k=(0,r.useRef)(null),I=U.Z.useContainer(),D=I.pushLoading,S=I.popLoading,_=I.loadingType,E=(0,I.isLoadingById)(k.current);(0,r.useImperativeHandle)(t,(function(){return{closeHandler:function(){C&&b(),v()}}}));var A=d.Z.useForm(),T=(0,l.Z)(A,1)[0];function q(e){return R.apply(this,arguments)}function R(){return(R=(0,a.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,ve.$L)({project:t});case 2:(0,u.Am)((0,j.jsx)(p.Z,{type:"success",children:"New project created"})),N(C+1);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function L(e,t){return M.apply(this,arguments)}function M(){return(M=(0,a.Z)(c().mark((function e(t,n){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,ve.ty)({id:t,data:n});case 2:(0,u.Am)((0,j.jsx)(p.Z,{type:"success",children:"Project updated"}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function z(){return F.apply(this,arguments)}function F(){return(F=(0,a.Z)(c().mark((function e(){var t,n;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k.current=D(_.BAR),e.next=3,T.validateFields();case 3:if(t=e.sent,n=me(t),e.prev=5,!o){e.next=11;break}return e.next=9,L(s.id,n);case 9:e.next=13;break;case 11:return e.next=13,q(n);case 13:g(),T.resetFields(),w(1),e.next=23;break;case 18:throw e.prev=18,e.t0=e.catch(5),Object.entries(e.t0.messages).forEach((function(e){"email"===e[0]&&e[1]&&(0,u.Am)((0,j.jsx)(p.Z,{type:"error",children:"Please double check your teammates email"}))})),(0,m.Z)(e.t0,void 0,!0),e.t0;case 23:return e.prev=23,S(k.current),e.finish(23);case 26:case"end":return e.stop()}}),e,null,[[5,18,23,26]])})))).apply(this,arguments)}function B(){return(B=(0,a.Z)(c().mark((function e(){var t;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=fe(O),e.next=3,T.validateFields(t);case 3:if(3===O){e.next=7;break}w((function(e){return e+1})),e.next=17;break;case 7:return e.prev=7,e.next=10,z();case 10:b(),v(),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.log(e.t0);case 17:case"end":return e.stop()}}),e,null,[[7,14]])})))).apply(this,arguments)}return(0,j.jsxs)(d.Z,{preserve:!0,colon:!1,form:T,scrollToFirstError:!0,initialValues:pe(s),className:"relative flex flex-col min-h-full",children:[(0,j.jsx)("div",{className:1===O?"block":"hidden",children:(0,j.jsx)(P,{})}),(0,j.jsx)("div",{className:2===O?"block":"hidden",children:(0,j.jsx)(K,{})}),(0,j.jsx)("div",{className:3===O?"block":"hidden",children:(0,j.jsx)(ee,{editMode:!(null===s||void 0===s||!s.id)})}),(0,j.jsxs)("div",{className:"flex flex-wrap-reverse justify-end mt-auto",children:[O>1&&(0,j.jsx)(f.f,{outlined:!0,rounded:!0,loading:E,onClick:function(){return w((function(e){return e-1}))},className:"mr-4",style:{minWidth:80},children:"Back"}),3===O&&!o&&(0,j.jsx)(f.f,{rounded:!0,loading:E,onClick:z,outlined:!0,className:"flex-1 mr-2 heading-5",children:E?"Adding new Project":"Apply and Add Another Project"}),(0,j.jsx)(f.f,{main:!0,rounded:!0,loading:E,onClick:function(){return B.apply(this,arguments)},style:{minWidth:100},children:O<3?"Continue":"Apply"})]})]})})),ge=(0,i.ZP)(o.Z).withConfig({displayName:"FormDrawer__S_Drawer",componentId:"sc-1a1eihs-0"})([".ant-drawer-content-wrapper{width:528px !important;max-width:100%;}"]);var xe=function(e){var t=e.isEditing,n=e.itemToEdit,i=e.onClose,o=e.onSubmit,a=e.onApply,l=(0,r.useRef)();return(0,j.jsx)(ge,{placement:"right",title:(t?"Edit":"Add")+" project",visible:!0,onClose:function(){return null===l||void 0===l?void 0:l.current.closeHandler()},children:(0,j.jsx)(he,{ref:l,isEditing:t,itemToEdit:n,onClose:i,onSubmit:o,onApply:a})})}},88733:function(e,t,n){"use strict";var r=n(40313);t.Z=function(e){var t=(0,r.Z)().isMobile;return e||(t?"small":"large")}},74010:function(e,t,n){"use strict";n.d(t,{D:function(){return i}});var r=n(92145);function i(){return!!(0,r.v9)((function(e){var t,n;return null===(t=e.user)||void 0===t||null===(n=t.profile)||void 0===n?void 0:n.detail}))}},54132:function(e,t,n){"use strict";n.d(t,{Z:function(){return g}});var r=n(49711),i=n(30266),o=n(809),a=n.n(o),l=n(67294),s=n(92145),c=n(78291),u=n(46728),d=n(23354),f=u.K.actions,p=f.setRegions,m=f.setStates,v=f.setCities;function h(){var e=(0,s.I0)(),t=(0,s.v9)((function(e){return e.locations})),n=(0,l.useCallback)((0,i.Z)(a().mark((function n(){var r,i;return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(null!==t&&void 0!==t&&t.length){n.next=15;break}return n.prev=1,n.next=4,(0,d.JL)();case 4:return r=n.sent,i=r.data,e(p(i)),n.abrupt("return",i);case 10:return n.prev=10,n.t0=n.catch(1),n.abrupt("return",[]);case 13:n.next=16;break;case 15:return n.abrupt("return",t);case 16:case"end":return n.stop()}}),n,null,[[1,10]])}))),[e,t]),r=(0,l.useCallback)(function(){var n=(0,i.Z)(a().mark((function n(r){var i,o,l,s;return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(null!==(o=(null===(i=t.find((function(e){return e.id===r})))||void 0===i?void 0:i.children)||[])&&void 0!==o&&o.length){n.next=16;break}return n.prev=2,n.next=5,(0,d.Pz)({regionId:r});case 5:return l=n.sent,s=l.data,e(m({regionId:r,states:s})),n.abrupt("return",s);case 11:return n.prev=11,n.t0=n.catch(2),n.abrupt("return",[]);case 14:n.next=17;break;case 16:return n.abrupt("return",o);case 17:case"end":return n.stop()}}),n,null,[[2,11]])})));return function(e){return n.apply(this,arguments)}}(),[e,t]),o=(0,l.useCallback)(function(){var n=(0,i.Z)(a().mark((function n(r,i){var o,l,s,c,u,f;return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(s=(null===(o=t.find((function(e){return e.id===r})))||void 0===o?void 0:o.children)||[],null!==(c=(null===(l=s.find((function(e){return e.id===i})))||void 0===l?void 0:l.children)||[])&&void 0!==c&&c.length){n.next=17;break}return n.prev=3,n.next=6,(0,d.MC)({stateId:i});case 6:return u=n.sent,f=u.data,e(v({regionId:r,stateId:i,cities:f})),n.abrupt("return",f);case 12:return n.prev=12,n.t0=n.catch(3),n.abrupt("return",[]);case 15:n.next=18;break;case 17:return n.abrupt("return",c);case 18:case"end":return n.stop()}}),n,null,[[3,12]])})));return function(e,t){return n.apply(this,arguments)}}(),[e,t]);return{locations:t,getRegions:n,getStatesByRegionId:r,getCitiesByRegionAndStateId:o}}function g(e){var t=e.regionId,n=e.stateId,i=e.cityId,o=h(),a=o.getRegions,s=o.getStatesByRegionId,u=o.getCitiesByRegionAndStateId,d=(0,c.Z)({loading:!1,list:[]}),f=(0,r.Z)(d,2),p=f[0],m=f[1];(0,l.useEffect)((function(){m({loading:!0}),a().then((function(e){return m({loading:!1,list:e})}))}),[]);var v=(0,l.useMemo)((function(){return p.list.find((function(e){return e.id===t}))}),[p,t]),g=(0,c.Z)({loading:!1,list:[]}),x=(0,r.Z)(g,2),b=x[0],y=x[1];(0,l.useEffect)((function(){t&&(y({loading:!0}),s(t).then((function(e){return y({loading:!1,list:e})})))}),[t]);var j=(0,l.useMemo)((function(){return b.list.find((function(e){return e.id===n}))}),[b,n]),O=(0,c.Z)({loading:!1,list:[]}),w=(0,r.Z)(O,2),Z=w[0],P=w[1];(0,l.useEffect)((function(){t&&n&&(P({loading:!0}),u(t,n).then((function(e){return P({loading:!1,list:e})})))}),[t,n]);var C=(0,l.useMemo)((function(){return Z.list.find((function(e){return e.id===i}))}),[Z,i]);return{regions:p,selectedRegion:v,stateForSelectedRegion:b,selectedState:j,citiesForSelectedState:Z,selectedCity:C}}},97985:function(e,t,n){"use strict";function r(e,t){var n,r=this;return function(){for(var i=arguments.length,o=new Array(i),a=0;a